Around a month ago I did upgrade NodeBB (not sure from which version, to 2.4 or 2.2) and also Node (from 16 I think to v18.7.0), and after that I'm getting this error:
TypeError: Cannot read properties of undefined (reading 'split')
This is what I see in web browser.
This is what I get in nginx
's error log:
2022/08/14 15:57:08 [error] 674481#674481: *77854 upstream prematurely closed connection while reading response header from upstream, client: MY_IP, server: pythonforum.ir, request: "GET /post/1881 HTTP/1.1", upstream: "http://127.0.0.1:8080/post/1881", host: "pythonforum.ir"
2022/08/14 15:57:09 [error] 674481#674481: *77854 connect() failed (111: Connection refused) while connecting to upstream, client: MY_IP, server: pythonforum.ir, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8080/favicon.ico", host: "pythonforum.ir", referrer: "https://pythonforum.ir/post/1881"
I'm running nodebb as a systemd service and it is up.
This is /home/path/to/nodebb log
:
2022-08-14T11:34:15.563Z [8080/676608] - error: uncaughtException: Cannot read properties of undefined (reading 'split')
TypeError: Cannot read properties of undefined (reading 'split')
at helpers.buildBodyClass (/home/path/to/src/middleware/helpers.js:60:46)
at exports.send404 (/home/path/to/src/controllers/404.js:62:22)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {"date":"Sun Aug 14 2022 16:04:15 GMT+0430 (Iran Daylight Time)","error":{},"exception":true,"os":{"loadavg":[0.06,0.09,0.06],"uptime":2700726.25},"process":{"argv":["/usr/bin/node","/home/path/to/app.js"],"cwd":"/home/path/to","execPath":"/usr/bin/node","gid":0,"memoryUsage":{"arrayBuffers":19074166,"external":21101205,"heapTotal":77463552,"heapUsed":72795168,"rss":142405632},"pid":676608,"uid":0,"version":"v18.7.0"},"stack":"TypeError: Cannot read properties of undefined (reading 'split')\n at helpers.buildBodyClass (/home/path/to/src/middleware/helpers.js:60:46)\n at exports.send404 (/home/path/to/src/controllers/404.js:62:22)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","trace":[{"column":46,"file":"/home/path/to/src/middleware/helpers.js","function":"helpers.buildBodyClass","line":60,"method":"buildBodyClass","native":false},{"column":22,"file":"/home/path/to/src/controllers/404.js","function":"exports.send404","line":62,"method":"send404","native":false},{"column":5,"file":"node:internal/process/task_queues","function":"process.processTicksAndRejections","line":95,"method":"processTicksAndRejections","native":false}]}
2022-08-14T11:34:15.572Z [8080/676608] - error: TypeError: Cannot read properties of undefined (reading 'split')
at helpers.buildBodyClass (/home/path/to/src/middleware/helpers.js:60:46)
at exports.send404 (/home/path/to/src/controllers/404.js:62:22)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2022-08-14T11:34:15.573Z [8080/676608] - info: [app] Shutdown (SIGTERM/SIGINT) Initialised.
2022-08-14T11:34:15.583Z [8080/676608] - info: [app] Web server closed to connections.
2022-08-14T11:34:15.600Z [8080/676608] - info: [app] Live analytics saved.
2022-08-14T11:34:15.622Z [8080/676608] - info: [app] Database connection closed.
2022-08-14T11:34:15.623Z [8080/676608] - info: [app] Shutdown complete.
[cluster] Child Process (676608) has exited (code: 1, signal: null)
[cluster] Spinning up another process...
2022-08-14T11:34:16.643Z [8080/676900] - info: Initializing NodeBB v2.4.1 https://pythonforum.ir
Do you help me what is wrong with it? I tried many thing, like using old backup for both database and files but it did not help me.