requarks / wiki

Wiki.js | A modern and powerful wiki app built on Node.js
https://js.wiki
GNU Affero General Public License v3.0
24.33k stars 2.69k forks source link

Stuck in Startup/Restart Loop #562

Closed nyedid closed 6 years ago

nyedid commented 6 years ago

Actual behavior

Wiki.js continually gets stuck in a loop on startup.

Here is an output of the log and error log.

[user@some_host]$ sudo node wiki start
✔ Wiki.js has started successfully.

[user@some_host]$ tail -f -n 40 logs/wiki-output-0.log 
2018-07-03T17:47:37.355Z - info: [SERVER] Wiki.js is initializing...
2018-07-03T17:47:37.768Z - info: [SERVER] Checking data directories...
2018-07-03T17:47:37.770Z - info: [SERVER] Data and Repository directories are OK.
2018-07-03T17:47:38.641Z - info: [SERVER] Checking Git repository...
2018-07-03T17:47:41.525Z - info: [SERVER] Starting HTTP/WS server on port 9090...
2018-07-03T17:47:42.105Z - info: [SERVER] Wiki.js is initializing...
2018-07-03T17:47:42.456Z - info: [SERVER] Checking data directories...
2018-07-03T17:47:42.457Z - info: [SERVER] Data and Repository directories are OK.
2018-07-03T17:47:43.397Z - info: [SERVER] Checking Git repository...

[user@some_host]$ tail -f -n 40 logs/wiki-error-0.log 
2018-07-03T17:47:03.344Z - error: [SERVER] Port 9090 is already in use!
2018-07-03T17:47:08.060Z - error: [SERVER] Port 9090 is already in use!
2018-07-03T17:47:13.161Z - error: [SERVER] Port 9090 is already in use!
2018-07-03T17:47:18.187Z - error: [SERVER] Port 9090 is already in use!
2018-07-03T17:47:22.864Z - error: [SERVER] Port 9090 is already in use!
2018-07-03T17:47:27.741Z - error: [SERVER] Port 9090 is already in use!
2018-07-03T17:47:32.410Z - error: [SERVER] Port 9090 is already in use!
2018-07-03T17:47:36.948Z - error: [SERVER] Port 9090 is already in use!
2018-07-03T17:47:41.574Z - error: [SERVER] Port 9090 is already in use!
2018-07-03T17:47:46.316Z - error: [SERVER] Port 9090 is already in use!
2018-07-03T17:47:50.819Z - error: [SERVER] Port 9090 is already in use!
2018-07-03T17:47:55.345Z - error: [SERVER] Port 9090 is already in use!
2018-07-03T17:48:00.005Z - error: [SERVER] Port 9090 is already in use!

We also got a related issue that was discovered during troubleshooting. The logs indicated the following:

pm2 logs wiki --lines 100
0|wiki     | 2018-07-03T17:42:31.201Z - error: [SERVER] Unable to write to cache! Performance may be affected.
0|wiki     | 2018-07-03T17:42:31.201Z - error: [SERVER]  Error: EACCES: permission denied, open '/home/user/dev/wikijs/data/cache/106a6c241b8797f52e1e77317b96a201.json'
0|wiki     | 2018-07-03T17:42:31.370Z - error: [SERVER] Unable to write to cache! Performance may be affected.
0|wiki     | 2018-07-03T17:42:31.370Z - error: [SERVER]  Error: EACCES: permission denied, open '/home/user/dev/wikijs/data/cache/106a6c241b8797f52e1e77317b96a201.json'

Expected behavior

Expect that Wiki.js would initialize and stay started up after:

- Start wikijs: sudo node wiki start
- Stop wikijs: sudo node wiki stop

Steps to reproduce the behavior

Restart Wiki.js

NGPixel commented 6 years ago

Start in interactive mode and look for errors: node server

nyedid commented 6 years ago

Where is the parameter to change for starting in interactive mode? We can't find it.

NGPixel commented 6 years ago

image