技术文章 - CS339610

成功安装 ThingWorx Flow 后,尝试访问登录页面失败,并出现“504 网关超时”或“502 错误网关 nginx”错误

已修改: 29-Nov-2024   


注意:本文已使用机器翻译软件翻译,以方便非英语客户阅读。但翻译内容可能包含语法错误或不准确之处。请注意, PTC对本文所含信息的翻译准确性及使用后果不承担任何责任。请在 此处 查看本文的英文原始版本以便参考。有关机器翻译的更多详情,请单击 此处
感谢您告诉我们。我们将尽快审阅此译文。

适用于

  • ThingWorx Platform 9.1 to 9.5
  • Nginx

说明

  • 无法访问 ThingWorx Flow 主页
  • ThingWorx Flow 模块处于在线状态,但登录尝试返回502 Bad Gateway nginx
  • 在 Web 浏览器中使用 F12/开发人员工具显示 currentUser API 调用返回以下错误:
 Failed to load resource: the server responded with a status of 504 (Gateway Timeout) - HTTP 504 Gateway Timeout
  • 身份验证窗口未弹出
  • 不弹出登录窗口
  • 使用新的自签名证书后,无法通过 HTTP 504 访问 ThingWorx Flow
  • 在 Web 浏览器中使用 F12/开发人员工具显示fetchconfig返回状态502
  • 尝试访问登录页面时出现504 网关超时
  • trigger_error-xxxx.log 包含以下错误:
     {"module":"flow-trigger","timestamp":"2024-10-24T02:21:30.965Z","level":"error","message":"Error deleting from message table"} {"module":"flow-trigger","timestamp":"2024-10-24T02:21:30.965Z","level":"error","message":"Login failed for user &#39;<user_name>&#39;."} {"module":"flow-trigger","timestamp":"2024-10-24T02:21:30.965Z","level":"error","message":"Error: Login failed for user &#39;<user_name>&#39;. at Login7TokenHandler.onErrorMessage (D:\\ThingWorxFlow\\modules\\trigger\\node_modules\\tedious\\lib\\token\\handler.js:239:19) at Readable.&lt;anonymous&gt; (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 (&lt;anonymous&gt;) at processTicksAndRejections (internal/process/task_queues.js:93:5)"} {"module":"flow-trigger","timestamp":"2024-10-24T02:21:30.966Z","level":"error","message":"Error updating subscriptions"} {"module":"flow-trigger","timestamp":"2024-10-24T02:21:30.966Z","level":"error","message":"Login failed for user &#39;<user_name>&#39;."} {"module":"flow-trigger","timestamp":"2024-10-24T02:21:30.966Z","level":"error","message":"Error: Login failed for user &#39;<user_name>&#39;. at Login7TokenHandler.onErrorMessage (D:\\ThingWorxFlow\\modules\\trigger\\node_modules\\tedious\\lib\\token\\handler.js:239:19) at Readable.&lt;anonymous&gt; (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 (&lt;anonymous&gt;) 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
  • 系统 > 子系统 > WorkflowSubsystem执行验证服务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