troubleshoot-website

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Troubleshoot a website

排查网站故障

One website and one symptom in; a named cause, the evidence for it, and a fix out. Stay read-only until the cause is stated and the user agrees to the fix.
输入一个网站和一种症状;输出明确的原因、相关证据和一项修复方案。在说明原因并得到用户同意修复之前,始终保持只读状态。

Calling the operations

调用操作

  • Read the
    inputSchema
    that
    search
    returns before the first call of each operation. If a name below is rejected as unknown,
    search
    for what the step does (e.g. "ssl status").
  • Batch reads with
    multi-execute
    and pass values between steps with
    $steps.<i>.<path>
    , e.g.
    "$steps.0.data.0.username"
    . A batch stops at its first failure.
  • The Hostinger Connector runs each product as its own MCP server (
    hosting
    ,
    wordpress
    ,
    agency-hosting
    ,
    domains
    ,
    dns
    ), so a batch can only chain operations from one server. When
    search
    cannot find an operation, that product group is switched off in the Connector — ask the user to enable it.
  • 首次调用每项操作前,读取
    search
    返回的
    inputSchema
    。如果下面的某个名称被判定为未知,请通过
    search
    查找该步骤执行的操作(例如 "ssl status")。
  • 使用
    multi-execute
    批量执行读取操作,并通过
    $steps.<i>.<path>
    在步骤之间传递值,例如
    "$steps.0.data.0.username"
    。一个批次在首次失败时即停止。
  • Hostinger Connector 将每个产品作为独立的 MCP server(
    hosting
    、
    wordpress
    、
    agency-hosting
    、
    domains
    、
    dns
    ),因此一个批次只能串联来自同一 server 的操作。当
    search
    找不到某项操作时,说明该产品组已在 Connector 中关闭——请用户将其启用。

1. Find the website

1. 查找网站

Run both lookups, and keep the result for every later call:
  • hosting_websites_list
    with
    domain
    — Shared and Cloud plans. The filter is a substring match, so take the entry whose
    domain
    is exactly the one asked about. Keep
    username
    ,
    order_id
    and
    website_type
    ; every
    hosting_*
    and
    wordpress_*
    call is keyed on
    username
    +
    domain
    .
  • agency-hosting_websites_list-plan
    with
    domain
    — Agency Plan. Keep
    details.uid
    (the
    website_uid
    of every
    agency-hosting_*
    call),
    details.type
    ,
    details.ipv4
    and
    details.domains
    .
Neither finds it: the domain is not a website on this account — say so and show where it points (step 2).
同时执行两项查找,并保留结果供后续每次调用使用:
  • hosting_websites_list
    传入
    domain
    ——用于 Shared 和 Cloud 套餐。该过滤器采用子字符串匹配,因此应选择
    domain
    与用户所询问域名完全一致的条目。保留
    username
    、
    order_id
    和
    website_type
    ;每次调用
    hosting_*
    和
    wordpress_*
    都需使用
    username
    +
    domain
    作为键。
  • agency-hosting_websites_list-plan
    传入
    domain
    ——用于 Agency Plan。保留
    details.uid
    (每次调用
    agency-hosting_*
    时使用的
    website_uid
    )、
    details.type
    、
    details.ipv4
    和
    details.domains
    。
如果两者都找不到,该域名就不是此账户下的网站——明确告知用户,并展示其指向位置(第 2 步)。

2. Look at it from outside

2. 从外部检查

