troubleshoot-website
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTroubleshoot 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 that
inputSchemareturns before the first call of each operation. If a name below is rejected as unknown,searchfor what the step does (e.g. "ssl status").search - Batch reads with and pass values between steps with
multi-execute, e.g.$steps.<i>.<path>. A batch stops at its first failure."$steps.0.data.0.username" - The Hostinger Connector runs each product as its own MCP server (,
hosting,wordpress,agency-hosting,domains), so a batch can only chain operations from one server. Whendnscannot find an operation, that product group is switched off in the Connector — ask the user to enable it.search
- 首次调用每项操作前,读取 返回的
search。如果下面的某个名称被判定为未知,请通过inputSchema查找该步骤执行的操作(例如 "ssl status")。search - 使用 批量执行读取操作,并通过
multi-execute在步骤之间传递值,例如$steps.<i>.<path>。一个批次在首次失败时即停止。"$steps.0.data.0.username" - Hostinger Connector 将每个产品作为独立的 MCP server(、
hosting、wordpress、agency-hosting、domains),因此一个批次只能串联来自同一 server 的操作。当dns找不到某项操作时,说明该产品组已在 Connector 中关闭——请用户将其启用。search
1. Find the website
1. 查找网站
Run both lookups, and keep the result for every later call:
- with
hosting_websites_list— Shared and Cloud plans. The filter is a substring match, so take the entry whosedomainis exactly the one asked about. Keepdomain,usernameandorder_id; everywebsite_typeandhosting_*call is keyed onwordpress_*+username.domain - with
agency-hosting_websites_list-plan— Agency Plan. Keepdomain(thedetails.uidof everywebsite_uidcall),agency-hosting_*,details.typeanddetails.ipv4.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——用于 Shared 和 Cloud 套餐。该过滤器采用子字符串匹配,因此应选择domain与用户所询问域名完全一致的条目。保留domain、username和order_id;每次调用website_type和hosting_*都需使用wordpress_*+username作为键。domain - 传入
agency-hosting_websites_list-plan——用于 Agency Plan。保留domain(每次调用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 and
platform: hostinger. Without them, or with DNS pointing elsewhere, traffic is not reaching this hosting — hand over to thepanel: hpanelskill.connect-domain - Certificate or TLS errors → SSL.
- , a blank page or an error page → By website type.
5xx - with old content → cache:
200(also purges the Hostinger CDN; passhosting_cache_clearfor WordPress in a subfolder), plusdirectoryfor WordPress; Agency:wordpress_litespeed-cache_purge-lite-speed.agency-hosting_cache_clear-website - Slow first byte → Slow site. Behind the Hostinger CDN, is the origin's own response time in seconds; a small value there means the server is not the bottleneck.
x-hcdn-upstream-rt
与第 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。如果缺少这些标头,或 DNS 指向其他位置,流量就没有到达此托管环境——移交给panel: hpanelskill 处理。connect-domain - 证书或 TLS 错误 → SSL。
- 、空白页或错误页 → 按网站类型。
5xx - 返回 但内容陈旧 → cache:使用
200(也会清除 Hostinger CDN 的 cache;如果 WordPress 位于子文件夹中,请传入hosting_cache_clear),WordPress 还需要使用directory;Agency 使用wordpress_litespeed-cache_purge-lite-speed。agency-hosting_cache_clear-website - 首字节响应缓慢 → 网站缓慢。位于 Hostinger CDN 后方时,表示源站自身的响应时间(秒);该值很小意味着 server 不是瓶颈。
x-hcdn-upstream-rt
3. By website type
3. 按网站类型处理
website_typedetails.typebuilderhorizons根据 (Shared/Cloud)或 (Agency)选择对应分支。 和 网站不由这些操作管理——请用户前往 hPanel。
website_typedetails.typebuilderhorizonsNode.js (nodejs
)
nodejsNode.js(nodejs
)
nodejsBatch (the latest build with its log, failure analysis and stored settings), (, ) and (keys only; values always come back masked).
hosting_get-deploymenthosting_nodejs_runtime-logsperiod: "1h"levels: ["ERROR", "WARN"]hosting_nodejs_list-environment-variables- Latest build :
failedalready holds thehosting_get-deployment(fetched once per build — the API re-runs it on every call and allows 5 a minute). A wrongly detected framework, output directory or missinganalysisis the usual cause: compare the returnedentry_filewith the project and deploy again with correctedbuildSettings,appType,outputDirectoryorbuildScript; a Git deploy stores them, so pushes build correctly too. A site deployed on the hosted server from uploaded files has noentryFileto repeat: rebuild throughhosting_deploywith the corrected values and store them withhosting_nodejs_start-build.hosting_nodejs_update-build-settings - Build but the app errors: read the runtime logs; entries older than
completedbelong to the previous deploy. A variable the code reads but the key list lacks is fixed with thelast_deployed_atskill's environment step.deploy-to-hostingmeans the app connects toAccess denied for user '…'@'::1'—localhostmust beDB_HOST.127.0.0.1 - Hung process: (restarts without rebuilding).
hosting_nodejs_restart-application
批量执行 (获取最新构建及其日志、失败分析和已保存的设置)、(、)和 (仅返回键;值始终经过掩码处理)。
hosting_get-deploymenthosting_nodejs_runtime-logsperiod: "1h"levels: ["ERROR", "WARN"]hosting_nodejs_list-environment-variables- 最新构建状态为 :
failed已包含hosting_get-deployment(每次构建只获取一次——API 每次调用都会重新运行该分析,但每分钟允许调用 5 次)。框架、输出目录检测错误或缺少analysis是常见原因:将返回的entry_file与项目进行比较,并使用修正后的buildSettings、appType、outputDirectory或buildScript重新部署;Git 部署会保存这些设置,因此后续 push 也能正确构建。通过上传文件部署到托管 server 的网站没有可供重复执行的entryFile:使用修正后的值通过hosting_deploy重新构建,并通过hosting_nodejs_start-build保存这些值。hosting_nodejs_update-build-settings - 构建状态为 ,但应用报错:读取运行时日志;早于
completed的记录属于上一次部署。如果代码读取了某个环境变量,但键列表中没有该变量,则使用last_deployed_atskill 的环境变量步骤修复。deploy-to-hosting表示应用正在连接Access denied for user '…'@'::1'——localhost必须设为DB_HOST。127.0.0.1 - 进程卡死:使用 (无需重新构建即可重启)。
hosting_nodejs_restart-application
WordPress (wordpress
)
wordpressWordPress(wordpress
)
wordpresswordpress_installations_listusernamedomainidsoftwarewordpress_*wordpress_installations_check-if-are-validsoftware_ids: [id]force: truewordpress_plugins_list-installedwordpress_maintenance_show-status- Invalid install: names the problem.
validation_error - Broken after a plugin or theme change: deactivate suspects one at a time with (queued — allow a few seconds), re-run the step 2 check after each, and reactivate with
wordpress_plugins_deactivateany that were not the cause.wordpress_plugins_activate - Maintenance page stuck: with
wordpress_maintenance_toggle.enabled: false - "Error establishing a database connection": with
hosting_databases_list; corrupted tables are fixed bydomain(runs in the background).hosting_databases_repaircannot be read through the API because files with secrets are refused — for credential checks hand the userwp-config.php.hosting_databases_phpmyadmin-link - Memory or upload-size errors → PHP.
使用 和 调用 ,获取安装 ID——它就是每次调用 时使用的 参数。批量执行 (、)、 和 。
usernamedomainwordpress_installations_listwordpress_*softwarewordpress_installations_check-if-are-validsoftware_ids: [id]force: truewordpress_plugins_list-installedwordpress_maintenance_show-status- 安装无效:会指出具体问题。
validation_error - 更换 plugin 或 theme 后网站损坏:使用 逐个停用可疑项(操作会进入队列——请等待几秒),每次操作后重新执行第 2 步检查,并使用
wordpress_plugins_deactivate重新启用未被确定为原因的项目。wordpress_plugins_activate - 维护页面卡住:使用 并设置
wordpress_maintenance_toggle。enabled: false - “Error establishing a database connection”:使用 调用
domain;损坏的数据表可通过hosting_databases_list修复(该操作在后台运行)。API 无法读取hosting_databases_repair,因为含有密钥的文件会被拒绝——如需检查凭据,请向用户提供wp-config.php。hosting_databases_phpmyadmin-link - 内存或上传大小错误 → PHP。
Static or PHP (other
)
other静态网站或 PHP(other
)
other- or
403at404:/withhosting_files_list-website-and-directories.max_depth: 1orindex.htmlmust sit at the document root; finding it one folder down means the archive was packed a level too deep — redeploy it flat with theindex.phpskill.deploy-to-hosting - Read or other config with
.htaccess.hosting_files_website-content - PHP errors → PHP.
- 根路径 返回
/或403:使用404并设置hosting_files_list-website-and-directories。max_depth: 1或index.html必须位于文档根目录;如果在下一级目录中找到,说明压缩包解包时多嵌套了一层——使用index.phpskill 重新以扁平结构部署。deploy-to-hosting - 使用 读取
hosting_files_website-content或其他配置。.htaccess - PHP 错误 → PHP。
PHP
PHP
hosting_php_gethosting_php_update-versionhosting_php_update-optionsmaxhosting_php_getagency-hosting_php_list-options-for-websiteagency-hosting_php_replace-website-optionshosting_php_gethosting_php_update-versionhosting_php_update-optionshosting_php_getmaxagency-hosting_php_list-options-for-websiteagency-hosting_php_replace-website-optionsAgency Plan sites
Agency Plan 网站
agency-hosting_websites_getagency-hosting_websites_list-processesagency-hosting_wordpress_settingswordpress_installations_listagency-hosting_websites_getagency-hosting_websites_list-processesagency-hosting_wordpress_settingswordpress_installations_listSSL
SSL
Shared and Cloud, in :
sslhosting_websites_get-settings- or
not_installed(failedsays why): the domain must resolve to Hostinger, and any CAA record must allowlast_error, beforeletsencrypt.orgcan succeed. Pollhosting_ssl_installuntilhosting_websites_get-settingsisssl.statusoractive.failed - or
installing: wait — another install request returns 422.waiting_for_retry - Free subdomains use a platform certificate; installing returns 422 by design.
*.hostingersite.com - Browser still warns while the certificate is : turn on the redirect with
active(hosting_websites_update-settings) whenhttpsRedirect: trueis false, otherwise the page loadsis_https_redirect_enabledassets (mixed content) that the app has to change.http://
Agency, for each domain: every domain allows three certificate setups per seven days and one request a minute. Check before or , and never retry in a loop.
agency-hosting_ssl_website-statusagency-hosting_websites_list-processesagency-hosting_ssl_install-websiteagency-hosting_ssl_reinstall-website对于 Shared 和 Cloud,在 中检查 :
hosting_websites_get-settingsssl- 状态为 或
not_installed(failed会说明原因):域名必须解析到 Hostinger,并且任何 CAA 记录都必须允许last_error,之后letsencrypt.org才能成功。轮询hosting_ssl_install,直至hosting_websites_get-settings变为ssl.status或active。failed - 状态为 或
installing:请等待——再次发起安装请求会返回 422。waiting_for_retry - 免费的 子域名使用平台证书;按照设计,安装操作会返回 422。
*.hostingersite.com - 证书状态为 ,但浏览器仍显示警告:当
active为 false 时,使用is_https_redirect_enabled开启重定向(hosting_websites_update-settings);否则页面会加载httpsRedirect: true资源(混合内容),需要由应用自行更改。http://
对于 Agency,使用 检查每个域名:每个域名每七天允许配置三次证书,并且每分钟只能发起一个请求。在调用 或 前,先检查 ,切勿循环重试。
agency-hosting_ssl_website-statusagency-hosting_ssl_install-websiteagency-hosting_ssl_reinstall-websiteagency-hosting_websites_list-processesSlow site
网站缓慢
- WordPress: and
wordpress_litespeed-cache_show-lite-speed-status. Turning on Memcached withwordpress_object-cache_show-memcached-statusis the usual quick win.wordpress_object-cache_toggle-memcached - Other sites: server caching may be off or development mode left on. shows both in
hosting_websites_get-settings(cache,is_enabled); fix them withis_cacheless_mode_enabled(hosting_websites_update-settings,cache: true). Development mode takes a few minutes to turn off.cachelessMode: false - PHP 7.x runs markedly slower than 8.x; propose a supported 8.x version from when the app allows it.
hosting_php_get - Agency: with
agency-hosting_metrics_list-order-resource-usageshows CPU, memory and processes per website against the plan quota.time_frame_hours: 24 - 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开启 Memcached 快速提升性能。wordpress_object-cache_toggle-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;如果应用支持,建议从 获取受支持的 8.x 版本。
hosting_php_get - Agency:使用 并设置
agency-hosting_metrics_list-order-resource-usage,可查看每个网站的 CPU、内存和进程用量及其套餐配额。time_frame_hours: 24 - 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 错误日志和访问日志。