Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self hosted not available #868

Open
Marthaarman opened this issue Oct 14, 2023 · 5 comments
Open

Self hosted not available #868

Marthaarman opened this issue Oct 14, 2023 · 5 comments

Comments

@Marthaarman
Copy link

I tried to setup standard notes according to: https://standardnotes.com/help/self-hosting/docker

When tailing the error logs I get:

==> logs/files.err <==
nc: bad address 'db'

==> logs/files-worker.err <==

==> logs/revisions.err <==

==> logs/revisions-worker.err <==

==> logs/syncing-server.err <==
nc: bad address 'db'

In the .env file I did set the port to 3307 and the same in the docker-compose.yml file for mysql.
I did so because I have another mysql running on port 3306 elsewhere.

Also, when checking http://device-ipv4-address-on-local-network:3000 I get nothing

Any suggestions?

Tailing the .log files says:
waiting for it to start on every file.

@moughxyz
Copy link
Member

What is the host machine specifications? Are you hosting on a NAS? Or just a regular OS/machine?

Potentially related: standardnotes/forum#3299

@RedBeardDotDev
Copy link

I don't know if it's the same issue, but I had renamed my containers in my docker-compose.yml, by prefixing the containers with standardnotes-, for example standardnotes-cache, standardnotes-db, etc.

I had forgotten to update the .env file so there was still an entry:
DB_HOST=db

Updating that to the below resolved the issue:
DB_HOST=standardnotes-db

@markusthiel
Copy link

I have the same problem and unfortunately, I'm not making any progress. I set up the Docker containers as per the documentation. The server is not accessible and the logs state:

==> logs/syncing-server.err <==

Error: read ECONNRESET
at TCP.onStreamRead (node:internal/stream_base_commons:217:20) {
errno: -104,
code: 'ECONNRESET',
syscall: 'read',
fatal: true
}

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

@markusthiel
Copy link

`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

`

@edmondsiu0
Copy link

@markusthiel looks like MySQL 8.4 deprecated --default-authentication-plugin=mysql_native_password

I was able to bring up the DB and clear the error by substituting that option with --mysql-native-password=ON

--- command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci
+++ command: --mysql-native-password=ON --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci

Relevant logs: syncing-server.err

/opt/server/.yarn/cache/mysql2-npm-3.3.3-d2fe8cf512-4bf7ace8f1.zip/node_modules/mysql2/lib/packets/packet.js:728
    const err = new Error(message);
                ^

Error: Plugin 'mysql_native_password' is not loaded
    at Packet.asError (/opt/server/.yarn/cache/mysql2-npm-3.3.3-d2fe8cf512-4bf7ace8f1.zip/node_modules/mysql2/lib/packets/packet.js:728:17)
    at ClientHandshake.execute (/opt/server/.yarn/cache/mysql2-npm-3.3.3-d2fe8cf512-4bf7ace8f1.zip/node_modules/mysql2/lib/commands/command.js:29:26)
    at PoolConnection.handlePacket (/opt/server/.yarn/cache/mysql2-npm-3.3.3-d2fe8cf512-4bf7ace8f1.zip/node_modules/mysql2/lib/connection.js:490:32)
    at PacketParser.onPacket (/opt/server/.yarn/cache/mysql2-npm-3.3.3-d2fe8cf512-4bf7ace8f1.zip/node_modules/mysql2/lib/connection.js:95:12)
    at PacketParser.executeStart (/opt/server/.yarn/cache/mysql2-npm-3.3.3-d2fe8cf512-4bf7ace8f1.zip/node_modules/mysql2/lib/packet_parser.js:75:16)
    at Socket.<anonymous> (/opt/server/.yarn/cache/mysql2-npm-3.3.3-d2fe8cf512-4bf7ace8f1.zip/node_modules/mysql2/lib/connection.js:102:25)
    at Socket.emit (node:events:514:28)
    at addChunk (node:internal/streams/readable:545:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:495:3)
    at Readable.push (node:internal/streams/readable:375:5) {
  code: 'ER_PLUGIN_IS_NOT_LOADED',
  errno: 1524,
  sqlState: 'HY000',
  sqlMessage: "Plugin 'mysql_native_password' is not loaded",
  sql: undefined
}

And the following log entries from the mysql:8 container:

standardnotes-db-1          | 2024-07-17T16:16:40.620707Z 0 [ERROR] [MY-000067] [Server] unknown variable 'default-authentication-plugin=mysql_native_password'.
standardnotes-db-1          | 2024-07-17T16:16:40.621734Z 0 [ERROR] [MY-010119] [Server] Aborting
standardnotes-db-1          | 2024-07-17T16:16:42.171266Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.1)  MySQL Community Server - GPL.
standardnotes-db-1          | 2024-07-17T16:16:42.171285Z 0 [System] [MY-015016] [Server] MySQL Server - end.
standardnotes-db-1 exited with code 1

Some googling led me to this issue.

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

No branches or pull requests

5 participants