smithery.ai

debug-assistant

调试?

First seen Mar 21, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Allowed toolsBash, Read, Grep, Glob

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 4,173 B
  • docs SUMMARY.md 160 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

调试辅助 Skill

服务架构

服务 端口 服务器 日志位置 健康检查
Java 后端 10010 47.100.235.168 /www/wwwroot/cretas/cretas-backend.log /api/mobile/health
Python 服务 8083 47.100.235.168 /www/wwwroot/cretas/code/backend/python/python-services.log /health
Web 前端 8088 47.100.235.168 (Nginx) /www/wwwlogs/47.100.235.168.log HTTP 200
PostgreSQL 5432 47.100.235.168 (本机) journalctl -u postgresql SELECT 1
React Native 3010 本地开发 Metro bundler 控制台 N/A

注意: 旧服务器 139.196.165.140 仅运行 Nginx 反代 + web-admin 静态文件,后端已迁移到 47.100.235.168。


快速诊断命令

服务状态检查

# 一键健康检查 (全部服务)
echo "=== Health Check ===" && \
echo -n "Java:   " && curl -s -o /dev/null -w "%{http_code}" http://47.100.235.168:10010/api/mobile/health && echo "" && \
echo -n "Python: " && curl -s -o /dev/null -w "%{http_code}" http://47.100.235.168:8083/health && echo "" && \
echo -n "Web:    " && curl -s -o /dev/null -w "%{http_code}" http://47.100.235.168:8088/ && echo ""

# 检查进程
ssh [email protected] "ps aux | grep -E 'java|uvicorn' | grep -v grep"

# 检查端口监听
ssh [email protected] "ss -tlnp | grep -E '10010|8083|5432|6379'"

# 磁盘和内存
ssh [email protected] "df -h && echo '---' && free -h"

查看日志

# Java 后端日志
ssh [email protected] "tail -100 /www/wwwroot/cretas/cretas-backend.log"

# 过滤 ERROR
ssh [email protected] "tail -500 /www/wwwroot/cretas/cretas-backend.log | grep -A5 'ERROR'"

# Python 服务日志
ssh [email protected] "tail -100 /www/wwwroot/cretas/code/backend/python/python-services.log"

# Nginx 访问/错误日志
ssh [email protected] "tail -50 /www/wwwlogs/47.100.235.168.log"
ssh [email protected] "tail -50 /www/wwwlogs/47.100.235.168.error.log"

数据库检查

# PostgreSQL 连接测试
ssh [email protected] "sudo -u postgres psql cretas_db -c 'SELECT 1'"

# 查看表列表
ssh [email protected] "sudo -u postgres psql cretas_db -c '\dt'"

# SmartBI 数据库
ssh [email protected] "sudo -u postgres psql smartbi_db -c '\dt'"

常见错误速查

错误 检查命令 常见原因
500 Error grep ERROR cretas-backend.log Entity字段缺失、NPE、JSON错误
401 Unauthorized 解码 JWT payload Token过期/格式错误/权限不足
网络失败 curl -s http://47.100.235.168:10010/api/mobile/health 端口未开放/服务未启动
Python 502 `ssh ... "ps aux \ grep uvicorn"` Python 进程挂了/依赖缺失
前端白屏 浏览器 F12 Console API 地址错误/Nginx 配置
RN 白屏 npx expo start --clear Metro 编译错误

JWT Token 调试

# 解码 JWT payload
echo "YOUR_TOKEN" | cut -d'.' -f2 | base64 -d 2>/dev/null | jq

# Payload 结构: { role, factoryId, userId, username }

React Native 调试

cd frontend/CretasFoodTrace
npx expo start --clear          # 清除缓存启动
npx expo doctor                 # 检查环境

故障排查流程

症状 排查步骤
Java 无法启动 1. `ss -tlnp \ grep 10010 → 2. tail -50 cretas-backend.log → 3. env \ grep DB_`
Python 502 1. `ps aux \ grep uvicorn → 2. tail -50 python-services.log → 3. ss -tlnp \ grep 8083`
前端白屏 1. nginx -t → 2. ls /www/wwwroot/web-admin/index.html → 3. Nginx 日志
DB 连接失败 1. systemctl status postgresql → 2. 检查 pg_hba.conf → 3. 检查密码环境变量
磁盘满 `du -sh /www/wwwroot/cretas/logs/* \ sort -rh \ head` → 清理旧日志

参考文档

  • references/common-errors.md - 完整错误速查表