HabitRPG / habitica

A habit tracker app which treats your goals like a Role Playing Game.
https://habitica.com
Other
12.02k stars 4.1k forks source link

Will not stay alive upon registration if deployed using Kubernetes #15359

Open phluxx opened 1 week ago

phluxx commented 1 week ago

As the title says, habitica will not deploy on Kubernetes in its current state. Logs are as follows:

> habitrpg@0.0.0-152 start /habitrpg
> gulp run:dev

{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
[02:44:14] Using gulpfile /habitrpg/gulpfile.js
[02:44:14] Starting 'nodemon'...
[02:44:14] Finished 'nodemon' after 1.71 ms
[02:44:14] Starting 'browserify'...
[02:44:14] Starting 'prepare:staticNewStuff'...
[02:44:14] Finished 'prepare:staticNewStuff' after 627 ms
[02:44:14] [nodemon] 1.9.2
[02:44:14] [nodemon] to restart at any time, enter `rs`
[02:44:14] [nodemon] watching: *.*
[02:44:14] [nodemon] starting `node ./website/src/server.js`
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
info: Express server listening on port 3000
info: Connected with Mongoose
[02:44:28] Finished 'browserify' after 15 s
[02:44:28] Starting 'build:dev'...
[02:44:28] Starting 'grunt-build:dev'...
[02:44:28] [nodemon] restarting due to changes...
[02:44:28] [nodemon] starting `node ./website/src/server.js`
Running "cssmin:dist" (cssmin) task
File common/dist/sprites/habitrpg-shared.css created: 753.85 kB → 652.54 kB → 42.06 kB (gzip)

Running "stylus:build" (stylus) task
File website/build/app.css created.
File website/build/static.css created.

Done, without errors.
[02:44:32] Finished 'grunt-build:dev' after 4.04 s
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
info: Express server listening on port 3000
info: Connected with Mongoose
GET / 302 21.900 ms - 70
GET /bower_components/css-social-buttons/css/zocial.css 304 17.808 ms - -
GET /js/services/notificationServices.js 304 15.723 ms - -
GET /js/services/sharedServices.js 304 15.213 ms - -
GET /bower_components/jquery/dist/jquery.min.js 304 15.138 ms - -
GET /bower_components/jquery-colorbox/jquery.colorbox-min.js 304 15.383 ms - -
GET /js/controllers/authCtrl.js 304 14.759 ms - -
GET /js/controllers/footerCtrl.js 304 14.271 ms - -
GET /js/env.js 304 14.158 ms - -
GET /js/services/statServices.js 304 13.453 ms - -
GET /common/dist/scripts/habitrpg-shared.js 200 47.495 ms - -
GET /common/dist/sprites/habitrpg-shared.css 200 47.192 ms - -
GET / 302 4.450 ms - 70
GET /static/front 200 1627.065 ms - -
GET /bower_components/css-social-buttons/css/zocial.css 200 6.473 ms - -
GET /front/staticstyle.css 200 3.366 ms - -
GET /app.css 200 15.452 ms - -
GET /common/dist/sprites/habitrpg-shared.css 200 15.273 ms - -
GET /bower_components/jquery/dist/jquery.min.js 200 6.618 ms - -
GET /common/dist/scripts/habitrpg-shared.js 200 18.750 ms - -
GET /bower_components/angular/angular.js 200 56.012 ms - -
GET /bower_components/angular-ui/build/angular-ui.js 200 4.964 ms - -
GET /bower_components/jquery-colorbox/jquery.colorbox-min.js 200 2.996 ms - -
GET /bower_components/hello/dist/hello.all.min.js 200 6.116 ms - -
GET /bower_components/angular-loading-bar/build/loading-bar.js 200 3.893 ms - -
GET /js/env.js 200 1.767 ms - 585
GET /js/static.js 200 1.820 ms - -
GET /js/services/notificationServices.js 200 4.179 ms - -
GET /js/services/analyticsServices.js 200 3.192 ms - -
GET /js/services/sharedServices.js 200 2.162 ms - 242
GET /js/services/socialServices.js 200 1.271 ms - 1023
GET /js/services/statServices.js 200 2.661 ms - -
GET /common/script/public/userServices.js 200 3.481 ms - -
GET /js/controllers/authCtrl.js 200 7.060 ms - -
GET /js/controllers/footerCtrl.js 200 6.527 ms - -
GET /favicon.ico 200 3.243 ms - -
error: RangeError: Invalid status code: 5739101
    at ServerResponse.writeHead (_http_server.js:192:11)
    at ServerResponse.writeHead (/habitrpg/node_modules/express/node_modules/connect/node_modules/on-headers/index.js:55:19)
    at ServerResponse.writeHead (/habitrpg/node_modules/express/node_modules/connect/node_modules/on-headers/index.js:55:19)
    at ServerResponse._implicitHeader (_http_server.js:157:8)
    at ServerResponse.res.write (/habitrpg/node_modules/express/node_modules/connect/node_modules/compression/index.js:91:14)
    at ServerResponse.res.end (/habitrpg/node_modules/express/node_modules/connect/node_modules/compression/index.js:112:14)
    at ServerResponse.res.send (/habitrpg/node_modules/express/lib/response.js:176:8)
    at ServerResponse.res.json (/habitrpg/node_modules/express/lib/response.js:224:15)
    at auth.js:139:36
    at Promise.taskCallback (/habitrpg/node_modules/async/lib/async.js:468:21)
    at Promise.<anonymous> (/habitrpg/node_modules/mongoose/node_modules/mpromise/lib/promise.js:172:8)
    at emitOne (events.js:77:13)
    at Promise.emit (events.js:169:7)
    at Promise.emit (/habitrpg/node_modules/mongoose/node_modules/mpromise/lib/promise.js:84:38)
    at Promise.reject (/habitrpg/node_modules/mongoose/node_modules/mpromise/lib/promise.js:111:15)
    at Promise.error (/habitrpg/node_modules/mongoose/lib/promise.js:95:15)
    at Immediate.cb (/habitrpg/node_modules/mongoose/lib/query.js:1152:29)
    at Immediate._onImmediate (/habitrpg/node_modules/mongoose/node_modules/mquery/lib/utils.js:137:16)
    at processImmediate [as _immediateCallback] (timers.js:383:17)
 ----------------------------

originalUrl: /api/v2/register?lang=en

auth: undefined | undefined

headers: {"host":"137.184.240.135:3000","connection":"keep-alive","content-length":"105","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36","accept":"application/json, text/plain, */*","content-type":"application/json;charset=UTF-8","x-client":"habitica-web","origin":"http://137.184.240.135:3000","referer":"http://137.184.240.135:3000/static/front","accept-encoding":"gzip, deflate","accept-language":"en-US,en;q=0.9","cookie":"connect.sess=s%3Aj%3A%7B%22passport%22%3A%7B%7D%7D.7AR2orsC%2FobU8JrwHnMo3vFwUIjBmasc%2Bz%2BTK1xeq%2F4"}

body: {"username":"phlux","email":"phlux@ewnix.net","password":"REDACTED","confirmPassword":"REDACTED"}
[domain-middleware] POST /api/v2/register?lang=en throw error 2 times
{ [Error: Can't set headers after they are sent.]
  domain: 
   Domain {
     domain: null,
     _events: { error: [Function] },
     _eventsCount: 1,
     _maxListeners: undefined,
     members: [ [Object], [Object] ],
     _throwErrorCount: 2 },
  domainThrown: true }
POST /api/v2/register?lang=en 5739101 66.251 ms - 219
error: RangeError: Invalid status code: 5739101
    at ServerResponse.writeHead (_http_server.js:192:11)
    at ServerResponse.writeHead (/habitrpg/node_modules/express/node_modules/connect/node_modules/on-headers/index.js:55:19)
    at ServerResponse.writeHead (/habitrpg/node_modules/express/node_modules/connect/node_modules/on-headers/index.js:55:19)
    at ServerResponse._implicitHeader (_http_server.js:157:8)
    at ServerResponse.res.write (/habitrpg/node_modules/express/node_modules/connect/node_modules/compression/index.js:91:14)
    at ServerResponse.res.end (/habitrpg/node_modules/express/node_modules/connect/node_modules/compression/index.js:112:14)
    at ServerResponse.res.send (/habitrpg/node_modules/express/lib/response.js:176:8)
    at ServerResponse.res.json (/habitrpg/node_modules/express/lib/response.js:224:15)
    at auth.js:139:36
    at Promise.taskCallback (/habitrpg/node_modules/async/lib/async.js:468:21)
    at Promise.<anonymous> (/habitrpg/node_modules/mongoose/node_modules/mpromise/lib/promise.js:172:8)
    at emitOne (events.js:77:13)
    at Promise.emit (events.js:169:7)
    at Promise.emit (/habitrpg/node_modules/mongoose/node_modules/mpromise/lib/promise.js:84:38)
    at Promise.reject (/habitrpg/node_modules/mongoose/node_modules/mpromise/lib/promise.js:111:15)
    at Promise.error (/habitrpg/node_modules/mongoose/lib/promise.js:95:15)
    at Immediate.cb (/habitrpg/node_modules/mongoose/lib/query.js:1152:29)
    at Immediate._onImmediate (/habitrpg/node_modules/mongoose/node_modules/mquery/lib/utils.js:137:16)
    at processImmediate [as _immediateCallback] (timers.js:383:17)
 ----------------------------

originalUrl: /api/v2/register?lang=en

auth: undefined | undefined

headers: {"host":"137.184.240.135:3000","connection":"keep-alive","content-length":"105","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36","accept":"application/json, text/plain, */*","content-type":"application/json;charset=UTF-8","x-client":"habitica-web","origin":"http://137.184.240.135:3000","referer":"http://137.184.240.135:3000/static/front","accept-encoding":"gzip, deflate","accept-language":"en-US,en;q=0.9","cookie":"connect.sess=s%3Aj%3A%7B%22passport%22%3A%7B%7D%7D.7AR2orsC%2FobU8JrwHnMo3vFwUIjBmasc%2Bz%2BTK1xeq%2F4"}

body: {"username":"phlux","email":"phlux@ewnix.net","password":"REDACTED","confirmPassword":"REDACTED"}
POST /api/v2/register?lang=en 500 8.172 ms - 219
[domain-middleware] POST /api/v2/register?lang=en throw error 2 times
{ [Error: Can't set headers after they are sent.]
  domain: 
   Domain {
     domain: null,
     _events: { error: [Function] },
     _eventsCount: 1,
     _maxListeners: undefined,
     members: [ [Object], [Object] ],
     _throwErrorCount: 2 },
  domainThrown: true }
[Sat Nov 09 2024 02:50:53 GMT+0000 (UTC)] [worker:46] kill timeout, exit now.
[02:50:54] [nodemon] app crashed - waiting for file changes before starting...