misskey icon indicating copy to clipboard operation
misskey copied to clipboard

docker fails to start misskey instance on ubuntu 18.04

Open yzhe819 opened this issue 2 years ago • 8 comments

💡 Summary

Warning Only visible for the Ubuntu 18.04.5 LTS

I'm trying to setup a Misskey instance on my Ubuntu machine by following the Create Misskey instance with Docker. But I get an error after visiting the Misskey site, APP_FETCH_FAILED error.

🥰 Expected Behavior

Launch Misskey successfully.

🤬 Actual Behavior

When I visit localhost:3000 after I finish building Misskey and initialize the database and start the service, the website shows an error status.

screenshot

图片

📝 Steps to Reproduce

  1. Starting from a virtual machine, create a virtual machine of Ubuntu 18.04.5 with the following steps. You can use lsb_release -a command to display the Ubuntu version.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:        18.04
Codename:       bionic
  1. Install the required git, docker and docker-compose.
$ docker --version
Docker version 20.10.17, build 100c701
$ docker-compose --version
Docker Compose version v2.6.1
  1. Use git to clone the Misskey repo
git clone -b master https://github.com/misskey-dev/misskey.git
cd misskey
git checkout master
  1. Update the config file. Also, update the localhost link in the db/redis section to db/redis respectively
cp .config/example.yml .config/default.yml
cp .config/docker_example.env .config/docker.env
  1. Just follow the guide documentation to build and init
sudo docker-compose build
sudo docker-compose run --rm web yarn run init
  1. Launch
sudo docker-compose up -d
  1. Open the browser and visit localhost:3000. APP_FETCH_FAILED error. And error details are not shown. (For screenshot see above.)

📌 Environment

Misskey version: 12.111.1 (commit 1bc856c4513e6bd53bf14b3f227733c7e297c3c9) Your OS: Ubuntu 18.04.5 LTS Your browser: FireFox

📌 Comment

I repeated the above steps on another virtual machine with Ubuntu 22.04 LTS. It can successfully create the instance and start the service. Not sure why this is happening with Ubuntu 18.04. 图片 I believe the docker and docker-compose versions are the same.

$ docker --version
Docker version 20.10.17, build 100c701
$ docker-compose --version
Docker Compose version v2.6.1

Also the Misskey version is the latest one. (commit 1bc856c4513e6bd53bf14b3f227733c7e297c3c9)

yzhe819 avatar Jun 26 '22 03:06 yzhe819

Maybe there is another component that Misskey is using that fails or has an incompatible version under Ubuntu 18. There is probably an error message about what went wrong in the server log as well, please check it.

Johann150 avatar Jun 26 '22 07:06 Johann150

Thanks for your reply. I am running docker in Ubuntu 18 and what I need to do for checking the server log. Just confused about what I need to do.

yzhe819 avatar Jun 26 '22 07:06 yzhe819

Sorry I am not familiar with docker, but I think there should be a way to see standard output from the container? If you start the container and try to load the client again you should hopefully see some output there.

Johann150 avatar Jun 26 '22 08:06 Johann150

I use docker log to check the output of different container. I use sudo docker-compose up and Ctrl+c to stop all the containers first. Then use sudo docker-compose up -d to launch the service.

We have three container, one for database (misskey-db-1), one for redis (misskey-redis-1) and one for the web service (misskey-web-1). The following are the output:

  • misskey-db-1
yzhe819@yzhe819:~/misskey$ sudo docker logs misskey-db-1
2022-06-26 08:47:47.861 UTC [1] LOG:  starting PostgreSQL 12.2 on x86_64-pc-linux-musl, compiled by gcc (Alpine 9.2.0) 9.2.0, 64-bit
2022-06-26 08:47:47.862 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2022-06-26 08:47:47.862 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2022-06-26 08:47:47.870 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"

PostgreSQL Database directory appears to contain a database; Skipping initialization

