Skip to content
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.

node server works; node wiki.js start does nothing #100

Open
sammyjava opened this issue Jun 29, 2018 · 2 comments
Open

node server works; node wiki.js start does nothing #100

sammyjava opened this issue Jun 29, 2018 · 2 comments
Assignees

Comments

@sammyjava
Copy link

Actual behavior

$ node server fires up the wiki on the configured port and all is well.
$ node wiki.js start provides an assuring message ✔ Wiki.js has started successfully. but the Wiki has not started.

Expected behavior

$node wiki.js start fires up the wiki.

Steps to reproduce the behavior

  1. install wiki.js
  2. configure with port=49157 (don't ask)
  3. $node wiki.js start -- nothing happens
  4. $node server -- wiki fires up.

This is under CentoOS 7 using the repo version of node

[root@fisher wiki-js]# rpm -q --whatprovides /usr/bin/node
nodejs-6.14.2-1.el7.x86_64
[root@fisher wiki-js]# node --version
v6.14.2
@NGPixel
Copy link
Member

NGPixel commented Jun 29, 2018

Look for errors by using node server.

If there're none, then there's an issue with pm2.
You can try installing it manually npm i pm2 -g
Then run pm2 start server -n wiki

@NGPixel NGPixel self-assigned this Jun 29, 2018
@sammyjava
Copy link
Author

sammyjava commented Jun 30, 2018

Thanks, that helped me figure out sort of what's going on. I had re-installed wiki.js to a new directory /var/www/wiki-js, but somehow, somewhere, the old directory /var/www has "stuck". pm2 indicates two locations, the one that node wiki start will start (/var/www) and the one within which it will not start (/var/www/wiki-js). I'm running it out of /var/www again so it works, but I don't see why it thinks I have two wiki.js installs.

 Describing process with id 0 - name wiki 
┌───────────────────┬─────────────────────────────────┐
│ status            │ online                          │
│ name              │ wiki                            │
│ restarts          │ 0                               │
│ uptime            │ 8s                              │
│ script path       │ /var/www/server                 │
│ script args       │ N/A                             │
│ error log path    │ /var/www/logs/wiki-error-0.log  │
│ out log path      │ /var/www/logs/wiki-output-0.log │
│ pid path          │ /root/.pm2/pids/wiki-0.pid      │
│ interpreter       │ node                            │
│ interpreter args  │ N/A                             │
│ script id         │ 0                               │
│ exec cwd          │ /var/www                        │
│ exec mode         │ fork_mode                       │
│ node.js version   │ 6.14.2                          │
│ watch & reload    │ ✘                               │
│ unstable restarts │ 0                               │
│ created at        │ 2018-06-30T19:10:03.206Z        │
└───────────────────┴─────────────────────────────────┘
 Code metrics value 
┌────────────┬──────────┐
│ Loop delay │ 250.24ms │
└────────────┴──────────┘
 Add your own code metrics: http://bit.ly/code-metrics
 Use `pm2 logs wiki [--lines 1000]` to display logs
 Use `pm2 monit` to monitor CPU and Memory usage wiki
 Describing process with id 1 - name wiki 
┌───────────────────┬──────────────────────────────────┐
│ status            │ errored                          │
│ name              │ wiki                             │
│ restarts          │ 39                               │
│ uptime            │ 0                                │
│ script path       │ /var/www/wiki-js/server          │
│ script args       │ N/A                              │
│ error log path    │ /root/.pm2/logs/wiki-error-1.log │
│ out log path      │ /root/.pm2/logs/wiki-out-1.log   │
│ pid path          │ /root/.pm2/pids/wiki-1.pid       │
│ interpreter       │ node                             │
│ interpreter args  │ N/A                              │
│ script id         │ 1                                │
│ exec cwd          │ /var/www/wiki-js                 │
│ exec mode         │ fork_mode                        │
│ node.js version   │ N/A                              │
│ watch & reload    │ ✘                                │
│ unstable restarts │ 0                                │
│ created at        │ 2018-06-30T19:10:03.211Z         │
└───────────────────┴──────────────────────────────────┘

The earlier error showed that the /var/www/wiki-js version was still looking for ProcessContainerFork.js in /var/www/node_modules rather than /var/www/wiki-js/node_modules.

[TAILING] Tailing last 15 lines for [wiki] process (change the value with --lines option)
/root/.pm2/logs/wiki-out-1.log last 15 lines:
/root/.pm2/logs/wiki-error-1.log last 15 lines:
1|wiki     |     at Module.runMain (module.js:611:10)
1|wiki     |     at run (bootstrap_node.js:394:7)
1|wiki     |     at startup (bootstrap_node.js:160:9)
1|wiki     |     at bootstrap_node.js:507:3
1|wiki     | module.js:478
1|wiki     |     throw err;
1|wiki     |     ^
1|wiki     | 
1|wiki     | Error: Cannot find module '/var/www/node_modules/pm2/lib/ProcessContainerFork.js'
1|wiki     |     at Function.Module._resolveFilename (module.js:476:15)
1|wiki     |     at Function.Module._load (module.js:424:25)
1|wiki     |     at Module.runMain (module.js:611:10)
1|wiki     |     at run (bootstrap_node.js:394:7)
1|wiki     |     at startup (bootstrap_node.js:160:9)
1|wiki     |     at bootstrap_node.js:507:3

/var/www/logs/wiki-error-0.log last 15 lines:
/var/www/logs/wiki-output-0.log last 15 lines:
0|wiki     | 2018-06-30T19:14:48.567Z - info: [SERVER] Data and Repository directories are OK.
0|wiki     | 2018-06-30T19:14:48.872Z - info: [SERVER] Checking Git repository...
0|wiki     | 2018-06-30T19:14:50.061Z - info: [SERVER] Starting HTTP/WS server on port 49157...
0|wiki     | 2018-06-30T19:14:50.086Z - info: [SERVER] HTTP/WS server started successfully! [RUNNING]
0|wiki     | 2018-06-30T19:14:50.134Z - info: [SERVER] Remote Git syncing is disabled. Not recommended!
0|wiki     | 2018-06-30T19:14:50.134Z - info: [SERVER] Git repository is OK.
0|wiki     | 2018-06-30T19:14:50.152Z - info: [SERVER] Search index flushed and ready.
0|wiki     | 2018-06-30T19:14:50.450Z - info: [AGENT] Background Agent is initializing...
0|wiki     | 2018-06-30T19:14:51.569Z - info: [AGENT] Checking Git repository...
0|wiki     | 2018-06-30T19:14:52.549Z - info: [AGENT] Remote Git syncing is disabled. Not recommended!
0|wiki     | 2018-06-30T19:14:52.549Z - info: [AGENT] Git repository is OK.
0|wiki     | 2018-06-30T19:14:52.581Z - info: [AGENT] Running all jobs...
0|wiki     | 2018-06-30T19:14:52.863Z - info: [AGENT] All jobs completed successfully! Going to sleep for now.
0|wiki     | 2018-06-30T19:15:00.899Z - info: [AGENT] Running all jobs...
0|wiki     | 2018-06-30T19:15:00.906Z - info: [AGENT] All jobs completed successfully! Going to sleep for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants