Nginx 502 Bad Gateway

Linux
FileMaker Server Version: 20.3.2 205(01-24-2024)
OttoFMS Version: 4.3.5

I did read through a similar topic, but older and this may be different… FMS runs as expected, upon login in, stays logged in as expected.

  • When logging into Otto, within 60 seconds, we get 500 error and have to re-login. Refreshing page always requires re-login.
  • API key generation works as expected.
  • When registering a web hook, consistently get this error: FileMaker Database setup is incomplete listing everything missing, but everything is in the target file. (we have set up this same web hook deployment on 4 other servers)
  • when attempting to connect to web hook, we get 502 Bad Gateway / nginx. However, when we use the wrong API key, we get: "error": "apiKey is invalid".
  • Otto web hook test results with Failed: { "error": "The string did not match the expected pattern." }

We have restarted server and restarted http server, etc. Any clues? Thank you. I don’t have shell access troubleshoot or get someone to try something.

Thank you!

Hello Michael,

Welcome to the community! Do you see anything in the otto-info.log or the otto-error.log? “Refreshing the page always requires re-login” sounds like your OttoFMS is crashing, which would be logged in those log files.

-Kyle

I don’t see any evidence of “crashing” but there are lots of errors relating to the fail in the otto-info.log: UnauthorizedError: Invalid session token - {"service":"express-error-handler"}

and from otto-error.log:
2024-06-25T14:54:12.012Z error UnauthorizedError: Invalid session token - {"service":"express-error-handler"} 2024-06-25T14:54:12.108Z error UnauthorizedError: The cookie is invalid, redirecting to login - {"service":"express-error-handler"}
Both look pretty similar. I can send them to you if you like. Let me know. Odd that this error gets logged, but when key is correct, just nginx error:
`2024-06-25T14:17:57.840Z error UnauthorizedError: apiKey is invalid - {“service”:“express-error-handler”}
2024-06-25T14:18:09.215Z error Unhandled Rejection: TypeError: Cannot read properties of undefined (reading ‘0’)

Thanks, Kyle

If you could DM me your otto-info.log file that would be great. Thanks for working with me on this!

-Kyle

Hi Kyle, Updated OttoFMS to 4.4.0. Rebooted server, etc. Appears to be exactly the same behavior. This time (probably du to update) I see toast notifications about JWTs being invalid or similar. Still logs me out within a minute or so. Also testing web hook same error as mentioned perviously. Also exactly same results when attempting web hook from Postman… Bad Gateway but if api key is incorrect, apiKey is invalid Here is the otto-error.log since the update:

2024-06-28T13:44:59.080Z	error	Unhandled Rejection: TypeError: Cannot read properties of undefined (reading '0')
    at cmt (/snapshot/ottofms-server/index.js)
    at JLe (/snapshot/ottofms-server/index.js)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-06-28T13:45:02.201Z	error	UnauthorizedError: Invalid session token - {"service":"express-error-handler"}
2024-06-28T13:45:07.297Z	error	UnauthorizedError: Invalid session token - {"service":"express-error-handler"}
2024-06-28T13:45:12.398Z	error	UnauthorizedError: Invalid session token - {"service":"express-error-handler"}
2024-06-28T13:45:17.493Z	error	UnauthorizedError: Invalid session token - {"service":"express-error-handler"}
2024-06-28T13:45:22.669Z	error	UnauthorizedError: Invalid session token - {"service":"express-error-handler"}
2024-06-28T13:45:27.765Z	error	UnauthorizedError: Invalid session token - {"service":"express-error-handler"}
2024-06-28T13:45:32.862Z	error	UnauthorizedError: Invalid session token - {"service":"express-error-handler"}