2022-06-26 08:47:47.894 UTC [20] LOG:  database system was shut down at 2022-06-26 08:47:44 UTC
2022-06-26 08:47:48.006 UTC [1] LOG:  database system is ready to accept connections
2022-06-26 08:53:33.615 UTC [1] LOG:  received smart shutdown request
2022-06-26 08:53:33.619 UTC [1] LOG:  background worker "logical replication launcher" (PID 26) exited with exit code 1
2022-06-26 08:53:33.620 UTC [21] LOG:  shutting down
2022-06-26 08:53:33.639 UTC [1] LOG:  database system is shut down

PostgreSQL Database directory appears to contain a database; Skipping initialization

2022-06-26 08:53:44.027 UTC [1] LOG:  starting PostgreSQL 12.2 on x86_64-pc-linux-musl, compiled by gcc (Alpine 9.2.0) 9.2.0, 64-bit
2022-06-26 08:53:44.028 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2022-06-26 08:53:44.028 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2022-06-26 08:53:44.034 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-06-26 08:53:44.058 UTC [20] LOG:  database system was shut down at 2022-06-26 08:53:33 UTC
2022-06-26 08:53:44.063 UTC [1] LOG:  database system is ready to accept connections
2022-06-26 09:15:06.075 UTC [1] LOG:  received smart shutdown request
2022-06-26 09:15:06.083 UTC [1] LOG:  background worker "logical replication launcher" (PID 26) exited with exit code 1
2022-06-26 09:15:06.084 UTC [21] LOG:  shutting down
2022-06-26 09:15:06.113 UTC [1] LOG:  database system is shut down

PostgreSQL Database directory appears to contain a database; Skipping initialization

2022-06-26 09:15:28.509 UTC [1] LOG:  starting PostgreSQL 12.2 on x86_64-pc-linux-musl, compiled by gcc (Alpine 9.2.0) 9.2.0, 64-bit
2022-06-26 09:15:28.509 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2022-06-26 09:15:28.509 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2022-06-26 09:15:28.520 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-06-26 09:15:28.565 UTC [20] LOG:  database system was shut down at 2022-06-26 09:15:06 UTC
2022-06-26 09:15:28.574 UTC [1] LOG:  database system is ready to accept connections
  • misskey-redis-1
yzhe819@yzhe819:~/misskey$ sudo docker logs misskey-redis-1
1:C 26 Jun 08:47:46.805 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 26 Jun 08:47:46.805 # Redis version=4.0.14, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 26 Jun 08:47:46.805 # 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 26 Jun 08:47:46.808 * Running mode=standalone, port=6379.
1:M 26 Jun 08:47:46.808 # Server initialized
1:M 26 Jun 08:47:46.808 # 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 26 Jun 08:47:46.808 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
1:M 26 Jun 08:47:46.808 * DB loaded from disk: 0.000 seconds
1:M 26 Jun 08:47:46.808 * Ready to accept connections
1:signal-handler (1656233613) Received SIGTERM scheduling shutdown...
1:M 26 Jun 08:53:33.707 # User requested shutdown...
1:M 26 Jun 08:53:33.707 * Saving the final RDB snapshot before exiting.
1:M 26 Jun 08:53:33.712 * DB saved on disk
1:M 26 Jun 08:53:33.712 # Redis is now ready to exit, bye bye...
1:C 26 Jun 08:53:44.960 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 26 Jun 08:53:44.962 # Redis version=4.0.14, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 26 Jun 08:53:44.962 # 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 26 Jun 08:53:44.963 * Running mode=standalone, port=6379.
1:M 26 Jun 08:53:44.963 # Server initialized
1:M 26 Jun 08:53:44.963 # 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 26 Jun 08:53:44.963 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
1:M 26 Jun 08:53:44.963 * DB loaded from disk: 0.000 seconds
1:M 26 Jun 08:53:44.963 * Ready to accept connections
1:M 26 Jun 09:14:19.701 * 100 changes in 300 seconds. Saving...
1:M 26 Jun 09:14:19.701 * Background saving started by pid 12
12:C 26 Jun 09:14:19.725 * DB saved on disk
12:C 26 Jun 09:14:19.725 * RDB: 0 MB of memory used by copy-on-write
1:M 26 Jun 09:14:19.802 * Background saving terminated with success
1:signal-handler (1656234905) Received SIGTERM scheduling shutdown...
1:M 26 Jun 09:15:06.008 # User requested shutdown...
1:M 26 Jun 09:15:06.008 * Saving the final RDB snapshot before exiting.
1:M 26 Jun 09:15:06.017 * DB saved on disk
1:M 26 Jun 09:15:06.017 # Redis is now ready to exit, bye bye...
1:C 26 Jun 09:15:27.331 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 26 Jun 09:15:27.331 # Redis version=4.0.14, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 26 Jun 09:15:27.331 # 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 26 Jun 09:15:27.336 * Running mode=standalone, port=6379.
1:M 26 Jun 09:15:27.336 # Server initialized
1:M 26 Jun 09:15:27.336 # 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 26 Jun 09:15:27.336 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
1:M 26 Jun 09:15:27.336 * DB loaded from disk: 0.000 seconds
1:M 26 Jun 09:15:27.336 * Ready to accept connections
  • misskey-web-1
> [email protected] migrateandstart
> npm run migrate && npm run start


> [email protected] migrate
> cd packages/backend && npx typeorm migration:run -d ormconfig.js

query: SELECT * FROM current_schema()
query: SHOW server_version;
query: SELECT * FROM "information_schema"."tables" WHERE "table_schema" = 'public' AND "table_name" = 'migrations'
query: SELECT * FROM "information_schema"."tables" WHERE "table_schema" = 'public' AND "table_name" = 'typeorm_metadata'
query: SELECT * FROM "migrations" "migrations" ORDER BY "id" DESC
No migrations are pending

> [email protected] start
> cd packages/backend && node --experimental-json-modules ./built/index.js

  _____ _         _           
 |     |_|___ ___| |_ ___ _ _ 
 | | | | |_ -|_ -| '_| -_| | |
 |_|_|_|_|___|___|_,_|___|_  |
 v12.111.1               |___|

 Misskey is an open-source decentralized microblogging platform.
 If you like Misskey, please donate to support development. https://www.patreon.com/syuilo

--- 45b3952a8093 (PID: 61) ---
INFO *	[core boot]	Welcome to Misskey!
INFO *	[core boot]	Misskey v12.111.1
INFO *	[core boot env]	NODE_ENV: production
INFO *	[core boot nodejs]	Version v18.0.0 detected.
DONE *	[core boot config]	Loaded
INFO *	[core boot db]	Connecting...
DONE *	[core boot db]	Connected: v12.2
DONE *	[core boot]	Misskey initialized
INFO *	[core boot]	Starting 1 worker...
(node:72) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
DONE *	[core boot]	All workers started
DONE *	[core boot]	Now listening on port 3000 on https://example.tld
(node:72) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time

Hope it helps

yzhe819 avatar Jun 26 '22 09:06 yzhe819

Hey @Johann150 can you reproduce this issue? Please feel free to let me know when you have time to handle this issue.💖

yzhe819 avatar Jun 29 '22 09:06 yzhe819

The logs do not show anything abnormal as far as I can see.

As I explained above I am not familiar with and do not use Docker, so I do not think I can not help you here, perhaps another maintainer can help you. Maybe @tamaina knows...

Johann150 avatar Jun 29 '22 16:06 Johann150

Following this conversation because I am getting the same error

"ERROR CODE: APP_FETCH_FAILED"

For me, though, my instance has been running just fine up until this week. I tried upgrading misskey, and apt upgrade'ing, and rebooting. No luck. I did find that my firewall was blocking access to cypress.io and fixed that. The upgrade seemed to go well, but I am still getting that error and my logs don't help much:

https://paste.fyrfli.info/?20dc4f78944ebe1a#EzpLgVj4eR344LWzq1Bgr4irx21qwSBUnDMP4QuB6HCn

fyrfli avatar Jun 30 '22 21:06 fyrfli

私はdockerに明るくないです、私は普段dockerを使っていません

tamaina avatar Jul 01 '22 06:07 tamaina

If this happens with the latest Misskey, please Reopen it.

tamaina avatar Sep 22 '22 12:09 tamaina