Run these alongside step 1:
bash
curl -sS -o /dev/null -w "%{http_code} ttfb=%{time_starttransfer}s %{redirect_url}\n" https://DOMAIN/
curl -sSI https://DOMAIN/
dig +short NS DOMAIN; dig +short A DOMAIN; dig +short CAA DOMAIN
  • Hostinger responses carry
    platform: hostinger
    and
    panel: hpanel
    . Without them, or with DNS pointing elsewhere, traffic is not reaching this hosting — hand over to the
    connect-domain
    skill.
  • Certificate or TLS errors → SSL.
  • 5xx
    , a blank page or an error page → By website type.
  • 200
    with old content → cache:
    hosting_cache_clear
    (also purges the Hostinger CDN; pass
    directory
    for WordPress in a subfolder), plus
    wordpress_litespeed-cache_purge-lite-speed
    for WordPress; Agency:
    agency-hosting_cache_clear-website
    .
  • Slow first byte → Slow site. Behind the Hostinger CDN,
    x-hcdn-upstream-rt
    is the origin's own response time in seconds; a small value there means the server is not the bottleneck.
与第 1 步同时执行以下操作:
bash
curl -sS -o /dev/null -w "%{http_code} ttfb=%{time_starttransfer}s %{redirect_url}\n" https://DOMAIN/
curl -sSI https://DOMAIN/
dig +short NS DOMAIN; dig +short A DOMAIN; dig +short CAA DOMAIN
  • Hostinger 响应包含
    platform: hostinger
    和
    panel: hpanel
    。如果缺少这些标头,或 DNS 指向其他位置,流量就没有到达此托管环境——移交给
    connect-domain
    skill 处理。
  • 证书或 TLS 错误 → SSL。
  • 5xx
    、空白页或错误页 → 按网站类型。
  • 返回
    200
    但内容陈旧 → cache:使用
    hosting_cache_clear
    (也会清除 Hostinger CDN 的 cache;如果 WordPress 位于子文件夹中,请传入
    directory
    ),WordPress 还需要使用
    wordpress_litespeed-cache_purge-lite-speed
    ;Agency 使用
    agency-hosting_cache_clear-website
    。
  • 首字节响应缓慢 → 网站缓慢。位于 Hostinger CDN 后方时,
    x-hcdn-upstream-rt
    表示源站自身的响应时间(秒);该值很小意味着 server 不是瓶颈。

3. By website type

3. 按网站类型处理

website_type
(Shared/Cloud) or
details.type
(Agency) picks the branch.
builder
and
horizons
sites are not managed by these operations — send the user to hPanel.
根据
website_type
(Shared/Cloud)或
details.type
(Agency)选择对应分支。
builder
和
horizons
网站不由这些操作管理——请用户前往 hPanel。

Node.js (
nodejs
)

Node.js(
nodejs
)

Batch
hosting_get-deployment
(the latest build with its log, failure analysis and stored settings),
hosting_nodejs_runtime-logs
(
period: "1h"
,
levels: ["ERROR", "WARN"]
) and
hosting_nodejs_list-environment-variables
(keys only; values always come back masked).
  • Latest build
    failed
    :
    hosting_get-deployment
    already holds the
    analysis
    (fetched once per build — the API re-runs it on every call and allows 5 a minute). A wrongly detected framework, output directory or missing
    entry_file
    is the usual cause: compare the returned
    buildSettings
    with the project and deploy again with corrected
    appType
    ,
    outputDirectory
    ,
    buildScript
    or
    entryFile
    ; a Git deploy stores them, so pushes build correctly too. A site deployed on the hosted server from uploaded files has no
    hosting_deploy
    to repeat: rebuild through
    hosting_nodejs_start-build
    with the corrected values and store them with
    hosting_nodejs_update-build-settings
    .
  • Build
    completed
    but the app errors: read the runtime logs; entries older than
    last_deployed_at
    belong to the previous deploy. A variable the code reads but the key list lacks is fixed with the
    deploy-to-hosting
    skill's environment step.
    Access denied for user '…'@'::1'
    means the app connects to
    localhost
    —
    DB_HOST
    must be
    127.0.0.1
    .
  • Hung process:
    hosting_nodejs_restart-application
    (restarts without rebuilding).
