Wiki: Run Wiki.js as a background service

Created on 3 May 2019  ·  7Comments  ·  Source: Requarks/wiki

I'm not getting the service running in backgroud

Actual behavior

[root@CETPMGIP001 wiki]# cat /etc/systemd/system/wiki.service 
[Unit]
Description=Wiki.js
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/node server
Restart=always
# Consider creating a dedicated user for Wiki.js here:
User=nobody
Environment=NODE_ENV=production
WorkingDirectory=/Datafiles/wiki

[Install]
WantedBy=multi-user.target

Wiki home installation:

[root@CETPMGIP001 wiki]# pwd
/Datafiles/wiki

[root@CETPMGIP001 wiki]# ls -la
total 96
drwxr-xr-x   6 root      root     148 May  3 09:59 .
drwxr-xr-x   5 root      root      72 May  2 15:03 ..
drwxr-xr-x   8 u10051348 docker   143 Mar 24 17:06 assets
-rw-r--r--   1 u10051348 docker  2928 May  3 09:28 config.yml
drwxr-xr-x   4 root      root      34 May  3 09:59 data
-rw-r--r--   1 u10051348 docker 34520 Mar 24 16:52 LICENSE
drwxr-xr-x 805 u10051348 docker 24576 Mar 24 17:06 node_modules
-rw-r--r--   1 root      root    2928 May  3 09:28 ORI_config.sample.yml
-rw-------   1 u10051348 docker 10667 Mar 24 16:52 package.json
drwxr-xr-x  15 u10051348 docker   240 Mar 24 17:06 server
[root@CETPMGIP001 wiki]# systemctl daemon-reload

[root@CETPMGIP001 wiki]# systemctl start wiki

[root@CETPMGIP001 system]# journalctl -u wiki

May 03 10:44:38 CETPMGIP001.corporativo.pt systemd[1]: Started Wiki.js.
May 03 10:44:38 CETPMGIP001.corporativo.pt systemd[1]: Starting Wiki.js...
May 03 10:44:39 CETPMGIP001.corporativo.pt node[4417]: Loading configuration from /Datafiles/wiki/config.yml... OK
May 03 10:44:39 CETPMGIP001.corporativo.pt node[4417]: fs.js:114
May 03 10:44:39 CETPMGIP001.corporativo.pt systemd[1]: wiki.service: main process exited, code=exited, status=1/FAILURE
May 03 10:44:39 CETPMGIP001.corporativo.pt systemd[1]: Unit wiki.service entered failed state.
May 03 10:44:39 CETPMGIP001.corporativo.pt systemd[1]: wiki.service failed.
May 03 10:44:39 CETPMGIP001.corporativo.pt systemd[1]: wiki.service holdoff time over, scheduling restart.
May 03 10:44:39 CETPMGIP001.corporativo.pt systemd[1]: Started Wiki.js.
May 03 10:44:39 CETPMGIP001.corporativo.pt systemd[1]: Starting Wiki.js...
May 03 10:44:39 CETPMGIP001.corporativo.pt node[4429]: Loading configuration from /Datafiles/wiki/config.yml... OK
May 03 10:44:39 CETPMGIP001.corporativo.pt node[4429]: fs.js:114
May 03 10:44:39 CETPMGIP001.corporativo.pt systemd[1]: wiki.service: main process exited, code=exited, status=1/FAILURE
May 03 10:44:39 CETPMGIP001.corporativo.pt systemd[1]: Unit wiki.service entered failed state.
May 03 10:44:39 CETPMGIP001.corporativo.pt systemd[1]: wiki.service failed.
May 03 10:44:39 CETPMGIP001.corporativo.pt systemd[1]: wiki.service holdoff time over, scheduling restart.
May 03 10:44:39 CETPMGIP001.corporativo.pt systemd[1]: Started Wiki.js.
May 03 10:44:39 CETPMGIP001.corporativo.pt systemd[1]: Starting Wiki.js...
May 03 10:44:40 CETPMGIP001.corporativo.pt node[4437]: Loading configuration from /Datafiles/wiki/config.yml... OK
May 03 10:44:40 CETPMGIP001.corporativo.pt node[4437]: fs.js:114
May 03 10:44:40 CETPMGIP001.corporativo.pt systemd[1]: wiki.service: main process exited, code=exited, status=1/FAILURE
May 03 10:44:40 CETPMGIP001.corporativo.pt systemd[1]: Unit wiki.service entered failed state.
May 03 10:44:40 CETPMGIP001.corporativo.pt systemd[1]: wiki.service failed.
May 03 10:44:40 CETPMGIP001.corporativo.pt systemd[1]: wiki.service holdoff time over, scheduling restart.
May 03 10:44:40 CETPMGIP001.corporativo.pt systemd[1]: Started Wiki.js.
May 03 10:44:40 CETPMGIP001.corporativo.pt systemd[1]: Starting Wiki.js...
May 03 10:44:40 CETPMGIP001.corporativo.pt node[4446]: Loading configuration from /Datafiles/wiki/config.yml... OK
May 03 10:44:40 CETPMGIP001.corporativo.pt systemd[1]: wiki.service: main process exited, code=exited, status=1/FAILURE
May 03 10:44:40 CETPMGIP001.corporativo.pt systemd[1]: Unit wiki.service entered failed state.
May 03 10:44:40 CETPMGIP001.corporativo.pt systemd[1]: wiki.service failed.
May 03 10:44:40 CETPMGIP001.corporativo.pt systemd[1]: wiki.service holdoff time over, scheduling restart.
May 03 10:44:40 CETPMGIP001.corporativo.pt systemd[1]: Started Wiki.js.
May 03 10:44:40 CETPMGIP001.corporativo.pt systemd[1]: Starting Wiki.js...
May 03 10:44:40 CETPMGIP001.corporativo.pt node[4454]: Loading configuration from /Datafiles/wiki/config.yml... OK
May 03 10:44:40 CETPMGIP001.corporativo.pt node[4454]: fs.js:114
May 03 10:44:40 CETPMGIP001.corporativo.pt systemd[1]: wiki.service: main process exited, code=exited, status=1/FAILURE
May 03 10:44:40 CETPMGIP001.corporativo.pt systemd[1]: Unit wiki.service entered failed state.
May 03 10:44:40 CETPMGIP001.corporativo.pt systemd[1]: wiki.service failed.
May 03 10:44:41 CETPMGIP001.corporativo.pt systemd[1]: wiki.service holdoff time over, scheduling restart.
May 03 10:44:41 CETPMGIP001.corporativo.pt systemd[1]: start request repeated too quickly for wiki.service
May 03 10:44:41 CETPMGIP001.corporativo.pt systemd[1]: Failed to start Wiki.js.
May 03 10:44:41 CETPMGIP001.corporativo.pt systemd[1]: Unit wiki.service entered failed state.
May 03 10:44:41 CETPMGIP001.corporativo.pt systemd[1]: wiki.service failed.

