standardnotes / forum

Support from other community members. For 1-on-1 help, please contact help@standardnotes.com.
https://forum.standardnotes.org
197 stars 9 forks source link

Unable to Fully Initialize Docker Resources on Synology NAS [Help Wanted] #3299

Open thedepartedwhiplash opened 11 months ago

thedepartedwhiplash commented 11 months ago

Describe the issue Hi, all. I'm trying to self-host Standard Notes on my Synology DS220+ NAS by following these instructions here: https://standardnotes.com/help/self-hosting/synology-nas.

I went through all the steps but was unable to access my server even after 30 minutes. I poked around and apparently the problem is that the db_self_hosted container is stopped and refuses to start. I tried to start it manually but it stops immediately. This seems to be reflected in the error logs as well, since I see "nc: bad address 'db'" a lot. All the other services seem to be working fine. Please see the screenshots below for reference. Any help on this will be much appreciated.

To Reproduce Steps to reproduce the behavior: N/A

Expected behavior All docker resources up and running?

Screenshots brave_S1wmI9r6U3 WindowsTerminal_hUZcjPtTf7

Desktop (please complete the following information):

Additional context N/A

mindovermiles262 commented 11 months ago

You'll need to post the logs from your db container in order to determine why it's not starting.

thedepartedwhiplash commented 11 months ago

You'll need to post the logs from your db container in order to determine why it's not starting.

Hi. This is the part of the docker-compose.yml file related to db. I didn't change anything and you can see it lists db_self_hosted as the container name:

db: image: mysql:8 container_name: db_self_hosted environment:

mindovermiles262 commented 11 months ago

post the logs from your db container

thedepartedwhiplash commented 11 months ago

@mindovermiles262 And from the container logs, this error seems to come up over and over again:

ls: cannot open directory '/docker-entrypoint-initdb.d/': permission denied

I didn't see any instructions related to this directory. Should I just create it if it doesn't exist or is it something that should have already been there?

thedepartedwhiplash commented 11 months ago

@mindovermiles262 Yeah, I tried creating that folder but the same error persists.

thedepartedwhiplash commented 11 months ago

This error seems to have come up a few times for people and I've tried some of their suggestions but no luck.

brave_QBvPC9ZOzW

markusthiel commented 4 months ago

Same here:

