steedos-platform icon indicating copy to clipboard operation
steedos-platform copied to clipboard

多服务连同一redis报错:TypeError: Cannot read property 'admin_menus' of undefined

Open kemen209 opened this issue 2 years ago • 5 comments

v2.2.54

在本地部署时从没有出现过该问题,部署到远程集群时,不管是采用docker部署还是直接运行yarn start方式(后台运行),断开ssh远程连接后(不一定直接相关,肯定有什么机制触发了getAssignedMenus流程),可以出现登录界面,但登录以后为空白页面,查看运行日志,显示下列异常:

(node:262329) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'admin_menus' of undefined
    at /root/foa/node_modules/@steedos/objectql/src/types/app.ts:243:47
    at step (/root/foa/node_modules/tslib/tslib.js:144:27)
    at Object.next (/root/foa/node_modules/tslib/tslib.js:125:57)
    at fulfilled (/root/foa/node_modules/tslib/tslib.js:115:62)
    at /root/foa/node_modules/meteor-promise/fiber_pool.js:43:39
(node:262329) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)

我这边的APP没有使用任何admin_menus相关的东西。

kemen209 avatar Aug 04 '22 07:08 kemen209

docker部署时采用docker compose up -d后台运行。

直接部署,采用nohup yarn start &后台运行。

kemen209 avatar Aug 04 '22 07:08 kemen209

使用提供的模版https://github.com/steedos/docker/blob/main/steedos-community/docker-compose.yml,部署到远程机器(唯一做了ip地址修改),同样产生上述异常。

kemen209 avatar Aug 04 '22 09:08 kemen209

本地测试 多服务连同一redis或者手动清理redis后刷新页面会打印此信息

sunhaolin avatar Aug 05 '22 03:08 sunhaolin

本地测试 多服务连同一redis或者手动清理redis后刷新页面会打印此信息

直接原因就是redis不正常工作。我这里的问题是,redis-server的config目录被修改,导致redis无法正常工作。

正常工作时, Screen Shot 2022-08-05 at 17 56 16

Screen Shot 2022-08-05 at 17 59 07

一段时间之后,config目录被修改,出现异常 Screen Shot 2022-08-05 at 18 09 35

Screen Shot 2022-08-05 at 18 09 52

随后,访问页面,导致steedos后台异常: Screen Shot 2022-08-05 at 18 11 07

redis-server config目录被修改的原因不明,换环境之后,到目前为止正常。

感谢各位大神!

kemen209 avatar Aug 06 '22 02:08 kemen209

调试过程中,发现了另外一个问题:https://github.com/steedos/steedos-platform/issues/3737

kemen209 avatar Aug 06 '22 02:08 kemen209

我刚刚用阿里云试了试,还有这个问题,大佬解决了吗?

hengyanqwe avatar Oct 20 '23 07:10 hengyanqwe

这个问题安排到2.6版本解决.

baozhoutao avatar Oct 20 '23 07:10 baozhoutao