AFFiNE icon indicating copy to clipboard operation
AFFiNE copied to clipboard

Self Hosted - Cannot start, postgres tables are missing

Open moonfire opened this issue 1 year ago • 1 comments

What happened?

After setting up a Docker instance to self host in Unraid, including setting the variable DATABASE_URL to postgres://affine:[email protected]:5432/affine, I run the instance and after initial setup logs the log shows:

ERROR [Scheduler] PrismaClientKnownRequestError: 
Invalid `prisma.update.count()` invocation:

The table `public.updates` does not exist in the current database.

This makes sense, I check the affine database and no tables have been created. How does the database get initialized? Is this something I need to do manually?

Distribution version

Linux

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

Firefox

Are you self-hosting?

  • [X] Yes

Relevant log output

[Nest] 1  - 05/03/2024, 8:56:25 AM     LOG [App] AFFiNE Server is running in [affine] mode
[Nest] 1  - 05/03/2024, 8:56:25 AM     LOG [App] Listening on http://localhost:3010
[Nest] 1  - 05/03/2024, 8:56:25 AM     LOG [App] And the public server should be recognized as http://localhost:8080
[Nest] 1  - 05/03/2024, 8:58:00 AM   ERROR [Scheduler] PrismaClientKnownRequestError: 
Invalid `prisma.update.count()` invocation:


The table `public.updates` does not exist in the current database.

Anything else?

No response

moonfire avatar May 03 '24 13:05 moonfire

Is this still an issue in the latest version?

ddybing avatar Nov 27 '25 14:11 ddybing

@darkskygit Close this issue? As it is over a year old and no update.

ddybing avatar Dec 15 '25 12:12 ddybing