Expected behavior

Steps to reproduce the behavior

Most helpful comment

I found the issue:

I changed the User=root

root@CETPMGIP001:/etc/systemd/system# cat wiki.service 
[Unit]
Description=Wiki.js
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/node server
Restart=always
# Consider creating a dedicated user for Wiki.js here:
#User=nobody
User=root
Environment=NODE_ENV=production
WorkingDirectory=/Datafiles/wiki

[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl start wiki



md5-17982a8b5add327ad4e8e44885c43ce9



root@CETPMGIP001:~# systemctl status wiki
● wiki.service - Wiki.js
   Loaded: loaded (/etc/systemd/system/wiki.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2019-05-03 16:18:37 WEST; 38s ago
 Main PID: 9808 (node)
   CGroup: /system.slice/wiki.service
           └─9808 /usr/bin/node server

May 03 16:18:38 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:38.993Z [MASTER] info: No new renderers found: [ SKIPPED ]
May 03 16:18:39 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:39.039Z [MASTER] info: No new search engines found: ...PED ]
May 03 16:18:39 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:39.074Z [MASTER] info: No new storage targets found:...PED ]
May 03 16:18:39 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:39.079Z [MASTER] info: Authentication Strategy local: [ OK ]
May 03 16:18:39 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:39.085Z [MASTER] info: Purging orphaned upload files...
May 03 16:18:39 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:39.090Z [MASTER] info: Syncing locales with Graph en...nt...
May 03 16:18:39 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:39.090Z [MASTER] info: Fetching latest updates from ...nt...
May 03 16:18:39 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:39.105Z [MASTER] info: Purging orphaned upload files...TED ]
May 03 16:18:39 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:39.974Z [MASTER] info: Fetching latest updates from ...TED ]
May 03 16:18:40 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:40.637Z [MASTER] info: Syncing locales with Graph en...TED ]
Hint: Some lines were ellipsized, use -l to show in full.



