FastGPT icon indicating copy to clipboard operation
FastGPT copied to clipboard

当前main分支构建的docker 无法正常运行

Open jfy3d opened this issue 1 year ago • 2 comments

例行检查

  • [ ] 我已确认目前没有类似 issue
  • [ ] 我已完整查看过项目 README,以及项目文档
  • [ ] 我使用了自己的 key,并确认我的 key 是可正常使用的
  • [ ] 我理解并愿意跟进此 issue,协助测试和提供反馈
  • [x] 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

你的版本

  • [] 公有云版本
  • [x ] 私有部署版本, 具体版本号: 4.8 alpha3, 当前main分支

问题描述, 日志截图 打开登录页报错,也不能登录 只有docker 有这个问题, pnpm dev 正常

Error: Failed to load native binding at Object. (/app/node_modules/.pnpm/@[email protected]/node_modules/@node-rs/jieba/index.js:333:11) at Module.compile (node:internal/modules/cjs/loader:1256:14) at Module.extensions..js (node:internal/modules/cjs/loader:1310:10) at Module.load (node:internal/modules/cjs/loader:1119:32) at Module.load (node:internal/modules/cjs/loader:960:12) at Module.require (node:internal/modules/cjs/loader:1143:19) at mod.require (/app/node_modules/.pnpm/[email protected]@[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/require-hook.js:64:28) at require (node:internal/modules/cjs/helpers:121:18) at 83542 (/app/projects/app/.next/server/pages/api/common/system/getInitData.js:1:85) at o (/app/projects/app/.next/server/webpack-api-runtime.js:1:128) { [cause]: [ Error: Cannot find module './jieba.linux-x64-musl.node' Require stack: - /app/node_modules/.pnpm/@[email protected]/node_modules/@node-rs/jieba/index.js - /app/projects/app/.next/server/pages/api/common/system/getInitData.js - /app/node_modules/.pnpm/[email protected]@[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/future/helpers/module-loader/node-module-loader.js - /app/node_modules/.pnpm/[email protected]@[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/future/helpers/module-loader/route-module-loader.js - /app/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/next-server.js - /app/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/next.js - /app/projects/app/server.js at Module.resolveFilename (node:internal/modules/cjs/loader:1077:15) at /app/node_modules/.pnpm/[email protected]@[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/require-hook.js:54:36 at Module.load (node:internal/modules/cjs/loader:922:27) at Module.require (node:internal/modules/cjs/loader:1143:19) at mod.require (/app/node_modules/.pnpm/[email protected]@[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/require-hook.js:64:28) at require (node:internal/modules/cjs/helpers:121:18) at requireNative (/app/node_modules/.pnpm/@[email protected]/node_modules/@node-rs/jieba/index.js:199:16) at Object. (/app/node_modules/.pnpm/@[email protected]/node_modules/@node-rs/jieba/index.js:306:17) at Module._compile (node:internal/modules/cjs/loader:1256:14) at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) { code: 'MODULE_NOT_FOUND', requireStack: [Array] },

复现步骤

制作docker版,打开网页

预期结果

相关截图

jfy3d avatar May 12 '24 00:05 jfy3d

是不是Mac下 build docker 不行? jieba库平台不统一?

jfy3d avatar May 13 '24 10:05 jfy3d

mac不清楚,但是git action的arm是ok的。 不是必须打包arm,可以指定platform试试

c121914yu avatar May 14 '24 02:05 c121914yu

https://github.com/labring/FastGPT/issues/1468 关联。先试试这个

c121914yu avatar May 15 '24 07:05 c121914yu

我是x86 mac,用了 docker buildx --platform linux/amd64也不行 镜像里的jieba还是 darwin 版本的。 我从官方的4.8镜像里拷贝出了jieba linux版本 本地dockerfile 加上: COPY ./jieba/@[email protected] /app/node_modules/.pnpm/@[email protected] COPY ./jieba/@[email protected] /app/node_modules/.pnpm/@[email protected] COPY ./jieba/@[email protected] /app/node_modules/.pnpm/@[email protected]

这样build出的镜像能跑起来

jfy3d avatar May 15 '24 10:05 jfy3d