`root@dockerserver:/opt/docker/standardnotes# tail -f logs/*.log ==> logs/api-gateway.log <== localhost:3103 is unavailable yet - waiting for it to start localhost:3103 is unavailable yet - waiting for it to start localhost:3103 is unavailable yet - waiting for it to start localhost:3103 is unavailable yet - waiting for it to start localhost:3103 is unavailable yet - waiting for it to start localhost:3103 is unavailable yet - waiting for it to start localhost:3103 is unavailable yet - waiting for it to start localhost:3103 is unavailable yet - waiting for it to start localhost:3103 is unavailable yet - waiting for it to start localhost:3103 is unavailable yet - waiting for it to start

==> logs/auth-worker.log <== localhost:3103 is unavailable yet - waiting for it to start localhost:3103 is unavailable yet - waiting for it to start localhost:3103 is unavailable yet - waiting for it to start localhost:3103 is unavailable yet - waiting for it to start localhost:3103 is unavailable yet - waiting for it to start localhost:3103 is unavailable yet - waiting for it to start localhost:3103 is unavailable yet - waiting for it to start localhost:3103 is unavailable yet - waiting for it to start localhost:3103 is unavailable yet - waiting for it to start localhost:3103 is unavailable yet - waiting for it to start

==> logs/auth.log <== localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start

==> logs/files-worker.log <== localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start

==> logs/files.log <== db:3306 is unavailable yet - waiting for it to start db:3306 is up. Proceeding to startup. cache:6379 is up. Proceeding to startup. {"level":"info","message":"Server started on port 3104","service":"files:server"} db:3306 is unavailable yet - waiting for it to start db:3306 is unavailable yet - waiting for it to start db:3306 is unavailable yet - waiting for it to start db:3306 is up. Proceeding to startup. cache:6379 is up. Proceeding to startup. {"level":"info","message":"Server started on port 3104","service":"files:server"}

==> logs/revisions-worker.log <== localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start

==> logs/revisions.log <== localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start

==> logs/supervisord.log <== 2024-05-12 19:28:30,395 INFO success: revisions entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2024-05-12 19:28:30,395 INFO success: revisions-worker entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2024-05-12 19:28:30,395 INFO success: syncing-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2024-05-12 19:28:30,395 INFO success: syncing-server-worker entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2024-05-12 19:29:05,482 WARN exited: syncing-server (exit status 1; not expected) 2024-05-12 19:29:06,487 INFO spawned: 'syncing-server' with pid 137 2024-05-12 19:29:07,503 INFO success: syncing-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2024-05-12 19:29:12,842 WARN exited: syncing-server (exit status 1; not expected) 2024-05-12 19:29:13,846 INFO spawned: 'syncing-server' with pid 166 2024-05-12 19:29:14,859 INFO success: syncing-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

==> logs/syncing-server-worker.log <== localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start localhost:3101 is unavailable yet - waiting for it to start

==> logs/syncing-server.log <== db:3306 is unavailable yet - waiting for it to start db:3306 is unavailable yet - waiting for it to start db:3306 is unavailable yet - waiting for it to start db:3306 is unavailable yet - waiting for it to start db:3306 is unavailable yet - waiting for it to start db:3306 is unavailable yet - waiting for it to start db:3306 is unavailable yet - waiting for it to start db:3306 is unavailable yet - waiting for it to start db:3306 is unavailable yet - waiting for it to start db:3306 is unavailable yet - waiting for it to start db:3306 is unavailable yet - waiting for it to start

==> logs/auth.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/api-gateway.log <== localhost:3103 is unavailable yet - waiting for it to start

==> logs/auth-worker.log <== localhost:3103 is unavailable yet - waiting for it to start

==> logs/files-worker.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/revisions.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/revisions-worker.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/syncing-server-worker.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/auth.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/auth-worker.log <== localhost:3103 is unavailable yet - waiting for it to start

==> logs/api-gateway.log <== localhost:3103 is unavailable yet - waiting for it to start

==> logs/files-worker.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/revisions.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/revisions-worker.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/syncing-server-worker.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/syncing-server.log <== db:3306 is unavailable yet - waiting for it to start

==> logs/auth-worker.log <== localhost:3103 is unavailable yet - waiting for it to start

==> logs/api-gateway.log <== localhost:3103 is unavailable yet - waiting for it to start

==> logs/auth.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/files-worker.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/revisions-worker.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/revisions.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/syncing-server-worker.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/syncing-server.log <== db:3306 is unavailable yet - waiting for it to start

==> logs/auth-worker.log <== localhost:3103 is unavailable yet - waiting for it to start

==> logs/api-gateway.log <== localhost:3103 is unavailable yet - waiting for it to start

==> logs/auth.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/files-worker.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/revisions.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/revisions-worker.log <== localhost:3101 is unavailable yet - waiting for it to start

==> logs/syncing-server-worker.log <== localhost:3101 is unavailable yet - waiting for it to start

`

Error Log:

`db (172.19.0.2:3306) open cache (172.19.0.4:6379) open node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^

Error: getaddrinfo EAI_AGAIN db at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26) { errno: -3001, code: 'EAI_AGAIN', syscall: 'getaddrinfo', hostname: 'db', fatal: true }

Node.js v20.10.0 nc: bad address 'db' nc: bad address 'db' nc: bad address 'db' nc: bad address 'db' nc: bad address 'db' nc: bad address 'db' nc: bad address 'db' nc: bad address 'db' db (172.19.0.2:3306) open cache (172.19.0.4:6379) open node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^

Error: getaddrinfo EAI_AGAIN db at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26) { errno: -3001, code: 'EAI_AGAIN', syscall: 'getaddrinfo', hostname: 'db', fatal: true }

Node.js v20.10.0 nc: bad address 'db' nc: bad address 'db'`

