You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无法在Frappe Docker中添加Custom-App问题求助

解决Frappe Docker中APPS_JSON无法添加自定义应用的问题

常见排查与修复步骤

1. 校验APPS_JSON格式合法性

APPS_JSON必须是严格JSON格式,禁止单引号、末尾多余逗号,字符串需用双引号包裹。正确示例:

[
  {
    "url": "https://github.com/your-username/your-custom-app.git",
    "branch": "main",
    "app_name": "your_custom_app"
  },
  {
    "url": "https://github.com/frappe/erpnext.git",
    "branch": "version-15",
    "app_name": "erpnext"
  }
]
  • 确保app_name与应用实际目录名完全一致,大小写敏感。

2. 确认环境变量配置位置

  • 若用docker-compose.yml,需将APPS_JSON注入到erpnext-worker、erpnext-web、frappe-scheduler等核心服务;或在.env文件中定义为单行字符串:
    APPS_JSON='[{"url":"https://github.com/your-username/your-custom-app.git","branch":"main","app_name":"your_custom_app"}]'
    
  • .env中JSON不能换行,否则会导致解析失败。

3. 验证应用仓库的可访问性

  • 若为私有仓库,需使用带访问令牌的HTTPS地址(如https://<token>@github.com/your-username/your-custom-app.git),或在容器内配置SSH密钥。
  • 进入容器测试仓库连通性:
    docker exec -it <container-name> git clone https://github.com/your-username/your-custom-app.git
    
    克隆失败则先解决网络/权限问题,再继续配置。

4. 清理缓存并重建容器

旧缓存可能导致配置不生效,执行以下命令:

docker-compose down -v
docker-compose build --no-cache
docker-compose up -d
  • 查看容器日志排查安装报错:
    docker logs -f <erpnext-web-container-name>
    
    搜索installing apps或自定义应用名称,定位具体错误(如依赖缺失、版本不兼容)。

5. 手动安装排查问题

自动安装失败时,进入容器手动操作定位根源:

docker exec -it <erpnext-web-container-name> bash
su frappe
cd /home/frappe/frappe-bench
bench get-app your_custom_app https://github.com/your-username/your-custom-app.git --branch main
bench --site your-site-name install-app your_custom_app

根据手动安装的报错提示修复(如安装依赖、调整Frappe版本兼容)。

核心注意事项

  • 自定义应用需与当前Frappe/ERPNext版本兼容,查看应用requirements.txt和hooks.py中的版本限制。
  • 多站点环境下,需确保应用安装到目标站点。

内容的提问来源于stack exchange,提问作者Yashwashni Rathore

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.22 10:05:08