Open stampirl opened 2 years ago
Role "misskey" does not exist.
This says the database user misskey
does not exist, so I think your configuration is probably incorrect. From my understanding you need to configure an existing database user and the respective password.
But I am not too familiar with the Docker installation method so I might be wrong.
That I do understand, but that should be done by docker bootstraping db with .config/docker.env
. Bleow it's content:
# db settings
POSTGRES_PASSWORD=****************
POSTGRES_USER=misskey
POSTGRES_DB=misskey
The same issue with dockerπ¦
Here is a related issue for typeorm that might help # 8885
A similar issue occurred even with the default with modified DB username and password in default.yml
and docker.env
.
# log
$ sudo docker compose run --rm web yarn run init
[sudo] password for voyage:
[+] Running 1/0
β Ώ Container misskey_db Running 0.0s
[+] Running 1/0
β Ώ Container misskey_redis Started 0.0s
yarn run v1.22.19
$ npm run migrate
> misskey@12.119.0 migrate
> cd packages/backend && npx typeorm migration:run -d ormconfig.js
[ioredis] Unhandled error event: Error: getaddrinfo ENOTFOUND redis
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26)
[ioredis] Unhandled error event: Error: getaddrinfo ENOTFOUND redis
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26)
Error during migration run:
error: password authentication failed for user "example-misskey-user"
at Parser.parseErrorMessage (/misskey/packages/backend/node_modules/pg-protocol/dist/parser.js:287:98)
at Parser.handlePacket (/misskey/packages/backend/node_modules/pg-protocol/dist/parser.js:126:29)
at Parser.parse (/misskey/packages/backend/node_modules/pg-protocol/dist/parser.js:39:38)
at Socket.<anonymous> (/misskey/packages/backend/node_modules/pg-protocol/dist/index.js:11:42)
at Socket.emit (node:events:527:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at Socket.Readable.push (node:internal/streams/readable:228:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
length: 116,
severity: 'FATAL',
code: '28P01',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'auth.c',
line: '330',
routine: 'auth_failed'
}
npm notice
npm notice New major version of npm available! 8.11.0 -> 9.1.3
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.1.3
npm notice Run npm install -g npm@9.1.3 to update!
npm notice
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The docker-compose.yml
file:
version: "3"
services:
web:
xxxxxx
redis:
xxxxxx
db:
restart: always
image: postgres:12.2-alpine
networks:
- internal_network
env_file:
- .config/docker.env
volumes:
- ./db:/var/lib/postgresql/data
networks:
The default.yml
file:
# ββββββββββββββββββββββββββββ
#ββββ PostgreSQL configuration βββββββββββββββββββββββββββββββββ
db:
host: db
port: 5432
# Database name
db: misskey
# Auth
user: example-misskey-user
pass: password
The docker.env
file:
# db settings
POSTGRES_PASSWORD=password
POSTGRES_USER=example-misskey-user
POSTGRES_DB=misskey
After further testing, I found the direct cause of the problem. It seems that all the changed items in docker.env
were ignored. I restore the value of POSTGRES_PASSWORD
in default.yml
to example-misskey-pass
and kept the value of pass
in docker.env
as password
, then its deployment worked usually.
The default.yml
file:
# ββββββββββββββββββββββββββββ
#ββββ PostgreSQL configuration βββββββββββββββββββββββββββββββββ
db:
host: db
port: 5432
# Database name
db: misskey
# Auth
user: example-misskey-user
pass: password
The docker.env
file:
# db settings
POSTGRES_PASSWORD=example-misskey-pass
POSTGRES_USER=example-misskey-user
POSTGRES_DB=misskey
Deployment worked successfully:
# log
$ sudo docker compose run --rm web yarn run init
[+] Running 2/2
β Ώ Container misskey_db Recreated 0.5s
β Ώ Container misskey_redis Running 0.0s
[+] Running 1/1
β Ώ Container misskey_db Started 0.9s
yarn run v1.22.19
$ npm run migrate
> misskey@12.119.0 migrate
> cd packages/backend && npx typeorm migration:run -d ormconfig.js
query: SELECT * FROM current_schema()
query: SELECT version();
query: SELECT * FROM "information_schema"."tables" WHERE "table_schema" = 'public' AND "table_name" = 'migrations'
query: SELECT * FROM "migrations" "migrations" ORDER BY "id" DESC
No migrations are pending
npm notice
npm notice New major version of npm available! 8.11.0 -> 9.1.3
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.1.3
npm notice Run npm install -g npm@9.1.3 to update!
npm notice
Done in 6.91s.
Similarly, I also tried to modify only POSTGRES_USER
or POSTGRES_DB
to a custom value in docker.env
, and keep values of user
and db
in default.yml
as default, and the deployment was successful as well. And if I change the value in default.yml
at the same time, an error text will be printed.
I have also considered that the path to the env file in the Compose file may be incorrectly filled. However, the issue still occurred after changing the path to the absolute path of docker.env
.
π‘ Summary
I'm trying to setup misskey on my server following docker-compose instructions in documentation. Process fails when running yarn run init
π₯° Expected Behavior
Successful init of misskey.
π€¬ Actual Behavior
I get "Error 1". Full output:
After running
docker-compose up
I can see in output:I changed both
.config/default.yml
and.config/docker.env
to use misskey as user and db name, but i looks like it's not used in actual db container.Misskey version: git master Your OS: Debian 11