Open Bizzaro opened 1 year ago
Redis logs
e effect.
1:M 20 Oct 2022 02:06:23.010 * Loading RDB produced by version 6.0.16
1:M 20 Oct 2022 02:06:23.010 * RDB age 13120 seconds
1:M 20 Oct 2022 02:06:23.010 * RDB memory usage when created 0.94 Mb
1:M 20 Oct 2022 02:06:23.010 * DB loaded from disk: 0.001 seconds
1:M 20 Oct 2022 02:06:23.011 * Ready to accept connections
1:C 20 Oct 2022 02:08:40.717 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 20 Oct 2022 02:08:40.717 # Redis version=6.0.16, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 20 Oct 2022 02:08:40.717 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 20 Oct 2022 02:08:40.720 * Running mode=standalone, port=6379.
1:M 20 Oct 2022 02:08:40.720 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 20 Oct 2022 02:08:40.720 # Server initialized
1:M 20 Oct 2022 02:08:40.720 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 20 Oct 2022 02:08:40.722 * Loading RDB produced by version 6.0.16
1:M 20 Oct 2022 02:08:40.722 * RDB age 13257 seconds
1:M 20 Oct 2022 02:08:40.722 * RDB memory usage when created 0.94 Mb
1:M 20 Oct 2022 02:08:40.723 * DB loaded from disk: 0.002 seconds
1:M 20 Oct 2022 02:08:40.723 * Ready to accept connections
mysql logs
Version: '5.6.51' socket: '/var/run/mysqld/mysqld.sock' port: 3307 MySQL Community Server (GPL)
2022-10-20 02:08:39+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.6.51-1debian9 started.
2022-10-20 02:08:39+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-10-20 02:08:39+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.6.51-1debian9 started.
2022-10-20 02:08:40 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2022-10-20 02:08:40 0 [Note] mysqld (mysqld 5.6.51) starting as process 1 ...
2022-10-20 02:08:40 1 [Note] Plugin 'FEDERATED' is disabled.
2022-10-20 02:08:40 1 [Note] InnoDB: Using atomics to ref count buffer pool pages
2022-10-20 02:08:40 1 [Note] InnoDB: The InnoDB memory heap is disabled
2022-10-20 02:08:40 1 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2022-10-20 02:08:40 1 [Note] InnoDB: Memory barrier is not used
2022-10-20 02:08:40 1 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-10-20 02:08:40 1 [Note] InnoDB: Using Linux native AIO
2022-10-20 02:08:40 1 [Note] InnoDB: Using CPU crc32 instructions
2022-10-20 02:08:40 1 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2022-10-20 02:08:40 1 [Note] InnoDB: Completed initialization of buffer pool
2022-10-20 02:08:40 1 [Note] InnoDB: Highest supported file format is Barracuda.
2022-10-20 02:08:40 1 [Note] InnoDB: The log sequence numbers 136248766 and 136248766 in ibdata files do not match the log sequence number 164286418 in the ib_logfiles!
2022-10-20 02:08:40 1 [Note] InnoDB: Database was not shutdown normally!
2022-10-20 02:08:40 1 [Note] InnoDB: Starting crash recovery.
2022-10-20 02:08:40 1 [Note] InnoDB: Reading tablespace information from the .ibd files...
2022-10-20 02:08:40 1 [Note] InnoDB: Restoring possible half-written data pages
2022-10-20 02:08:40 1 [Note] InnoDB: from the doublewrite buffer...
2022-10-20 02:08:40 1 [Note] InnoDB: 128 rollback segment(s) are active.
2022-10-20 02:08:40 1 [Note] InnoDB: Waiting for purge to start
2022-10-20 02:08:40 1 [Note] InnoDB: 5.6.51 started; log sequence number 164286418
2022-10-20 02:08:40 1 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2022-10-20 02:08:40 1 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2022-10-20 02:08:40 1 [Note] Server hostname (bind-address): '*'; port: 3307
2022-10-20 02:08:40 1 [Note] IPv6 is available.
2022-10-20 02:08:40 1 [Note] - '::' resolves to '::';
2022-10-20 02:08:40 1 [Note] Server socket created on IP: '::'.
2022-10-20 02:08:40 1 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2022-10-20 02:08:40 1 [Warning] 'proxies_priv' entry '@ root@436ad50cf1cf' ignored in --skip-name-resolve mode.
2022-10-20 02:08:40 1 [Note] Event Scheduler: Loaded 0 events
2022-10-20 02:08:40 1 [Note] mysqld: ready for connections.
Version: '5.6.51' socket: '/var/run/mysqld/mysqld.sock' port: 3307 MySQL Community Server (GPL)
fyi... I have a workaround that involves using specific old docker images. The error occurs when everything uses the latest version.
docker-compose.yml
version: '3.8'
services:
syncing-server-js:
image: standardnotes/syncing-server-js:5979b9939843e1948b940fdc291133fd89fa756a
container_name: syncing-server-js-standalone
depends_on:
- db
- cache
entrypoint: [
"./packages/syncing-server/wait-for.sh", "db", "3307",
"./packages/syncing-server/wait-for.sh", "cache", "6379",
"./packages/syncing-server/docker/entrypoint.sh", "start-web"
]
env_file: .env
environment:
PORT: 3000
restart: unless-stopped
networks:
- standardnotes_standalone
syncing-server-js-worker:
image: standardnotes/syncing-server-js:5979b9939843e1948b940fdc291133fd89fa756a
container_name: syncing-server-js-worker-standalone
depends_on:
- db
- cache
- syncing-server-js
entrypoint: [
"./packages/syncing-server/wait-for.sh", "db", "3307",
"./packages/syncing-server/wait-for.sh", "cache", "6379",
"./packages/syncing-server/wait-for.sh", "syncing-server-js", "3000",
"./packages/syncing-server/docker/entrypoint.sh", "start-worker"
]
env_file: .env
environment:
PORT: 3000
restart: unless-stopped
networks:
- standardnotes_standalone
api-gateway:
image: standardnotes/api-gateway:5979b9939843e1948b940fdc291133fd89fa756a
container_name: api-gateway-standalone
depends_on:
- auth
- syncing-server-js
env_file: docker/api-gateway.env
ports:
- ${EXPOSED_PORT}:3000
environment:
PORT: 3000
AUTH_JWT_SECRET: '${AUTH_JWT_SECRET}'
REDIS_URL: '${REDIS_URL}'
FILES_SERVER_URL: '${FILES_SERVER_URL}'
entrypoint: [
"./packages/api-gateway/wait-for.sh", "auth", "3000",
"./packages/api-gateway/wait-for.sh", "syncing-server-js", "3000",
"./packages/api-gateway/wait-for.sh", "files", "3000",
"./packages/api-gateway/docker/entrypoint.sh", "start-web"
]
restart: unless-stopped
networks:
- standardnotes_standalone
auth:
image: standardnotes/auth:5979b9939843e1948b940fdc291133fd89fa756a
container_name: auth-standalone
depends_on:
- db
- cache
- syncing-server-js
entrypoint: [
"./packages/auth/wait-for.sh", "db", "3307",
"./packages/auth/wait-for.sh", "cache", "6379",
"./packages/auth/wait-for.sh", "syncing-server-js", "3000",
"./packages/auth/docker/entrypoint.sh", "start-web"
]
env_file: docker/auth.env
environment:
PORT: 3000
DB_HOST: '${DB_HOST}'
DB_REPLICA_HOST: '${DB_REPLICA_HOST}'
DB_PORT: '${DB_PORT}'
DB_DATABASE: '${DB_DATABASE}'
DB_USERNAME: '${DB_USERNAME}'
DB_PASSWORD: '${DB_PASSWORD}'
DB_DEBUG_LEVEL: '${DB_DEBUG_LEVEL}'
DB_MIGRATIONS_PATH: '${DB_MIGRATIONS_PATH}'
REDIS_URL: '${REDIS_URL}'
AUTH_JWT_SECRET: '${AUTH_JWT_SECRET}'
VALET_TOKEN_SECRET: '${VALET_TOKEN_SECRET}'
restart: unless-stopped
networks:
- standardnotes_standalone
auth-worker:
image: standardnotes/auth:5979b9939843e1948b940fdc291133fd89fa756a
container_name: auth-worker-standalone
depends_on:
- db
- cache
- auth
entrypoint: [
"./packages/auth/wait-for.sh", "db", "3307",
"./packages/auth/wait-for.sh", "cache", "6379",
"./packages/auth/wait-for.sh", "auth", "3000",
"./packages/auth/docker/entrypoint.sh", "start-worker"
]
env_file: docker/auth.env
environment:
PORT: 3000
DB_HOST: '${DB_HOST}'
DB_REPLICA_HOST: '${DB_REPLICA_HOST}'
DB_PORT: '${DB_PORT}'
DB_DATABASE: '${DB_DATABASE}'
DB_USERNAME: '${DB_USERNAME}'
DB_PASSWORD: '${DB_PASSWORD}'
DB_DEBUG_LEVEL: '${DB_DEBUG_LEVEL}'
DB_MIGRATIONS_PATH: '${DB_MIGRATIONS_PATH}'
REDIS_URL: '${REDIS_URL}'
AUTH_JWT_SECRET: '${AUTH_JWT_SECRET}'
VALET_TOKEN_SECRET: '${VALET_TOKEN_SECRET}'
restart: unless-stopped
networks:
- standardnotes_standalone
files:
image: standardnotes/files:5979b9939843e1948b940fdc291133fd89fa756a
container_name: files-standalone
entrypoint: [
"./packages/files/wait-for.sh", "db", "3307",
"./packages/files/wait-for.sh", "cache", "6379",
"./packages/files/docker/entrypoint.sh", "start-web"
]
ports:
- ${EXPOSED_FILES_PORT}:3000
env_file: docker/files.env
environment:
FILE_UPLOAD_PATH: '${FILE_UPLOAD_PATH}'
VALET_TOKEN_SECRET: '${VALET_TOKEN_SECRET}'
volumes:
- ./${FILE_UPLOAD_PATH}:/var/www/${FILE_UPLOAD_PATH}
restart: unless-stopped
networks:
- standardnotes_standalone
db:
image: mysql:5.6
container_name: db-standalone
environment:
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_TCP_PORT: 3307
expose:
- 3307
restart: unless-stopped
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8 --collation-server=utf8_general_ci
volumes:
- ./data/mysql:/var/lib/mysql
- ./data/import:/docker-entrypoint-initdb.d
networks:
- standardnotes_standalone
cache:
image: redis:6.0-alpine
container_name: cache-standalone
volumes:
- ./data/redis/:/data
expose:
- 6379
restart: unless-stopped
networks:
- standardnotes_standalone
workspace:
image: standardnotes/workspace:9cf746f6afcd01ea5726f7cf0e7430951cf290db
container_name: workspace-standalone
depends_on:
- db
- cache
- auth
entrypoint: [
"./packages/workspace/wait-for.sh", "db", "3307",
"./packages/workspace/wait-for.sh", "cache", "6379",
"./packages/workspace/wait-for.sh", "auth", "3000",
"./packages/workspace/docker/entrypoint.sh", "start-web"
]
env_file: docker/workspace.env
environment:
PORT: 3000
DB_HOST: '${DB_HOST}'
DB_REPLICA_HOST: '${DB_REPLICA_HOST}'
DB_PORT: '${DB_PORT}'
DB_DATABASE: '${DB_DATABASE}'
DB_USERNAME: '${DB_USERNAME}'
DB_PASSWORD: '${DB_PASSWORD}'
DB_DEBUG_LEVEL: '${DB_DEBUG_LEVEL}'
DB_MIGRATIONS_PATH: '${DB_MIGRATIONS_PATH}'
REDIS_URL: '${REDIS_URL}'
AUTH_JWT_SECRET: '${AUTH_JWT_SECRET}'
restart: unless-stopped
networks:
- standardnotes_standalone
workspace-worker:
image: standardnotes/workspace:9cf746f6afcd01ea5726f7cf0e7430951cf290db
container_name: workspace-worker-standalone
depends_on:
- db
- cache
- workspace
entrypoint: [
"./packages/workspace/wait-for.sh", "db", "3307",
"./packages/workspace/wait-for.sh", "cache", "6379",
"./packages/workspace/wait-for.sh", "workspace", "3000",
"./packages/workspace/docker/entrypoint.sh", "start-worker"
]
env_file: docker/workspace.env
environment:
PORT: 3000
DB_HOST: '${DB_HOST}'
DB_REPLICA_HOST: '${DB_REPLICA_HOST}'
DB_PORT: '${DB_PORT}'
DB_DATABASE: '${DB_DATABASE}'
DB_USERNAME: '${DB_USERNAME}'
DB_PASSWORD: '${DB_PASSWORD}'
DB_DEBUG_LEVEL: '${DB_DEBUG_LEVEL}'
DB_MIGRATIONS_PATH: '${DB_MIGRATIONS_PATH}'
REDIS_URL: '${REDIS_URL}'
AUTH_JWT_SECRET: '${AUTH_JWT_SECRET}'
restart: unless-stopped
networks:
- standardnotes_standalone
networks:
standardnotes_standalone:
name: standardnotes_standalone
It looks like something related to proxy stuff or self-signed certificates stuff in the network
Should be fixed with the latest version - can you check ?
Why was the workspaces container and its env.sample file removed?
Pulling changes from Git.
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 6 (delta 5), reused 6 (delta 5), pack-reused 0
Unpacking objects: 100% (6/6), 1.02 KiB | 80.00 KiB/s, done.
From https://github.com/standardnotes/standalone
* branch main -> FETCH_HEAD
13c5de2..65caaf7 main -> origin/main
Updating 13c5de2..65caaf7
Fast-forward
.gitignore | 1 -
docker-compose.yml | 60 ------------------------------------------------------------
docker/workspace.env.sample | 10 ----------
server.sh | 6 ------
4 files changed, 77 deletions(-)
delete mode 100644 docker/workspace.env.sample
Checking for env file changes
wc: docker/workspace.env.sample: No such file or directory
./server.sh: 48: [: Illegal number:
Downloading latest images of Standard Notes services.
[+] Running 28/28
⠿ auth-worker Skipped - Image is already being pulled by auth 0.0s
⠿ syncing-server-js Skipped - Image is already being pulled by syncing-server-js-worker 0.0s
⠿ cache Pulled 1.2s
⠿ syncing-server-js-worker Pulled 10.5s
⠿ 2ecf7cf5378b Pull complete 4.4s
⠿ 190b9d3761aa Pull complete 4.4s
⠿ 9274e5e8e9a6 Pull complete 4.5s
⠿ fe24a52d5e5a Pull complete 8.6s
⠿ files Pulled 10.6s
⠿ ca7dd9ec2225 Already exists 0.0s
⠿ 55371e6747e8 Already exists 0.0s
⠿ 694d6b1b2d1b Already exists 0.0s
⠿ fda52be0ff10 Pull complete 3.5s
⠿ c61cfdff0281 Pull complete 3.7s
⠿ ae50691c3287 Pull complete 4.2s
⠿ c4d5e06fcfe4 Pull complete 8.7s
⠿ auth Pulled 7.2s
⠿ 7a5210542a82 Pull complete 2.4s
⠿ 4721ced327c2 Pull complete 2.4s
⠿ e5bb0617a8e2 Pull complete 2.6s
⠿ 6cf45e525cf9 Pull complete 5.3s
⠿ db Pulled 1.2s
⠿ api-gateway Pulled 6.2s
⠿ 71f41f5ff77d Already exists 0.0s
⠿ dc911cc722e0 Pull complete 2.3s
⠿ 2a72523ff1f0 Pull complete 2.4s
⠿ 244fd66810f6 Pull complete 2.5s
⠿ 413782ded073 Pull complete 4.3s
Images up to date. Starting all services.
WARN[0000] Found orphan containers ([workspace-worker-standalone workspace-standalone]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
[+] Running 8/8
⠿ Container files-standalone Started 1.4s
⠿ Container cache-standalone Started 1.5s
⠿ Container db-standalone Started 1.6s
⠿ Container syncing-server-js-standalone Started 2.0s
⠿ Container auth-standalone Started 3.6s
⠿ Container syncing-server-js-worker-standalone Started 3.8s
⠿ Container auth-worker-standalone Started 5.5s
⠿ Container api-gateway-standalone Started
Why was the workspaces container and its env.sample file removed?
We are putting the workspaces project on the back burner for now
I tried to update to :latest
and still had problems starting my containers.
# journalctl -f -u snotes-server-js
Dec 01 17:20:08 dockerhost docker[623783]: Internal Error: Error when performing the request
Dec 01 17:20:08 dockerhost docker[623783]: at ClientRequest.<anonymous> (/usr/local/lib/node_modules/corepack/dist/corepack.js:3937:20)
Dec 01 17:20:08 dockerhost docker[623783]: at ClientRequest.emit (node:events:527:28)
Dec 01 17:20:08 dockerhost docker[623783]: at TLSSocket.socketErrorListener (node:_http_client:454:9)
Dec 01 17:20:08 dockerhost docker[623783]: at TLSSocket.emit (node:events:527:28)
Dec 01 17:20:08 dockerhost docker[623783]: at emitErrorNT (node:internal/streams/destroy:157:8)
Dec 01 17:20:08 dockerhost docker[623783]: at emitErrorCloseNT (node:internal/streams/destroy:122:3)
Dec 01 17:20:08 dockerhost docker[623783]: at processTicksAndRejections (node:internal/process/task_queues:83:21)
Dec 01 17:20:09 dockerhost systemd[1]: snotes-server-js.service: Main process exited, code=exited, status=1/FAILURE
@917huB try putting to log level to debug in env vars of syncing server container - maybe there'll be some more context
sorry @karolsojko , no additional items were logged.
Dec 02 17:04:20 dockerhost systemd[1]: Stopping docker for standardnotes-js server worker...
Dec 02 17:04:20 dockerhost docker[2639533]: Starting Web...
Dec 02 17:04:21 dockerhost docker[2639533]: Internal Error: Error when performing the request
Dec 02 17:04:21 dockerhost docker[2639533]: at ClientRequest.<anonymous> (/usr/local/lib/node_modules/corepack/dist/corepack.js:3937:20)
Dec 02 17:04:21 dockerhost docker[2639533]: at ClientRequest.emit (node:events:527:28)
Dec 02 17:04:21 dockerhost docker[2639533]: at TLSSocket.socketErrorListener (node:_http_client:454:9)
Dec 02 17:04:21 dockerhost docker[2639533]: at TLSSocket.emit (node:events:527:28)
Dec 02 17:04:21 dockerhost docker[2639533]: at emitErrorNT (node:internal/streams/destroy:157:8)
Dec 02 17:04:21 dockerhost docker[2639533]: at emitErrorCloseNT (node:internal/streams/destroy:122:3)
Dec 02 17:04:21 dockerhost docker[2639533]: at processTicksAndRejections (node:internal/process/task_queues:83:21)
Dec 02 17:04:21 dockerhost docker[2640201]: snotes-server-js-worker
Dec 02 17:04:21 dockerhost systemd[1]: snotes-server-js-worker.service: Main process exited, code=exited, status=1/FAILURE
Dec 02 17:04:21 dockerhost systemd[1]: snotes-server-js-worker.service: Failed with result 'exit-code'.
Dec 02 17:04:21 dockerhost systemd[1]: Stopped docker for standardnotes-js server worker.
I just ran into the same problem with the current :latest tag. In my case, the API-Gateway threw a nearly identical error.
Starting Web...
Internal Error: Error when performing the request
at ClientRequest.<anonymous> (/usr/local/lib/node_modules/corepack/dist/corepack.js:16064:20)
at ClientRequest.emit (node:events:513:28)
at TLSSocket.socketErrorListener (node:_http_client:494:9)
at TLSSocket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
There is no additional information when changing logging to debug.
Changing back to previous versions also didn't help.
The service started again after setting an explicit DNS (remote or local):
dns:
- 1.1.1.1
I thinks it is definitely a network related (dns/proxy/vpn/self-signed cert/DPI) issue.
Here's a method for checking steps:
docker run --rm -it --entrypoint=/bin/sh standardnotes/api-gateway
sed -i '/Error when performing the request/c reject(err);' /usr/local/lib/node_modules/corepack/dist/corepack.js
to show more detailed error ../packages/api-gateway/docker/entrypoint.sh start-web
to observe what really happens.it will show more detailed error like
Internal Error: getaddrinfo EAI_AGAIN repo.yarnpkg.com
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26)
(when i spwan container with --network=none)
The probable root cause is that when container starts , corepack wants to download missing yarn
from internet . So if your docker or network env do not have access to internet , corepack will fail.
So i recommend @karolsojko to update all server's Dockerfile adding corepack yarn
(why not using corepack prepare
ref : https://github.com/nodejs/corepack/issues/96) after corepack enable
to pre-download yarn
in the docker image for those who host standardnotes in the intranet/lan.
And for selfhosters who has no internet access, after developers update all docker image to contains yarn , set enviornment COREPACK_ENABLE_NETWORK=0
in docker-compose to avoid furture fail (like corepack want update yarn etc ...) .
Service Versions (please complete the following information): Paste the output of
./server.sh version
. For example:Describe the bug A clear and concise description of what the bug is. Unable to start the server, the script fails to start
files-standalone
andworkplace-standalone
To Reproduce Steps to reproduce the behavior:
sudo ./server.sh start
Expected behavior The server to start
Logs If applicable, add logs to help debug your problem.
Additional context I upgraded, resolved some merge conflicts and here we are.
workspace-standalone
andfiles-standalone
keep crashing with a generic error message, even with the log level set to debug in the config files.auth.env
api-gateway.env
files.env
workspace.env
.env
docker-compose.yml