技术文章 - CS339610
安装后,ThingWorx Flow 登录页面无法加载,并显示“502 Bad Gateway”或“504 Gateway Timeout”错误。
已修改: 09-Feb-2026
适用于
- ThingWorx Platform 9.1 to 9.5
- Nginx
说明
- 无法访问 ThingWorx Flow 主页
- ThingWorx Flow 模块已上线,但登录尝试返回
502 Bad Gateway nginx - 在浏览器中使用F12 / 开发者工具显示,当前用户API 调用返回以下错误:
Failed to load resource: the server responded with a status of 504 (Gateway Timeout) - HTTP 504 Gateway Timeout
- 登录窗口不弹出
- 使用自签名证书时,ThingWorx Flow 无法访问。
- 在 Web 浏览器中使用F12 / 开发者工具显示fetchconfig返回状态502
- 尝试访问登录页面时出现
504 Gateway timeout - trigger_error-xxxx.log文件包含以下错误:
{"module":"flow-trigger","timestamp":"YYYY-MM-DDThh:mm:ss.965Z","level":"error","message":"Error deleting from message table"} {"module":"flow-trigger","timestamp":"YYYY-MM-DDThh:mm:ss.965Z","level":"error","message":"Login failed for user '<user_name>'."} {"module":"flow-trigger","timestamp":"YYYY-MM-DDThh:mm:ss.965Z","level":"error","message":"Error: Login failed for user '<user_name>'. at Login7TokenHandler.onErrorMessage (D:\\ThingWorxFlow\\modules\\trigger\\node_modules\\tedious\\lib\\token\\handler.js:239:19) at Readable.<anonymous> (D:\\ThingWorxFlow\\modules\\trigger\\node_modules\\tedious\\lib\\token\\token-stream-parser.js:26:33) at Readable.emit (events.js:315:20) at addChunk (internal/streams/readable.js:309:12) at readableAddChunk (internal/streams/readable.js:284:9) at Readable.push (internal/streams/readable.js:223:10) at next (internal/streams/from.js:88:29) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:93:5)"} {"module":"flow-trigger","timestamp":"YYYY-MM-DDThh:mm:ss.966Z","level":"error","message":"Error updating subscriptions"} {"module":"flow-trigger","timestamp":"YYYY-MM-DDThh:mm:ss.966Z","level":"error","message":"Login failed for user '<user_name>'."} {"module":"flow-trigger","timestamp":"YYYY-MM-DDThh:mm:ss.966Z","level":"error","message":"Error: Login failed for user '<user_name>'. at Login7TokenHandler.onErrorMessage (D:\\ThingWorxFlow\\modules\\trigger\\node_modules\\tedious\\lib\\token\\handler.js:239:19) at Readable.<anonymous> (D:\\ThingWorxFlow\\modules\\trigger\\node_modules\\tedious\\lib\\token\\token-stream-parser.js:26:33) at Readable.emit (events.js:315:20) at addChunk (internal/streams/readable.js:309:12) at readableAddChunk (internal/streams/readable.js:284:9) at Readable.push (internal/streams/readable.js:223:10) at next (internal/streams/from.js:88:29) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:93:5)"} - 可以通过 Flow 的主机名和 URL 访问 ThingWorx Flow,但无法通过 ThingWorx Composer 的 URL(在ThingWorx Composer > Flow > Connector中)访问,并出现以下错误:
404 page not found error
- 从“系统”>“子系统”>“工作流子系统”执行ValidateFlowSetup时出错
[FLOW-API-02] - Failed to connect to Flow. Ensure that you are accessing ThingWorx via Nginx URL. Ensure that all Flow services are running and are healthy. In case of self-signed certificate, make sure that correct CN is provided. [FLOW-OAUTH-02] - Failed to connect to Flow OAuth service. Check whether Flow keys are imported in ThingWorx KeyStore. For more information, refer to the 'Troubleshooting Your Installation' topic in the Help Center
- 错误消息出现在 ThingWorx Flow 日志文件,,,\ThingWorxFlow\.pm2\logs\ flow-api-error-0.log 中:
TypeError: Cannot read property 'statusCode' of undefined at /opt/ThingWorxFlow/modules/ux/dist/helpers/twxUserHelper.js:25:285 at Request._callback (/opt/ThingWorxFlow/modules/ux/dist/helpers/twxUserHelper.js:8:977) at self.callback (/opt/ThingWorxFlow/modules/ux/node_modules/request/request.js:185:22) at Request.emit (events.js:314:20) at Request.onRequestError (/opt/ThingWorxFlow/modules/ux/node_modules/request/request.js:881:8) at ClientRequest.emit (events.js:314:20) at ClientRequest.onConnect (/opt/ThingWorxFlow/modules/ux/node_modules/tunnel-agent/index.js:168:23) at Object.onceWrapper (events.js:421:26) at ClientRequest.emit (events.js:314:20) at Socket.socketOnData (_http_client.js:508:11) at Socket.emit (events.js:314:20) at addChunk (_stream_readable.js:297:12) at readableAddChunk (_stream_readable.js:272:9) at Socket.Readable.push (_stream_readable.js:213:10) at TCP.onStreamRead (internal/stream_base_commons.js:188:23) Uncaught exception: TypeError: Cannot read property 'statusCode' of undefined
这是文章 339610 的 PDF 版本,可能已过期。最新版本 CS339610