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

Newly installed wiki will not load #544

Closed joelft closed 6 years ago

joelft commented 6 years ago

Actual behavior

The wiki will not load in my web browser "localhost didn't send any data." error when trying to view the wiki - after waiting for about 5 minutes

Expected behavior

Able to see my shiny new wiki

Steps to reproduce the behavior

I am running the docker setup via docker-compose by following the directions HERE.

docker does not seem to be throwing any errors, and the wiki appears to be starting correctly

wannessels commented 6 years ago

I have the same issue, trying to set up via docker-compose on a fresh ubuntu 18.04

`$ sudo docker-compose up Creating network "wikijs_default" with the default driver Creating wikijs_wikidb_1 ... Creating wikijs_wikidb_1 ... done Creating wikijs_wikijs_1 ... Creating wikijs_wikijs_1 ... done Attaching to wikijs_wikidb_1, wikijs_wikijs_1 wikidb_1 | 2018-06-12T20:40:47.938+0000 I CONTROL [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=0f92bfdf609c wikidb_1 | 2018-06-12T20:40:47.938+0000 I CONTROL [initandlisten] db version v3.6.5 wikidb_1 | 2018-06-12T20:40:47.938+0000 I CONTROL [initandlisten] git version: a20ecd3e3a174162052ff99913bc2ca9a839d618 wikidb_1 | 2018-06-12T20:40:47.938+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1t 3 May 2016 wikidb_1 | 2018-06-12T20:40:47.938+0000 I CONTROL [initandlisten] allocator: tcmalloc wikidb_1 | 2018-06-12T20:40:47.938+0000 I CONTROL [initandlisten] modules: none wikidb_1 | 2018-06-12T20:40:47.938+0000 I CONTROL [initandlisten] build environment: wikidb_1 | 2018-06-12T20:40:47.938+0000 I CONTROL [initandlisten] distmod: debian81 wikidb_1 | 2018-06-12T20:40:47.938+0000 I CONTROL [initandlisten] distarch: x86_64 wikidb_1 | 2018-06-12T20:40:47.938+0000 I CONTROL [initandlisten] target_arch: x86_64 wikidb_1 | 2018-06-12T20:40:47.938+0000 I CONTROL [initandlisten] options: { net: { bindIp: "wikidb" }, storage: { mmapv1: { smallFiles: true } } } wikidb_1 | 2018-06-12T20:40:47.940+0000 I - [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'. wikidb_1 | 2018-06-12T20:40:47.940+0000 I STORAGE [initandlisten] wikidb_1 | 2018-06-12T20:40:47.940+0000 I STORAGE [initandlisten] WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine wikidb_1 | 2018-06-12T20:40:47.940+0000 I STORAGE [initandlisten] See http://dochub.mongodb.org/core/prodnotes-filesystem wikidb_1 | 2018-06-12T20:40:47.940+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1412M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),cache_cursors=false,log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress), wikidb_1 | 2018-06-12T20:40:48.880+0000 I STORAGE [initandlisten] WiredTiger message [1528836048:880663][1:0x7f0c45fd2a00], txn-recover: Main recovery loop: starting at 8/7168 wikidb_1 | 2018-06-12T20:40:49.004+0000 I STORAGE [initandlisten] WiredTiger message [1528836049:4498][1:0x7f0c45fd2a00], txn-recover: Recovering log 8 through 9 wikijs_1 | 2018-06-12 20:40:49,043 CRIT Supervisor running as root (no user in config file) wikijs_1 | 2018-06-12 20:40:49,051 INFO RPC interface 'supervisor' initialized wikijs_1 | 2018-06-12 20:40:49,051 CRIT Server 'unix_http_server' running without any HTTP authentication checking wikijs_1 | 2018-06-12 20:40:49,052 INFO supervisord started with pid 1 wikidb_1 | 2018-06-12T20:40:49.065+0000 I STORAGE [initandlisten] WiredTiger message [1528836049:65498][1:0x7f0c45fd2a00], txn-recover: Recovering log 9 through 9 wikidb_1 | 2018-06-12T20:40:49.123+0000 I STORAGE [initandlisten] WiredTiger message [1528836049:123171][1:0x7f0c45fd2a00], txn-recover: Set global recovery timestamp: 0 wikidb_1 | 2018-06-12T20:40:49.146+0000 W STORAGE [initandlisten] Detected configuration for non-active storage engine mmapv1 when current storage engine is wiredTiger wikidb_1 | 2018-06-12T20:40:49.146+0000 I CONTROL [initandlisten] wikidb_1 | 2018-06-12T20:40:49.146+0000 I CONTROL [initandlisten] WARNING: Access control is not enabled for the database. wikidb_1 | 2018-06-12T20:40:49.146+0000 I CONTROL [initandlisten] Read and write access to data and configuration is unrestricted. wikidb_1 | 2018-06-12T20:40:49.146+0000 I CONTROL [initandlisten] wikidb_1 | 2018-06-12T20:40:49.157+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data' wikidb_1 | 2018-06-12T20:40:49.158+0000 I NETWORK [initandlisten] waiting for connections on port 27017 wikijs_1 | 2018-06-12 20:40:50,055 INFO spawned: 'wikijs' with pid 8 wikijs_1 | 2018-06-12 20:40:51,651 INFO success: wikijs entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

`