批量执行
hosting_get-deployment
(获取最新构建及其日志、失败分析和已保存的设置)、
hosting_nodejs_runtime-logs
(
period: "1h"
、
levels: ["ERROR", "WARN"]
)和
hosting_nodejs_list-environment-variables
(仅返回键;值始终经过掩码处理)。
  • 最新构建状态为
    failed
    :
    hosting_get-deployment
    已包含
    analysis
    (每次构建只获取一次——API 每次调用都会重新运行该分析,但每分钟允许调用 5 次)。框架、输出目录检测错误或缺少
    entry_file
    是常见原因:将返回的
    buildSettings
    与项目进行比较,并使用修正后的
    appType
    、
    outputDirectory
    、
    buildScript
    或
    entryFile
    重新部署;Git 部署会保存这些设置,因此后续 push 也能正确构建。通过上传文件部署到托管 server 的网站没有可供重复执行的
    hosting_deploy
    :使用修正后的值通过
    hosting_nodejs_start-build
    重新构建,并通过
    hosting_nodejs_update-build-settings
    保存这些值。
  • 构建状态为
    completed
    ,但应用报错:读取运行时日志;早于
    last_deployed_at
    的记录属于上一次部署。如果代码读取了某个环境变量,但键列表中没有该变量,则使用
    deploy-to-hosting
    skill 的环境变量步骤修复。
    Access denied for user '…'@'::1'
    表示应用正在连接
    localhost
    ——
    DB_HOST
    必须设为
    127.0.0.1
    。
  • 进程卡死:使用
    hosting_nodejs_restart-application
    (无需重新构建即可重启)。

WordPress (
wordpress
)

WordPress(
wordpress
)

wordpress_installations_list
with
username
and
domain
gives the install
id
— the
software
parameter of every
wordpress_*
call. Batch
wordpress_installations_check-if-are-valid
(
software_ids: [id]
,
force: true
),
wordpress_plugins_list-installed
and
wordpress_maintenance_show-status
.
  • Invalid install:
    validation_error
    names the problem.
  • Broken after a plugin or theme change: deactivate suspects one at a time with
    wordpress_plugins_deactivate
    (queued — allow a few seconds), re-run the step 2 check after each, and reactivate with
    wordpress_plugins_activate
    any that were not the cause.
  • Maintenance page stuck:
    wordpress_maintenance_toggle
    with
    enabled: false
    .
  • "Error establishing a database connection":
    hosting_databases_list
    with
    domain
    ; corrupted tables are fixed by
    hosting_databases_repair
    (runs in the background).
    wp-config.php
    cannot be read through the API because files with secrets are refused — for credential checks hand the user
    hosting_databases_phpmyadmin-link
    .
  • Memory or upload-size errors → PHP.
使用
username
和
domain
调用
wordpress_installations_list
,获取安装 ID——它就是每次调用
wordpress_*
时使用的
software
参数。批量执行
wordpress_installations_check-if-are-valid
(
software_ids: [id]
、
force: true
)、
wordpress_plugins_list-installed
和
wordpress_maintenance_show-status
。
  • 安装无效:
    validation_error
    会指出具体问题。
  • 更换 plugin 或 theme 后网站损坏:使用
    wordpress_plugins_deactivate
    逐个停用可疑项(操作会进入队列——请等待几秒),每次操作后重新执行第 2 步检查,并使用
    wordpress_plugins_activate
    重新启用未被确定为原因的项目。
  • 维护页面卡住:使用
    wordpress_maintenance_toggle
    并设置
    enabled: false
    。
  • “Error establishing a database connection”:使用
    domain
    调用
    hosting_databases_list
    ;损坏的数据表可通过
    hosting_databases_repair
    修复(该操作在后台运行)。API 无法读取
    wp-config.php
    ,因为含有密钥的文件会被拒绝——如需检查凭据,请向用户提供
    hosting_databases_phpmyadmin-link
    。
  • 内存或上传大小错误 → PHP。

Static or PHP (
other
)

