AFFiNE icon indicating copy to clipboard operation
AFFiNE copied to clipboard

new instance not starting (​database "affine" does not exist)

Open DEAD1SIDE opened this issue 9 months ago • 1 comments

What happened?

When starting up a new instance of affine via Docker the container restarts over and over again because the database affine is not there.

Distribution version

Linux

What browsers are you seeing the problem on if you're using web version?

Chrome

Are you self-hosting?

  • [X] Yes

Relevant log output

Postgres:
2024-05-10T10:35:44.455313167Z 2024-05-10 10:35:44.455 UTC [2109] FATAL:  database "affine" does not exist

Affine:

2024-05-10T10:35:53.953697118Z Node.js v20.13.1
2024-05-10T10:37:05.674564301Z running predeploy script.
2024-05-10T10:37:05.817524018Z yarn run v1.22.19
2024-05-10T10:37:05.834960500Z $ yarn prisma migrate deploy && node --import ./scripts/register.js ./dist/data/index.js run
2024-05-10T10:37:05.971224780Z $ /app/node_modules/.bin/prisma migrate deploy
2024-05-10T10:37:06.693651180Z Prisma schema loaded from schema.prisma
2024-05-10T10:37:06.697578430Z Datasource "db": PostgreSQL database "affine", schema "public" at "postgres:5432"
2024-05-10T10:37:06.719590958Z 
2024-05-10T10:37:06.719960350Z Error: P1010: User `affine` was denied access on the database `affine.public`
2024-05-10T10:37:06.734446339Z error Command failed with exit code 1.
2024-05-10T10:37:06.734487078Z info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2024-05-10T10:37:07.138996865Z error Command failed with exit code 1.
2024-05-10T10:37:07.139070613Z info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2024-05-10T10:37:07.713252678Z node:internal/errors:984
2024-05-10T10:37:07.713272837Z   const err = new Error(message);
2024-05-10T10:37:07.713277137Z               ^
2024-05-10T10:37:07.713280537Z 
2024-05-10T10:37:07.713283937Z Error: Command failed: yarn predeploy
2024-05-10T10:37:07.713287447Z     at genericNodeError (node:internal/errors:984:15)

Anything else?

No response

DEAD1SIDE avatar May 10 '24 10:05 DEAD1SIDE

Issue Status: 🆕 *Untriaged

*🆕 Untriaged

The team has not yet reviewed the issue. We usually do it within one business day. Docs: https://github.com/toeverything/AFFiNE/blob/canary/docs/issue-triaging.md

This is an automatic reply by the bot.

affine-issue-bot[bot] avatar May 10 '24 10:05 affine-issue-bot[bot]

same issue

rpCal avatar Jun 19 '24 15:06 rpCal

Why is this closed? I'm having the exact same issue following what's in the docs with docker. Clean and fresh install.

affine_postgres    | 2024-07-04 09:05:31.977 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
affine_postgres    | 2024-07-04 09:05:31.977 UTC [1] LOG:  listening on IPv6 address "::", port 5432
affine_postgres    | 2024-07-04 09:05:31.982 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
affine_postgres    | 2024-07-04 09:05:31.999 UTC [30] LOG:  database system was shut down at 2024-07-04 09:05:23 UTC
affine_postgres    | 2024-07-04 09:05:32.020 UTC [1] LOG:  database system is ready to accept connections
affine_selfhosted  | Segmentation fault
affine_selfhosted exited with code 0
affine_selfhosted  | Segmentation fault
affine_selfhosted exited with code 139
affine_selfhosted  | running predeploy script.
affine_selfhosted  | Segmentation fault
affine_selfhosted  | node:internal/errors:984
affine_selfhosted  |   const err = new Error(message);
affine_selfhosted  |               ^
affine_selfhosted  |
affine_selfhosted  | Error: Command failed: yarn predeploy
affine_selfhosted  |     at genericNodeError (node:internal/errors:984:15)
affine_selfhosted  |     at wrappedFn (node:internal/errors:538:14)
affine_selfhosted  |     at checkExecSyncError (node:child_process:890:11)
affine_selfhosted  |     at execSync (node:child_process:962:15)
affine_selfhosted  |     at runPredeployScript (file:///app/scripts/self-host-predeploy.js:67:3)
affine_selfhosted  |     at file:///app/scripts/self-host-predeploy.js:75:1
affine_selfhosted  |     at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
affine_selfhosted  |     at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
affine_selfhosted  |     at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5) {
affine_selfhosted  |   status: 139,
affine_selfhosted  |   signal: null,
affine_selfhosted  |   output: [ null, null, null ],
affine_selfhosted  |   pid: 20,
affine_selfhosted  |   stdout: null,
affine_selfhosted  |   stderr: null
affine_selfhosted  | }
affine_selfhosted  |
affine_selfhosted  | Node.js v20.15.0
affine_selfhosted exited with code 1
affine_selfhosted  | Segmentation fault
affine_selfhosted exited with code 139
affine_selfhosted  | Segmentation fault
affine_selfhosted exited with code 139
affine_selfhosted  | Segmentation fault
affine_selfhosted exited with code 139
affine_selfhosted  | Segmentation fault
affine_selfhosted exited with code 139
affine_selfhosted  | Segmentation fault
affine_selfhosted exited with code 139
affine_selfhosted  | Segmentation fault
affine_selfhosted exited with code 139

notflip avatar Jul 04 '24 09:07 notflip