md5-17982a8b5add327ad4e8e44885c43ce9



root@CETPMGIP001:~# journalctl -u wiki

May 03 16:23:10 CETPMGIP001.corporativo.pt node[10277]: Loading configuration from /Datafiles/wiki/config.yml... OK
May 03 16:23:10 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:10.305Z [MASTER] info: ====================================
May 03 16:23:10 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:10.306Z [MASTER] info: = Wiki.js 2.0.0-beta.115 ===========
May 03 16:23:10 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:10.307Z [MASTER] info: ====================================
May 03 16:23:10 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:10.989Z [MASTER] warn: Mail is not setup! Please set the co
May 03 16:23:10 CETPMGIP001.corporativo.pt node[10277]: Warning: connect.session() MemoryStore is not
May 03 16:23:10 CETPMGIP001.corporativo.pt node[10277]: designed for a production environment, as it will leak
May 03 16:23:10 CETPMGIP001.corporativo.pt node[10277]: memory, and will not scale past a single process.
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.016Z [MASTER] info: Loading GraphQL Schema...
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.231Z [MASTER] info: GraphQL Schema: [ OK ]
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.351Z [MASTER] info: HTTP Server on port: [ 3001 ]
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.354Z [MASTER] info: HTTP Server: [ RUNNING ]
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.474Z [MASTER] info: No new authentication strategies fou
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.484Z [MASTER] info: No new editors found: [ SKIPPED ]
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.524Z [MASTER] info: No new loggers found: [ SKIPPED ]
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.598Z [MASTER] info: No new renderers found: [ SKIPPED ]
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.635Z [MASTER] info: No new search engines found: [ SKIPP
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.679Z [MASTER] info: No new storage targets found: [ SKIP
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.683Z [MASTER] info: Authentication Strategy local: [ OK 
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.689Z [MASTER] info: Purging orphaned upload files...
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.693Z [MASTER] info: Syncing locales with Graph endpoint.
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.694Z [MASTER] info: Fetching latest updates from Graph e
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.709Z [MASTER] info: Purging orphaned upload files: [ COM
May 03 16:23:12 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:12.317Z [MASTER] info: Fetching latest updates from Graph e
May 03 16:23:12 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:12.916Z [MASTER] info: Syncing locales with Graph endpoint:
lines 171-237/237 (END)

thanks for the help and attention you gave to this problem.

BR

David

All 7 comments

What does your config.yml look like? I cannot find _any_ file by the name 'fs.js', neither in my install, nor in the git repo. To me, it looks like whatever it's trying to do when running fs.js, it bombs out on line 114. Either that or it's choking on your config file for some reason.

Do you get any error when you run node server?

Hi,

In config.yml I ony change the port, because I have another app using the por 3000:

[root@CETPMGIP001 wiki]# pwd
/Datafiles/wiki
[root@CETPMGIP001 wiki]# cat config.yml 
#######################################################################
# Wiki.js - CONFIGURATION                                             #
#######################################################################
# Full documentation + examples:
# https://docs.requarks.io/wiki/install

# ---------------------------------------------------------------------
# Port the server should listen to
# ---------------------------------------------------------------------

port: 3001

# ---------------------------------------------------------------------
# Database
# ---------------------------------------------------------------------
# Supported Database Engines:
# - postgres = PostgreSQL 9.5 or later
# - mysql = MySQL 5.7.8
# - mariadb = MariaDB 10.2.7 or later
# - mssql = MS SQL Server 2012 or later
# - sqlite = SQLite 3.9 or later

db:
  type: postgres
  # PostgreSQL / MySQL / MariaDB / MS SQL Server only:
  host: localhost
  port: 5432
  user: wikijs
  pass: wikijsrocks
  db: wiki
  # SQLite only:
  storage: path/to/database.sqlite

#######################################################################
# ADVANCED OPTIONS                                                    #
#######################################################################
# Do not change unless you know what you are doing!

# ---------------------------------------------------------------------
# Use X-Forwarded-For header
# ---------------------------------------------------------------------
# Enable only if Wiki.js is behind a reverse-proxy (nginx, apache, etc)
# or a cloud proxying services like Cloudflare.

trustProxy: false

# ---------------------------------------------------------------------
# SSL/TLS Settings
# ---------------------------------------------------------------------
# Consider using a reverse proxy (e.g. nginx) if you require more
# advanced options than those provided below.

ssl:
  enabled: false

  # Certificate format, either 'pem' or 'pfx':
  format: pem
  # Using PEM format:
  key: path/to/key.pem
  cert: path/to/cert.pem
  # Using PFX format:
  pfx: path/to/cert.pfx
  # Passphrase when using encrypted PEM / PFX keys (default: null):
  passphrase: null
  # Diffie Hellman parameters, with key length being greater or equal
  # to 1024 bits (default: null):
  dhparam: null

  # Listen on this HTTP port and redirect all requests to HTTPS.
  # Set to false to disable (default: 80):
  redirectNonSSLPort: 80

# ---------------------------------------------------------------------
# IP address the server should listen to
# ---------------------------------------------------------------------
# Leave 0.0.0.0 for all interfaces

bindIP: 0.0.0.0

# ---------------------------------------------------------------------
# Log Level
# ---------------------------------------------------------------------
# Possible values: error, warn, info (default), verbose, debug, silly

logLevel: info

When I run node server is Ok:

[root@CETPMGIP001 Datafiles]# cd wiki/
[root@CETPMGIP001 wiki]# node server
Loading configuration from /Datafiles/wiki/config.yml... OK
2019-05-03T13:17:35.266Z [MASTER] info: =======================================
2019-05-03T13:17:35.268Z [MASTER] info: = Wiki.js 2.0.0-beta.84 ===============
2019-05-03T13:17:35.268Z [MASTER] info: =======================================

2019-05-03T13:18:13.565Z [MASTER] warn: Mail is not setup! Please set the configuration in the administration area!
2019-05-03T13:18:14.088Z [MASTER] info: Loading GraphQL Schema...
2019-05-03T13:18:18.906Z [MASTER] info: GraphQL Schema: [ OK ]
2019-05-03T13:18:19.035Z [MASTER] info: HTTP Server on port: [ 3001 ]
2019-05-03T13:18:19.038Z [MASTER] info: HTTP Server: [ RUNNING ]
2019-05-03T13:18:20.533Z [MASTER] info: No new authentication strategies found: [ SKIPPED ]
2019-05-03T13:18:20.576Z [MASTER] info: No new editors found: [ SKIPPED ]
2019-05-03T13:18:20.922Z [MASTER] info: No new loggers found: [ SKIPPED ]
2019-05-03T13:18:21.705Z [MASTER] info: No new renderers found: [ SKIPPED ]
2019-05-03T13:18:22.229Z [MASTER] info: No new search engines found: [ SKIPPED ]
2019-05-03T13:18:22.380Z [MASTER] info: No new storage targets found: [ SKIPPED ]
2019-05-03T13:18:22.631Z [MASTER] info: Authentication Strategy local: [ OK ]
2019-05-03T13:18:22.683Z [MASTER] info: Purging orphaned upload files...
2019-05-03T13:18:23.445Z [MASTER] info: Syncing locales with Graph endpoint...
2019-05-03T13:18:23.447Z [MASTER] info: Fetching latest updates from Graph endpoint...
2019-05-03T13:18:23.467Z [MASTER] info: Purging orphaned upload files: [ COMPLETED ]
2019-05-03T13:18:24.192Z [MASTER] info: Fetching latest updates from Graph endpoint: [ COMPLETED ]
2019-05-03T13:18:24.750Z [MASTER] info: Syncing locales with Graph endpoint: [ COMPLETED ]

BR

David

As a quick note, you're running beta 84. Current beta version is 115. I'm not completely sure what all has changed in those updates, but it may be worth upgrading and checking if it results in the same error. I'd be hesitant to try to troubleshoot an install that not updated, for either of our sakes. We could bang our heads against a wall for hours trying to find the issue, only to discover that it was fixed in an update! lol

I installed the beta version 115 and the behavior is the same:

(I removed my wiki folder and extract the beta 115 package)

root@CETPMGIP001:~# systemctl start wiki
root@CETPMGIP001:~# systemctl enable wiki

root@CETPMGIP001:~# journalctl -u wiki

May 03 15:12:02 CETPMGIP001.corporativo.pt systemd[1]: Started Wiki.js.
May 03 15:12:02 CETPMGIP001.corporativo.pt systemd[1]: Starting Wiki.js...
May 03 15:12:02 CETPMGIP001.corporativo.pt node[3059]: Loading configuration from /Datafiles/wiki/config.yml... OK
May 03 15:12:02 CETPMGIP001.corporativo.pt systemd[1]: wiki.service: main process exited, code=exited, status=1/FAILURE
May 03 15:12:02 CETPMGIP001.corporativo.pt systemd[1]: Unit wiki.service entered failed state.
May 03 15:12:02 CETPMGIP001.corporativo.pt systemd[1]: wiki.service failed.
May 03 15:12:03 CETPMGIP001.corporativo.pt systemd[1]: wiki.service holdoff time over, scheduling restart.
May 03 15:12:03 CETPMGIP001.corporativo.pt systemd[1]: Started Wiki.js.
May 03 15:12:03 CETPMGIP001.corporativo.pt systemd[1]: Starting Wiki.js...
May 03 15:12:03 CETPMGIP001.corporativo.pt node[3072]: Loading configuration from /Datafiles/wiki/config.yml... OK
May 03 15:12:03 CETPMGIP001.corporativo.pt systemd[1]: wiki.service: main process exited, code=exited, status=1/FAILURE
May 03 15:12:03 CETPMGIP001.corporativo.pt systemd[1]: Unit wiki.service entered failed state.
May 03 15:12:03 CETPMGIP001.corporativo.pt systemd[1]: wiki.service failed.
May 03 15:12:03 CETPMGIP001.corporativo.pt systemd[1]: wiki.service holdoff time over, scheduling restart.
May 03 15:12:03 CETPMGIP001.corporativo.pt systemd[1]: Started Wiki.js.
May 03 15:12:03 CETPMGIP001.corporativo.pt systemd[1]: Starting Wiki.js...
May 03 15:12:03 CETPMGIP001.corporativo.pt node[3080]: Loading configuration from /Datafiles/wiki/config.yml... OK
May 03 15:12:03 CETPMGIP001.corporativo.pt node[3080]: fs.js:114
May 03 15:12:03 CETPMGIP001.corporativo.pt systemd[1]: wiki.service: main process exited, code=exited, status=1/FAILURE
May 03 15:12:03 CETPMGIP001.corporativo.pt systemd[1]: Unit wiki.service entered failed state.
May 03 15:12:03 CETPMGIP001.corporativo.pt systemd[1]: wiki.service failed.
May 03 15:12:03 CETPMGIP001.corporativo.pt systemd[1]: wiki.service holdoff time over, scheduling restart.
May 03 15:12:03 CETPMGIP001.corporativo.pt systemd[1]: Started Wiki.js.
May 03 15:12:03 CETPMGIP001.corporativo.pt systemd[1]: Starting Wiki.js...
May 03 15:12:04 CETPMGIP001.corporativo.pt node[3088]: Loading configuration from /Datafiles/wiki/config.yml... OK
May 03 15:12:04 CETPMGIP001.corporativo.pt node[3088]: fs.js:114
May 03 15:12:04 CETPMGIP001.corporativo.pt systemd[1]: wiki.service: main process exited, code=exited, status=1/FAILURE
May 03 15:12:04 CETPMGIP001.corporativo.pt systemd[1]: Unit wiki.service entered failed state.
May 03 15:12:04 CETPMGIP001.corporativo.pt systemd[1]: wiki.service failed.
May 03 15:12:04 CETPMGIP001.corporativo.pt systemd[1]: wiki.service holdoff time over, scheduling restart.
May 03 15:12:04 CETPMGIP001.corporativo.pt systemd[1]: Started Wiki.js.
May 03 15:12:04 CETPMGIP001.corporativo.pt systemd[1]: Starting Wiki.js...
May 03 15:12:04 CETPMGIP001.corporativo.pt node[3097]: Loading configuration from /Datafiles/wiki/config.yml... OK
May 03 15:12:04 CETPMGIP001.corporativo.pt node[3097]: fs.js:114
May 03 15:12:04 CETPMGIP001.corporativo.pt systemd[1]: wiki.service: main process exited, code=exited, status=1/FAILURE
May 03 15:12:04 CETPMGIP001.corporativo.pt systemd[1]: Unit wiki.service entered failed state.
May 03 15:12:04 CETPMGIP001.corporativo.pt systemd[1]: wiki.service failed.
May 03 15:12:04 CETPMGIP001.corporativo.pt systemd[1]: wiki.service holdoff time over, scheduling restart.
May 03 15:12:04 CETPMGIP001.corporativo.pt systemd[1]: start request repeated too quickly for wiki.service
May 03 15:12:04 CETPMGIP001.corporativo.pt systemd[1]: Failed to start Wiki.js.
May 03 15:12:04 CETPMGIP001.corporativo.pt systemd[1]: Unit wiki.service entered failed state.
May 03 15:12:04 CETPMGIP001.corporativo.pt systemd[1]: wiki.service failed.

running node server:

root@CETPMGIP001:/Datafiles/wiki# node server/
Loading configuration from /Datafiles/wiki/config.yml... OK
2019-05-03T14:15:02.748Z [MASTER] info: =======================================
2019-05-03T14:15:02.750Z [MASTER] info: = Wiki.js 2.0.0-beta.115 ==============
2019-05-03T14:15:02.750Z [MASTER] info: =======================================
2019-05-03T14:15:09.326Z [MASTER] warn: Mail is not setup! Please set the configuration in the administration area!
2019-05-03T14:15:09.481Z [MASTER] info: Loading GraphQL Schema...
2019-05-03T14:15:10.871Z [MASTER] info: GraphQL Schema: [ OK ]
2019-05-03T14:15:11.021Z [MASTER] info: HTTP Server on port: [ 3001 ]
2019-05-03T14:15:11.024Z [MASTER] info: HTTP Server: [ RUNNING ]
2019-05-03T14:15:11.360Z [MASTER] info: No new authentication strategies found: [ SKIPPED ]
2019-05-03T14:15:11.378Z [MASTER] info: No new editors found: [ SKIPPED ]
2019-05-03T14:15:11.485Z [MASTER] info: No new loggers found: [ SKIPPED ]
2019-05-03T14:15:11.620Z [MASTER] info: No new renderers found: [ SKIPPED ]
2019-05-03T14:15:11.683Z [MASTER] info: No new search engines found: [ SKIPPED ]
2019-05-03T14:15:11.752Z [MASTER] info: No new storage targets found: [ SKIPPED ]
2019-05-03T14:15:11.769Z [MASTER] info: Authentication Strategy local: [ OK ]
2019-05-03T14:15:11.781Z [MASTER] info: Purging orphaned upload files...
2019-05-03T14:15:11.812Z [MASTER] info: Syncing locales with Graph endpoint...
2019-05-03T14:15:11.817Z [MASTER] info: Fetching latest updates from Graph endpoint...
2019-05-03T14:15:11.833Z [MASTER] info: Purging orphaned upload files: [ COMPLETED ]
2019-05-03T14:15:12.870Z [MASTER] info: Fetching latest updates from Graph endpoint: [ COMPLETED ]
2019-05-03T14:15:13.284Z [MASTER] info: Syncing locales with Graph endpoint: [ COMPLETED ]

BR

David

Perfect! Clean ground to work on. Well, the issue still exists, so not quite perfect, but I digress...

Writing this response as I dig for the record, so I do apologize if it seems a bit disconnected.

Stepping through the code:

  • node server
  • From WorkingDirectory Reference:
  • entry point: ./index.js
  • index.js:19 calls ./core/config:init
  • config.js:25 writes that log entry Loading configuration from ${confPaths.config}...

    • config.js:33 and config.js:36 call the fs function.

  • config.js:38 finishes it: console.info(chalk.green.bold('OK'))

    • Passes back to index.js

  • index.js:25 calls ./core/logger:init, which just initializes and passes back
  • index.js:31 calls ./core/kernel:init, which at the very start prints the wikiJS banner. Assuming that _should_ still show in the journalctl logs, we know we didn't get this far.
  • From there, fs.js:114 errors out.

Now, I _did_ find out where fs.js goes. Straight into NodeJS's Filesystem module. I won't go digging there, because that would take a long time, and we can generally assume it works properly. Which basically makes me stuck here. I guess a couple of things to do which may possibly help:

In your config file, change logLevel to debug. I didn't see anything in the code referencing anything below info, but maybe I'm still looking in the wrong spot. Currently my assumption is that with the way the service file passes the directory and how the code is reading it, there's a disconnect somewhere.

As I dig more, I feel like I'm getting at least closer to where the issue lies, but I'm not sure I have time to dig into it much deeper than I have. It looks like it may be erroring out in kernel.js. So let's start with bumping that log to debug and see if it gives us any more info.

Let me know

I found the issue:

I changed the User=root

root@CETPMGIP001:/etc/systemd/system# cat wiki.service 
[Unit]
Description=Wiki.js
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/node server
Restart=always
# Consider creating a dedicated user for Wiki.js here:
#User=nobody
User=root
Environment=NODE_ENV=production
WorkingDirectory=/Datafiles/wiki

[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl start wiki



md5-17982a8b5add327ad4e8e44885c43ce9



root@CETPMGIP001:~# systemctl status wiki
● wiki.service - Wiki.js
   Loaded: loaded (/etc/systemd/system/wiki.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2019-05-03 16:18:37 WEST; 38s ago
 Main PID: 9808 (node)
   CGroup: /system.slice/wiki.service
           └─9808 /usr/bin/node server

May 03 16:18:38 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:38.993Z [MASTER] info: No new renderers found: [ SKIPPED ]
May 03 16:18:39 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:39.039Z [MASTER] info: No new search engines found: ...PED ]
May 03 16:18:39 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:39.074Z [MASTER] info: No new storage targets found:...PED ]
May 03 16:18:39 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:39.079Z [MASTER] info: Authentication Strategy local: [ OK ]
May 03 16:18:39 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:39.085Z [MASTER] info: Purging orphaned upload files...
May 03 16:18:39 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:39.090Z [MASTER] info: Syncing locales with Graph en...nt...
May 03 16:18:39 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:39.090Z [MASTER] info: Fetching latest updates from ...nt...
May 03 16:18:39 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:39.105Z [MASTER] info: Purging orphaned upload files...TED ]
May 03 16:18:39 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:39.974Z [MASTER] info: Fetching latest updates from ...TED ]
May 03 16:18:40 CETPMGIP001.corporativo.pt node[9808]: 2019-05-03T15:18:40.637Z [MASTER] info: Syncing locales with Graph en...TED ]
Hint: Some lines were ellipsized, use -l to show in full.



md5-17982a8b5add327ad4e8e44885c43ce9



root@CETPMGIP001:~# journalctl -u wiki

May 03 16:23:10 CETPMGIP001.corporativo.pt node[10277]: Loading configuration from /Datafiles/wiki/config.yml... OK
May 03 16:23:10 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:10.305Z [MASTER] info: ====================================
May 03 16:23:10 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:10.306Z [MASTER] info: = Wiki.js 2.0.0-beta.115 ===========
May 03 16:23:10 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:10.307Z [MASTER] info: ====================================
May 03 16:23:10 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:10.989Z [MASTER] warn: Mail is not setup! Please set the co
May 03 16:23:10 CETPMGIP001.corporativo.pt node[10277]: Warning: connect.session() MemoryStore is not
May 03 16:23:10 CETPMGIP001.corporativo.pt node[10277]: designed for a production environment, as it will leak
May 03 16:23:10 CETPMGIP001.corporativo.pt node[10277]: memory, and will not scale past a single process.
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.016Z [MASTER] info: Loading GraphQL Schema...
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.231Z [MASTER] info: GraphQL Schema: [ OK ]
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.351Z [MASTER] info: HTTP Server on port: [ 3001 ]
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.354Z [MASTER] info: HTTP Server: [ RUNNING ]
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.474Z [MASTER] info: No new authentication strategies fou
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.484Z [MASTER] info: No new editors found: [ SKIPPED ]
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.524Z [MASTER] info: No new loggers found: [ SKIPPED ]
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.598Z [MASTER] info: No new renderers found: [ SKIPPED ]
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.635Z [MASTER] info: No new search engines found: [ SKIPP
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.679Z [MASTER] info: No new storage targets found: [ SKIP
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.683Z [MASTER] info: Authentication Strategy local: [ OK 
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.689Z [MASTER] info: Purging orphaned upload files...
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.693Z [MASTER] info: Syncing locales with Graph endpoint.
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.694Z [MASTER] info: Fetching latest updates from Graph e
May 03 16:23:11 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:11.709Z [MASTER] info: Purging orphaned upload files: [ COM
May 03 16:23:12 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:12.317Z [MASTER] info: Fetching latest updates from Graph e
May 03 16:23:12 CETPMGIP001.corporativo.pt node[10277]: 2019-05-03T15:23:12.916Z [MASTER] info: Syncing locales with Graph endpoint:
lines 171-237/237 (END)

thanks for the help and attention you gave to this problem.

BR

David

Glad you were able to fix it! Always something simple... lol. I'll make a note of that one, make sure it gets passed over and documented.

Thanks for the reply!

Was this page helpful?
0 / 5 - 0 ratings