静态网站或 PHP(
other
)

  • 403
    or
    404
    at
    /
    :
    hosting_files_list-website-and-directories
    with
    max_depth: 1
    .
    index.html
    or
    index.php
    must sit at the document root; finding it one folder down means the archive was packed a level too deep — redeploy it flat with the
    deploy-to-hosting
    skill.
  • Read
    .htaccess
    or other config with
    hosting_files_website-content
    .
  • PHP errors → PHP.
  • 根路径
    /
    返回
    403
    或
    404
    :使用
    hosting_files_list-website-and-directories
    并设置
    max_depth: 1
    。
    index.html
    或
    index.php
    必须位于文档根目录;如果在下一级目录中找到,说明压缩包解包时多嵌套了一层——使用
    deploy-to-hosting
    skill 重新以扁平结构部署。
  • 使用
    hosting_files_website-content
    读取
    .htaccess
    或其他配置。
  • PHP 错误 → PHP。

PHP

PHP

hosting_php_get
returns every extension and option (around 25 KB), so call it only for PHP problems.
hosting_php_update-version
switches versions.
hosting_php_update-options
silently caps values at the plan maximum (
max
in
hosting_php_get
), so read the applied value back. Agency:
agency-hosting_php_list-options-for-website
, then
agency-hosting_php_replace-website-options
— a full replace, so send every custom option that should stay.
hosting_php_get
会返回所有扩展和选项(约 25 KB),因此仅在遇到 PHP 问题时调用。
hosting_php_update-version
用于切换版本。
hosting_php_update-options
会将数值静默限制为套餐上限(上限可通过
hosting_php_get
中的
max
查看),因此需要回读实际应用的值。Agency:先使用
agency-hosting_php_list-options-for-website
,再使用
agency-hosting_php_replace-website-options
——这是一个完整替换操作,因此必须传入所有需要保留的自定义选项。

Agency Plan sites

Agency Plan 网站

agency-hosting_websites_get
shows state and quotas,
agency-hosting_websites_list-processes
shows failed jobs (SSL setup, backups), and
agency-hosting_wordpress_settings
shows core version, LiteSpeed, object cache and maintenance mode. When
wordpress_installations_list
does not return the site, plugins are managed from wp-admin.
agency-hosting_websites_get
显示状态和配额,
agency-hosting_websites_list-processes
显示失败的任务(SSL 配置、备份等),
agency-hosting_wordpress_settings
显示核心版本、LiteSpeed、object cache 和维护模式。当
wordpress_installations_list
未返回该网站时,应通过 wp-admin 管理 plugin。

SSL

SSL

Shared and Cloud,
ssl
in
hosting_websites_get-settings
:
  • not_installed
    or
    failed
    (
    last_error
    says why): the domain must resolve to Hostinger, and any CAA record must allow
    letsencrypt.org
    , before
    hosting_ssl_install
    can succeed. Poll
    hosting_websites_get-settings
    until
    ssl.status
    is
    active
    or
    failed
    .
  • installing
    or
    waiting_for_retry
    : wait — another install request returns 422.
  • Free
    *.hostingersite.com
    subdomains use a platform certificate; installing returns 422 by design.
  • Browser still warns while the certificate is
    active
    : turn on the redirect with
    hosting_websites_update-settings
    (
    httpsRedirect: true
    ) when
    is_https_redirect_enabled
    is false, otherwise the page loads
    http://
    assets (mixed content) that the app has to change.
Agency,
agency-hosting_ssl_website-status
for each domain: every domain allows three certificate setups per seven days and one request a minute. Check
agency-hosting_websites_list-processes
before
agency-hosting_ssl_install-website
or
agency-hosting_ssl_reinstall-website
, and never retry in a loop.
对于 Shared 和 Cloud,在
hosting_websites_get-settings
中检查
ssl
:
  • 状态为
    not_installed
    或
    failed
    (
    last_error
    会说明原因):域名必须解析到 Hostinger,并且任何 CAA 记录都必须允许
    letsencrypt.org
    ,之后
    hosting_ssl_install
    才能成功。轮询
    hosting_websites_get-settings
    ,直至
    ssl.status
    变为
    active
    或
    failed
    。
  • 状态为
    installing
    或
    waiting_for_retry
    :请等待——再次发起安装请求会返回 422。
  • 免费的
    *.hostingersite.com
    子域名使用平台证书;按照设计,安装操作会返回 422。
  • 证书状态为
    active
    ,但浏览器仍显示警告:当
    is_https_redirect_enabled
    为 false 时,使用
    hosting_websites_update-settings
    开启重定向(
    httpsRedirect: true
    );否则页面会加载
    http://
    资源(混合内容),需要由应用自行更改。