wannessels commented 6 years ago

Found my problem, I hadn't set the hostname to mongodb in config.yml

Make sure to set the db parameter to point to the mongo container. In the example docker compose file, the mongo container is named wikidb. As such, the db connection string should be set to: mongodb://wikidb:27017/wiki

joelft commented 6 years ago

Wow I feel dumb lol. I made the change, and now I have a different problem. My browser fails to connect instantly now instead of waiting a while, and says ERR_CONNECTION_RESET

wannessels commented 6 years ago

any errors in the logs? (sudo) docker-compose logs

joelft commented 6 years ago

I see no errors. Ports are forwarded correctly (according to 'docker container ls').


wikidb_1  | 2018-06-13T18:51:44.105+0000 I CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=8e4b6748c39c
wikidb_1  | 2018-06-13T18:51:44.121+0000 I CONTROL  [initandlisten] db version v3.6.5
wikidb_1  | 2018-06-13T18:51:44.121+0000 I CONTROL  [initandlisten] git version: a20ecd3e3a174162052ff99913bc2ca9a839d618
wikidb_1  | 2018-06-13T18:51:44.121+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1t  3 May 2016
wikidb_1  | 2018-06-13T18:51:44.121+0000 I CONTROL  [initandlisten] allocator: tcmalloc
wikidb_1  | 2018-06-13T18:51:44.121+0000 I CONTROL  [initandlisten] modules: none
wikidb_1  | 2018-06-13T18:51:44.121+0000 I CONTROL  [initandlisten] build environment:
wikidb_1  | 2018-06-13T18:51:44.121+0000 I CONTROL  [initandlisten]     distmod: debian81
wikidb_1  | 2018-06-13T18:51:44.121+0000 I CONTROL  [initandlisten]     distarch: x86_64
wikidb_1  | 2018-06-13T18:51:44.121+0000 I CONTROL  [initandlisten]     target_arch: x86_64
wikidb_1  | 2018-06-13T18:51:44.121+0000 I CONTROL  [initandlisten] options: { net: { bindIp: "wikidb" }, storage: { mmapv1: { smallFiles: true } } }
wikidb_1  | 2018-06-13T18:51:44.193+0000 I -        [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
wikidb_1  | 2018-06-13T18:51:44.193+0000 I STORAGE  [initandlisten]
wikidb_1  | 2018-06-13T18:51:44.193+0000 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
wikidb_1  | 2018-06-13T18:51:44.193+0000 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
wikidb_1  | 2018-06-13T18:51:44.193+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=3418M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),cache_cursors=false,log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
wikidb_1  | 2018-06-13T18:51:44.951+0000 I STORAGE  [initandlisten] WiredTiger message [1528915904:951274][1:0x7ff8e8920a00], txn-recover: Main recovery loop: starting at 2/6528
wikidb_1  | 2018-06-13T18:51:45.025+0000 I STORAGE  [initandlisten] WiredTiger message [1528915905:25140][1:0x7ff8e8920a00], txn-recover: Recovering log 2 through 3
wikidb_1  | 2018-06-13T18:51:45.126+0000 I STORAGE  [initandlisten] WiredTiger message [1528915905:126075][1:0x7ff8e8920a00], txn-recover: Recovering log 3 through 3
wikidb_1  | 2018-06-13T18:51:45.189+0000 I STORAGE  [initandlisten] WiredTiger message [1528915905:189812][1:0x7ff8e8920a00], txn-recover: Set global recovery timestamp: 0
wikidb_1  | 2018-06-13T18:51:46.396+0000 W STORAGE  [initandlisten] Detected configuration for non-active storage engine mmapv1 when current storage engine is wiredTiger
wikidb_1  | 2018-06-13T18:51:46.396+0000 I CONTROL  [initandlisten]
wikidb_1  | 2018-06-13T18:51:46.396+0000 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
wikidb_1  | 2018-06-13T18:51:46.396+0000 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
wikidb_1  | 2018-06-13T18:51:46.396+0000 I CONTROL  [initandlisten]
wikidb_1  | 2018-06-13T18:51:46.522+0000 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
wikidb_1  | 2018-06-13T18:51:46.523+0000 I NETWORK  [initandlisten] waiting for connections on port 27017
wikidb_1  | 2018-06-13T18:51:53.402+0000 I NETWORK  [listener] connection accepted from 172.18.0.3:58510 #1 (1 connection now open)
wikidb_1  | 2018-06-13T18:51:53.446+0000 I NETWORK  [conn1] received client metadata from 172.18.0.3:58510 conn1: { driver: { name: "nodejs", version: "2.2.31" }, os: { type: "Linux", name: "linux", architecture: "x64", version: "4.15.0-23-generic" }, platform: "Node.js v8.9.4, LE, mongodb-core: 2.1.15" }
wikidb_1  | 2018-06-13T18:51:53.464+0000 I NETWORK  [listener] connection accepted from 172.18.0.3:58512 #2 (2 connections now open)
wikidb_1  | 2018-06-13T18:51:53.471+0000 I NETWORK  [listener] connection accepted from 172.18.0.3:58514 #3 (3 connections now open)
wikidb_1  | 2018-06-13T18:51:53.473+0000 I NETWORK  [listener] connection accepted from 172.18.0.3:58516 #4 (4 connections now open)
wikidb_1  | 2018-06-13T18:51:53.606+0000 I COMMAND  [conn2] command wiki.users command: find { find: "users", filter: { email: "guest", provider: "local" }, projection: {}, limit: 1, singleBatch: true, batchSize: 1, $db: "wiki" } planSummary: IXSCAN { email: 1 } keysExamined:1 docsExamined:1 cursorExhausted:1 numYields:0 nreturned:1 reslen:318 locks:{ Global: { acquireCount: { r: 2 } }, Database: { acquireCount: {r: 1 } }, Collection: { acquireCount: { r: 1 } } } protocol:op_query 135ms
wikidb_1  | 2018-06-13T18:51:53.607+0000 I COMMAND  [conn3] command wiki.users command: find { find: "users", filter: { email: "guest", provider: "local" }, projection: {}, limit: 1, singleBatch: true, batchSize: 1, $db: "wiki" } planSummary: IXSCAN { email: 1 } keysExamined:1 docsExamined:1 cursorExhausted:1 numYields:0 nreturned:1 reslen:318 locks:{ Global: { acquireCount: { r: 2 } }, Database: { acquireCount: {r: 1 } }, Collection: { acquireCount: { r: 1 } } } protocol:op_query 133ms
wikidb_1  | 2018-06-13T18:51:53.652+0000 I COMMAND  [conn1] command wiki.system.indexes command: insert { insert: "system.indexes", ordered: true, $db: "wiki" } ninserted:0 exception: The field 'background' is not valid for an _id index specification. Specification: { v: 2, ns: "wiki.bruteforces", key: { _id: 1 }, name: "_id_1", background: true, unique: false } code:InvalidIndexSpecificationOption numYields:0 reslen:284 locks:{} protocol:op_query 178ms
wikidb_1  | 2018-06-13T18:51:54.958+0000 I NETWORK  [listener] connection accepted from 172.18.0.3:58518 #5 (5 connections now open)
wikidb_1  | 2018-06-13T18:51:55.007+0000 I NETWORK  [conn5] received client metadata from 172.18.0.3:58518 conn5: { driver: { name: "nodejs", version: "2.2.31" }, os: { type: "Linux", name: "linux", architecture: "x64", version: "4.15.0-23-generic" }, platform: "Node.js v8.9.4, LE, mongodb-core: 2.1.15" }
wikidb_1  | 2018-06-13T18:51:55.026+0000 I NETWORK  [listener] connection accepted from 172.18.0.3:58520 #6 (6 connections now open)
wikidb_1  | 2018-06-13T18:51:55.040+0000 I NETWORK  [listener] connection accepted from 172.18.0.3:58522 #7 (7 connections now open)
wikijs_1  | 2018-06-13 12:28:10,842 CRIT Supervisor running as root (no user in config file)
wikijs_1  | 2018-06-13 12:28:10,847 INFO RPC interface 'supervisor' initialized
wikijs_1  | 2018-06-13 12:28:10,847 CRIT Server 'unix_http_server' running without any HTTP authentication checking
wikijs_1  | 2018-06-13 12:28:10,848 INFO supervisord started with pid 1
wikijs_1  | 2018-06-13 12:28:11,851 INFO spawned: 'wikijs' with pid 9
wikijs_1  | 2018-06-13 12:28:12,899 INFO success: wikijs entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
wikijs_1  | 2018-06-13 12:28:13,991 INFO reaped unknown pid 43
wikijs_1  | 2018-06-13 12:29:24,774 WARN received SIGTERM indicating exit request
wikijs_1  | 2018-06-13 12:29:24,774 INFO waiting for wikijs to die
wikijs_1  | 2018-06-13 12:29:24,879 INFO reaped unknown pid 49
wikijs_1  | 2018-06-13 12:29:27,885 INFO waiting for wikijs to die
wikijs_1  | 2018-06-13 12:29:30,889 INFO waiting for wikijs to die
wikijs_1  | 2018-06-13 12:29:33,893 INFO waiting for wikijs to die
wikijs_1  | 2018-06-13 18:51:46,396 CRIT Supervisor running as root (no user in config file)
wikijs_1  | Unlinking stale socket /var/run/supervisor.sock
wikijs_1  | 2018-06-13 18:51:46,737 INFO RPC interface 'supervisor' initialized
wikijs_1  | 2018-06-13 18:51:46,737 CRIT Server 'unix_http_server' running without any HTTP authentication checking
wikijs_1  | 2018-06-13 18:51:46,738 INFO supervisord started with pid 1
wikijs_1  | 2018-06-13 18:51:47,741 INFO spawned: 'wikijs' with pid 9
wikijs_1  | 2018-06-13 18:51:48,742 INFO success: wikijs entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
wikijs_1  | 2018-06-13 18:51:55,327 INFO reaped unknown pid 42
`
NGPixel commented 6 years ago

You won't see any useful info in these logs, you must look in the /logs folder of the container.

joelft commented 6 years ago

@NGPixel Ahh ok. Thank you for pointing me in the right direction.

I viewed the logs and found a git error (typo on my part), which I fixed, but I'm still getting the same Problem. No new errors are being shown in /logs/wiki-stderr.log.

ERR_CONNECTION_RESET when trying to view my wiki.

joelft commented 6 years ago

Wow... I feel dumb. I did forward the ports correctly, but I had the wrong port in config.yml.

Sorry for this long issue for such a silly mistake. @NGPixel you did help me find the git error, though :)