apixandru commented 3 months ago

the db host is inaccessible, you need to post the db logs to figure out what's going on by running docker logs **your_db_container**

thedepartedwhiplash commented 3 months ago

Hi all. I decided to give this one more try, but unfortunately I'm still facing issues. One development is that I'm at least getting different errors this time, which might be good? The problem is with my db_self_hosted container again which keeps exiting and restarting. Here's an excerpt of the logs:

2024-05-25T20:01:17.718224Z 0 [ERROR] [MY-010119] [Server] Aborting 2024-05-25T20:01:19.616426Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.0) MySQL Community Server - GPL. 2024-05-25T20:01:19.616451Z 0 [System] [MY-015016] [Server] MySQL Server - end. 2024-05-25 20:01:25+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started. 2024-05-25 20:01:26+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' 2024-05-25 20:01:26+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started. '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock' 2024-05-25T20:01:26.424349Z 0 [System] [MY-015015] [Server] MySQL Server - start. 2024-05-25T20:01:26.679226Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.0) starting as process 1 2024-05-25T20:01:26.687933Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2024-05-25T20:01:29.344589Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. mysqld: Table 'mysql.plugin' doesn't exist 2024-05-25T20:01:31.031648Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure. 2024-05-25T20:01:31.032233Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2024-05-25T20:01:31.032602Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2024-05-25T20:01:31.032967Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2024-05-25T20:01:31.033472Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2024-05-25T20:01:31.033853Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2024-05-25T20:01:31.034237Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2024-05-25T20:01:31.034726Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2024-05-25T20:01:32.606607Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 2024-05-25T20:01:33.712479Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 2024-05-25T20:01:33.752502Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. 2024-05-25T20:01:33.752563Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel. 2024-05-25T20:01:33.792791Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory. 2024-05-25T20:01:33.793661Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2024-05-25T20:01:33.793938Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-001146 - Table 'mysql.component' doesn't exist 2024-05-25T20:01:33.794195Z 0 [Warning] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-003543 - The mysql.component table is missing or has an incorrect definition. 2024-05-25T20:01:33.794361Z 0 [ERROR] [MY-000067] [Server] unknown variable 'default-authentication-plugin=mysql_native_password'. 2024-05-25T20:01:33.795775Z 0 [ERROR] [MY-010119] [Server] Aborting 2024-05-25T20:01:35.756652Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.0) MySQL Community Server - GPL. 2024-05-25T20:01:35.756680Z 0 [System] [MY-015016] [Server] MySQL Server - end. 2024-05-25 20:01:41+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.

apixandru commented 3 months ago

it's the mysql update that broke the docker configuration.

I posted a solution here https://github.com/standardnotes/forum/issues/3593#issuecomment-2126779000

thedepartedwhiplash commented 3 months ago

This worked! Thank you so much!

it's the mysql update that broke the docker configuration.

I posted a solution here #3593 (comment)

apixandru commented 3 months ago

I'd keep the issue open so that the developers can update the docker-compose.yml file although I wouldn't hold my breath that they will do that anytime soon.

thedepartedwhiplash commented 3 months ago

I'd keep the issue open so that the developers can update the docker-compose.yml file although I wouldn't hold my breath that they will do that anytime soon.

Sure. Btw, I signed out to try and sign back in using the new custom sync server on my Desktop application. But it says invalid password. I know I'm using the right password because when I set custom sync server as "Default", I can log in just fine. Do I need to create a new account, or is this some issue with MFA?

Or, now that I think about it, do I need to manually create a new user in my DB for this to work?

apixandru commented 3 months ago

I'm not sure that this is related to the database issue. If you don't have any data saved, i'd delete the mysql folder again and reinitialize the whole thing (create the account again)

thedepartedwhiplash commented 3 months ago

Yeah, that makes sense. Thanks!