对于 Agency,使用
agency-hosting_ssl_website-status
检查每个域名:每个域名每七天允许配置三次证书,并且每分钟只能发起一个请求。在调用
agency-hosting_ssl_install-website
或
agency-hosting_ssl_reinstall-website
前,先检查
agency-hosting_websites_list-processes
,切勿循环重试。

Slow site

网站缓慢

  • WordPress:
    wordpress_litespeed-cache_show-lite-speed-status
    and
    wordpress_object-cache_show-memcached-status
    . Turning on Memcached with
    wordpress_object-cache_toggle-memcached
    is the usual quick win.
  • Other sites: server caching may be off or development mode left on.
    hosting_websites_get-settings
    shows both in
    cache
    (
    is_enabled
    ,
    is_cacheless_mode_enabled
    ); fix them with
    hosting_websites_update-settings
    (
    cache: true
    ,
    cachelessMode: false
    ). Development mode takes a few minutes to turn off.
  • PHP 7.x runs markedly slower than 8.x; propose a supported 8.x version from
    hosting_php_get
    when the app allows it.
  • Agency:
    agency-hosting_metrics_list-order-resource-usage
    with
    time_frame_hours: 24
    shows CPU, memory and processes per website against the plan quota.
  • Shared and Cloud have no CPU or memory metrics in the API. When the evidence points at resource limits, send the user to hPanel's resource usage page.
  • WordPress:使用
    wordpress_litespeed-cache_show-lite-speed-status
    和
    wordpress_object-cache_show-memcached-status
    。通常可通过
    wordpress_object-cache_toggle-memcached
    开启 Memcached 快速提升性能。
  • 其他网站:server cache 可能已关闭,或者仍启用了开发模式。
    hosting_websites_get-settings
    的
    cache
    中会同时显示这两项(
    is_enabled
    、
    is_cacheless_mode_enabled
    );使用
    hosting_websites_update-settings
    进行修复(
    cache: true
    、
    cachelessMode: false
    )。关闭开发模式需要几分钟时间。
  • PHP 7.x 的运行速度明显慢于 8.x;如果应用支持,建议从
    hosting_php_get
    获取受支持的 8.x 版本。
  • Agency:使用
    agency-hosting_metrics_list-order-resource-usage
    并设置
    time_frame_hours: 24
    ,可查看每个网站的 CPU、内存和进程用量及其套餐配额。
  • Shared 和 Cloud 的 API 不提供 CPU 或内存指标。当证据指向资源限制时,请用户前往 hPanel 的资源用量页面。

Apply the fix

应用修复

State the cause, the evidence and the single change proposed, and make it only after the user agrees. Then re-run the step 2 check, polling any queued job first, to show the symptom is gone. When the fix needs something the API cannot do, say so and name the hPanel page.
说明原因、证据以及拟进行的一项更改,并且仅在用户同意后执行。然后重新执行第 2 步检查;如涉及排队任务,先轮询任务状态,以展示症状已经消失。当修复需要执行 API 无法完成的操作时,应明确说明,并指出用户应前往的 hPanel 页面。

Not available through the API

API 无法提供的功能

  • Website backups and restores — hPanel's Backups page.
  • CPU, memory and process usage for Shared and Cloud plans.
  • PHP error and access logs.
  • 网站备份和恢复——hPanel 的 Backups 页面。
  • Shared 和 Cloud 套餐的 CPU、内存及进程用量。
  • PHP 错误日志和访问日志。