serpbear icon indicating copy to clipboard operation
serpbear copied to clipboard

502 Bad Gateway

Open bastienallain opened this issue 2 years ago • 9 comments
trafficstars

Hello i am facing an issues Ubuntu 22.04 Docker 4gb ram. docker crash everyday. Any idea

[0] <--- Last few GCs ---> [0] [0] [14:0x7f3784903280] 2191032 ms: Scavenge (reduce) 924.2 (998.2) -> 924.1 (999.2) MB, 8.1 / 0.0 ms (average mu = 0.985, current mu = 0.969) allocation failure; [0] [14:0x7f3784903280] 2191155 ms: Mark-sweep (reduce) 925.1 (999.2) -> 924.6 (1000.2) MB, 120.3 / 0.0 ms (average mu = 0.957, current mu = 0.482) allocation failure; scavenge might not succeed [0] [0] [0] <--- JS stacktrace ---> [0] [0] FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory [0] node server.js exited with code SIGABRT [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [1] ERROR Making Cron Request.. [1] SyntaxError: Unexpected token < in JSON at position 0 [1] at JSON.parse (<anonymous>) [1] at Response.json (node:internal/deps/undici/undici:6160:23) [1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

bastienallain avatar Dec 07 '22 05:12 bastienallain

In the issue title you wrote 502 Bad Gateway, but I am not seeing that in the error log you posted. Can you please let me know where you are seeing the 502 error?

towfiqi avatar Dec 07 '22 07:12 towfiqi

Every 50 min i have to restart docker container https://serp.vivacoda.com/

bastienallain avatar Dec 07 '22 07:12 bastienallain

Can you please answer my question? It will help me pinpoint the issue.

And also, try login to your docker container with ssh, and open the cron.js file and replace it with the code found here https://haste.zneix.eu/raw/mosydadoby and then restart the container and see if the issue still occurs or not.

towfiqi avatar Dec 07 '22 07:12 towfiqi

Thanks any idea where i can find it? Ubuntu latest docker. I am unable to find the file

bastienallain avatar Dec 07 '22 08:12 bastienallain

first run docker ps -a to get all the running docker containers.

Then notice the name of the serpbear docker container. Suppose its xxx, in that case, run the following to ssh into it. sudo docker exec –it xxx /bin/bash

Once you are logged in, cd into app directory, and the cron.js file should be inside it.

towfiqi avatar Dec 07 '22 08:12 towfiqi

I got this OCI runtime exec failed: exec failed: unable to start container process: exec: "/bin/bash": stat /bin/bash: no such file or directory: unknown

bastienallain avatar Dec 07 '22 08:12 bastienallain

In that case, try this: sudo docker attach xxx

towfiqi avatar Dec 07 '22 08:12 towfiqi

Nothing happend really strange i wait like 5 min

bastienallain avatar Dec 07 '22 08:12 bastienallain

Please try the methods described here to ssh into the container: https://stackoverflow.com/a/48835704/391955

towfiqi avatar Dec 07 '22 12:12 towfiqi