CatalysmsServerManager / 7-days-to-die-server-manager

A server manager for 7 Days to die
GNU General Public License v3.0
68 stars 59 forks source link

hookTimeout seems too low for worker.js #235

Closed m4tm4t closed 3 years ago

m4tm4t commented 4 years ago

Describe the bug Tried to run the stack in production env ( with docker ), the worker crashed

To Reproduce Running docker-compose up -d with NODE_ENV=production in .env file

Error log

csmm-worker_1  | { Error: Sails is taking too long to load.
csmm-worker_1  | 
csmm-worker_1  | --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
csmm-worker_1  |  Troubleshooting tips:
csmm-worker_1  |   -• Were you still reading/responding to an interactive prompt?
csmm-worker_1  |      (Whoops, sorry!  Please lift again and try to respond a bit more quickly.)
csmm-worker_1  | 
csmm-worker_1  |   -• Do you have a lot of stuff in `assets/`?  Grunt might still be running.
csmm-worker_1  |     (Try increasing the hook timeout.  Currently it is 2000.
csmm-worker_1  |      e.g. `sails lift --hookTimeout=40000`)
csmm-worker_1  | 
csmm-worker_1  |   -• Is `session` a custom or 3rd party hook?
csmm-worker_1  |     (*If* `initialize()` is using a callback, make sure it's being called.)
csmm-worker_1  | --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
csmm-worker_1  | 
csmm-worker_1  |     at Timeout.tooLong [as _onTimeout] (/usr/src/app/node_modules/sails/lib/app/private/loadHooks.js:191:21)
csmm-worker_1  |     at ontimeout (timers.js:436:11)
csmm-worker_1  |     at tryOnTimeout (timers.js:300:5)
csmm-worker_1  |     at listOnTimeout (timers.js:263:5)
csmm-worker_1  |     at Timer.processTimers (timers.js:223:10) code: 'E_HOOK_TIMEOUT' }

Desktop (please complete the following information if this is a problem on the CSMM web application):

After setting up hookTimeout to 40000 in worker.js, no exception anymore

niekcandaele commented 4 years ago

That seems weird, I run all CSMM instances with the default timeout and haven't had this issue.

Are you running on limited hardware perhaps?

m4tm4t commented 4 years ago

It's a dedicated server ( home server ) but has sufficient hardware I think ^^

halkeye commented 4 years ago

Can you set you log level to silly and launch it again? One of the hooks isn't firing.

m4tm4t commented 4 years ago

I only run csmm-worker to have a better output but the behavior is same as running up all services.

I also noticed it's random, sometimes, it run successfully

➜  7-days-to-die-server-manager git:(master) ✗ docker-compose up csmm-worker         
Starting 7-days-to-die-server-manager_db_1    ... done
Starting 7-days-to-die-server-manager_cache_1 ... done
Starting 7-days-to-die-server-manager_csmm-worker_1 ... done
Attaching to 7-days-to-die-server-manager_csmm-worker_1
csmm-worker_1  | 
csmm-worker_1  | > csmm@1.14.2 start:worker /usr/src/app
csmm-worker_1  | > node worker.js;
csmm-worker_1  | 
csmm-worker_1  | debug: Please note: since `sails.config.session.cookie.secure` is set to `true`, the session cookie 
csmm-worker_1  | debug: will _only_ be sent over TLS connections (i.e. secure https:// requests).
csmm-worker_1  | debug: Requests made via http:// will not include a session cookie!
csmm-worker_1  | debug: 
csmm-worker_1  | debug: For more help:
csmm-worker_1  | debug:  • https://sailsjs.com/config/session#?the-secure-flag
csmm-worker_1  | debug:  • https://sailsjs.com/config/session#?do-i-need-an-ssl-certificate
csmm-worker_1  | debug:  • https://sailsjs.com/config/sails-config-http#?properties
csmm-worker_1  | debug:  • https://sailsjs.com/support
csmm-worker_1  | debug: 
csmm-worker_1  | 2020-08-03T16:34:31.860Z - verbose: logger hook loaded successfully. (2ms)
csmm-worker_1  | 2020-08-03T16:34:31.862Z - silly: Loading hook: request
csmm-worker_1  | 2020-08-03T16:34:31.862Z - verbose: request hook loaded successfully. (0ms)
csmm-worker_1  | 2020-08-03T16:34:31.862Z - silly: Loading hook: blueprints
csmm-worker_1  | 2020-08-03T16:34:31.863Z - silly: Loading hook: responses
csmm-worker_1  | 2020-08-03T16:34:31.863Z - silly: Loading runtime custom response definitions...
csmm-worker_1  | 2020-08-03T16:34:31.865Z - verbose: responses hook loaded successfully. (2ms)
csmm-worker_1  | 2020-08-03T16:34:31.865Z - silly: Loading hook: helpers
csmm-worker_1  | 2020-08-03T16:34:32.033Z - verbose: Watch out!  Nesting helpers more than one sub-folder deep can be a liability.  It also means that you'll need to type more every time you want to use your helper.  Instead, try keeping your directory structure as flat as possible; i.e. in general, having more explicit filenames is better than having deep, complicated folder hierarchies.
csmm-worker_1  | 2020-08-03T16:34:32.141Z - verbose: helpers hook loaded successfully. (276ms)
csmm-worker_1  | 2020-08-03T16:34:32.141Z - silly: Loading hook: policies
csmm-worker_1  | 2020-08-03T16:34:32.141Z - silly: Loading policy modules from app...
csmm-worker_1  | 2020-08-03T16:34:32.147Z - silly: Finished loading policy middleware functions.  Preparing to bind policies based on config...
csmm-worker_1  | 2020-08-03T16:34:32.148Z - silly: Policy-controller bindings complete!
csmm-worker_1  | 2020-08-03T16:34:32.149Z - verbose: policies hook loaded successfully. (8ms)
csmm-worker_1  | 2020-08-03T16:34:32.149Z - silly: Loading hook: services
csmm-worker_1  | 2020-08-03T16:34:32.149Z - silly: Loading app services...
csmm-worker_1  | 2020-08-03T16:34:32.149Z - verbose: services hook loaded successfully. (0ms)
csmm-worker_1  | 2020-08-03T16:34:32.149Z - silly: Loading hook: security
csmm-worker_1  | 2020-08-03T16:34:32.151Z - verbose: security hook loaded successfully. (2ms)
csmm-worker_1  | 2020-08-03T16:34:32.151Z - silly: Loading hook: i18n
csmm-worker_1  | 2020-08-03T16:34:32.152Z - verbose: i18n hook loaded successfully. (1ms)
csmm-worker_1  | 2020-08-03T16:34:32.152Z - silly: Loading hook: session
csmm-worker_1  | 2020-08-03T16:34:32.159Z - silly: Loading hook: gbl
csmm-worker_1  | 2020-08-03T16:34:32.159Z - verbose: gbl hook loaded successfully. (0ms)
csmm-worker_1  | 2020-08-03T16:34:32.159Z - silly: Loading hook: highpingkick
csmm-worker_1  | 2020-08-03T16:34:32.160Z - verbose: highpingkick hook loaded successfully. (0ms)
csmm-worker_1  | 2020-08-03T16:34:32.160Z - silly: Loading hook: sentry
csmm-worker_1  | 2020-08-03T16:34:32.160Z - verbose: DSN for Sentry is required.
csmm-worker_1  | 2020-08-03T16:34:32.160Z - verbose: sentry hook loaded successfully. (0ms)
csmm-worker_1  | 2020-08-03T16:34:32.160Z - silly: Loading hook: orm
csmm-worker_1  | 2020-08-03T16:34:32.161Z - silly: Loading the app's models and any custom adapters...
csmm-worker_1  | 2020-08-03T16:34:32.161Z - silly: Loading app models...
csmm-worker_1  | 2020-08-03T16:34:32.168Z - silly: Loading app adapters...
csmm-worker_1  | 2020-08-03T16:34:32.171Z - verbose: Loading adapter (`sails-redis`) from this app's `node_modules/` directory...
csmm-worker_1  | 2020-08-03T16:34:32.172Z - verbose: Loading adapter (`sails-mysql`) from this app's `node_modules/` directory...
csmm-worker_1  | 2020-08-03T16:34:32.217Z - silly: Starting ORM...
csmm-worker_1  | 2020-08-03T16:34:32.217Z - silly: Registering model `analytics` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.217Z - silly: Registering model `banentry` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.217Z - silly: Registering model `commandreply` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.217Z - silly: Registering model `countryban` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.218Z - silly: Registering model `cronjob` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.218Z - silly: Registering model `customcommand` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.218Z - silly: Registering model `customcommandargument` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.218Z - silly: Registering model `customdiscordnotification` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.218Z - silly: Registering model `customhook` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.218Z - silly: Registering model `gblcomment` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.218Z - silly: Registering model `gimmeitem` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.218Z - silly: Registering model `historicalinfo` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.218Z - silly: Registering model `hookvariable` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.218Z - silly: Registering model `player` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.218Z - silly: Registering model `playerclaimitem` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.218Z - silly: Registering model `playerteleport` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.219Z - silly: Registering model `playerusedcommand` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.219Z - silly: Registering model `playerusedgimme` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.219Z - silly: Registering model `role` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.219Z - silly: Registering model `sdtdconfig` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.219Z - silly: Registering model `sdtdserver` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.219Z - silly: Registering model `sdtdticket` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.219Z - silly: Registering model `shoplisting` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.219Z - silly: Registering model `ticketcomment` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.219Z - silly: Registering model `trackinginfo` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.219Z - silly: Registering model `usagestats` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.219Z - silly: Registering model `user` in Waterline
csmm-worker_1  | 2020-08-03T16:34:32.451Z - verbose: orm hook loaded successfully. (291ms)
csmm-worker_1  | 2020-08-03T16:34:32.461Z - verbose: blueprints hook loaded successfully. (599ms)
csmm-worker_1  | npm ERR! code ELIFECYCLE
csmm-worker_1  | npm ERR! errno 1
csmm-worker_1  | npm ERR! csmm@1.14.2 start:worker: `node worker.js;`
csmm-worker_1  | npm ERR! Exit status 1
csmm-worker_1  | npm ERR! 
csmm-worker_1  | npm ERR! Failed at the csmm@1.14.2 start:worker script.
csmm-worker_1  | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
csmm-worker_1  | 
csmm-worker_1  | npm ERR! A complete log of this run can be found in:
csmm-worker_1  | npm ERR!     /home/node/.npm/_logs/2020-08-03T16_34_34_192Z-debug.log
7-days-to-die-server-manager_csmm-worker_1 exited with code 1
niekcandaele commented 4 years ago

I dont see an actual error message in that last log? Everything loads successfully but then NPM throws? Is there more info in that NPM debug log?