AFFiNE icon indicating copy to clipboard operation
AFFiNE copied to clipboard

​Self-hosted update error

Open LIHAQ opened this issue 1 year ago • 3 comments

What happened?

After updating the beta version of the hosted container, the page cannot be accessed and the following error is reported image

Distribution version

Web (app.affine.pro)

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

Chrome

Are you self-hosting?

  • [X] Yes

Relevant log output

Node.js v20.12.2
running predeploy script.
yarn run v1.22.19
$ yarn prisma migrate deploy && node --import ./scripts/register.js ./dist/data/index.js run
$ /app/node_modules/.bin/prisma migrate deploy
Error: request to https://binaries.prisma.sh/all_commits/473ed3124229e22d881cb7addf559799debae1ab/debian-openssl-3.0.x/libquery_engine.so.node.gz.sha256 failed, reason: 
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
node:internal/errors:984
  const err = new Error(message);
              ^

Error: Command failed: yarn predeploy
    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at runPredeployScript (file:///app/scripts/self-host-predeploy.js:67:3)
    at file:///app/scripts/self-host-predeploy.js:75:1
    at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
    at async loadESM (node:internal/process/esm_loader:28:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 20,
  stdout: null,
  stderr: null
}

Node.js v20.12.2

Anything else?

No response

LIHAQ avatar Apr 26 '24 07:04 LIHAQ

Issue Status: *Waiting for Info

*Waiting for Info

We’ve requested additional information from the person who created the issue and are waiting for them to get back to us.

This is an automatic reply by the bot.

affine-issue-bot[bot] avatar Apr 26 '24 07:04 affine-issue-bot[bot]

Looks like is a network problem, make sure your container can access binaries.prisma.sh

EYHN avatar Apr 26 '24 07:04 EYHN

Looks like is a network problem, make sure your container can access binaries.prisma.sh

Looks like the network should be fine image

LIHAQ avatar Apr 29 '24 02:04 LIHAQ

@EYHN Hello, the above has been solved, but I have encountered other problems when updating the latest bate version. image

Node.js v20.14.0
running predeploy script.
yarn run v1.22.22
$ yarn prisma migrate deploy && node --import ./scripts/register.js ./dist/data/index.js run
$ /app/node_modules/.bin/prisma migrate deploy
Prisma schema loaded from schema.prisma
Datasource "db": PostgreSQL database "affine", schema "public" at "postgres:5432"

33 migrations found in prisma/migrations


No pending migrations to apply.
(node:90) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
file:///app/dist/config/affine.js:88
AFFiNE.plugins.use('redis', {
               ^

TypeError: AFFiNE.plugins.use is not a function
    at file:///app/dist/config/affine.js:88:16
    at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
    at async loadRemote (file:///app/dist/prelude.js:16:5)
    at async load (file:///app/dist/prelude.js:37:5)
    at async file:///app/dist/prelude.js:46:1

Node.js v20.14.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
node:internal/errors:984
  const err = new Error(message);
              ^

Error: Command failed: yarn predeploy
    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at runPredeployScript (file:///app/scripts/self-host-predeploy.js:67:3)
    at file:///app/scripts/self-host-predeploy.js:75:1
    at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 20,
  stdout: null,
  stderr: null
}

LIHAQ avatar Jun 04 '24 06:06 LIHAQ

the config system has been updated. if you have any plugin usage in affine.js config file, please update AFFiNE.plugins.use to AFFiNE.use

forehalo avatar Jun 04 '24 06:06 forehalo

the config system has been updated. if you have any plugin usage in config file, please update to affine.js``AFFiNE.plugins.use``AFFiNE.use

How to update

LIHAQ avatar Jun 04 '24 06:06 LIHAQ

the config system has been updated. if you have any plugin usage in config file, please update to affine.jsAFFiNE.plugins.useAFFiNE.use

How to update

checkout the ~/.affine/self-host/config folder on your host server. if did not ever touch it, it's ok to delete the whole folder and give it a fresh restart

forehalo avatar Jun 04 '24 08:06 forehalo

the config system has been updated. if you have any plugin usage in config file, please update to AFFiNE.plugins.useaffine.js``AFFiNE.use

How to update

checkout the folder on your host server. if did not ever touch it, it's ok to delete the whole folder and give it a fresh restart~/.affine/self-host/config

After the update is the following error

Node.js v20.14.0
running predeploy script.
yarn run v1.22.22
$ yarn prisma migrate deploy && node --import ./scripts/register.js ./dist/data/index.js run
$ /app/node_modules/.bin/prisma migrate deploy
Prisma schema loaded from schema.prisma
Datasource "db": PostgreSQL database "affine", schema "public" at "postgres:5432"

33 migrations found in prisma/migrations


No pending migrations to apply.
(node:91) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
[Nest] 91  - 06/04/2024, 8:23:31 AM    WARN [MailerModule] MailerModule is not enabled because of the required configuration is not satisfied.
[Nest] 91  - 06/04/2024, 8:23:31 AM    WARN [MailerModule] Unsatisfied configuration:
[Nest] 91  - 06/04/2024, 8:23:31 AM    WARN [MailerModule]   AFFiNE.mailer.host
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [NestFactory] Starting Nest application... +2ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] CommandRootModule dependencies initialized +44ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] AppModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] PrismaModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] WebSocketModule dependencies initialized +1ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] SyncModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] GqlModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] CacheModule dependencies initialized +3ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] DiscoveryModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] DiscoveryModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] ConfigModule dependencies initialized +1ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] EventModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] MutexModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] MetricsModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] StorageProviderModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] HelpersModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] ServeStaticModule dependencies initialized +1ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] EventEmitterModule dependencies initialized +1ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] ScheduleModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] CommandRunnerModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] MailModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] StorageModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] ServerConfigModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] ThrottlerModule dependencies initialized +1ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] CliAppModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] RateLimiterModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] GraphQLSchemaBuilderModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] QuotaModule dependencies initialized +1ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] FeatureModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] DocModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] UserModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] EventsModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] GraphQLModule dependencies initialized +2ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] AuthModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:31 AM     LOG [InstanceLoader] WorkspaceModule dependencies initialized +0ms
[Nest] 91  - 06/04/2024, 8:23:32 AM     LOG [RunCommand] Running SelfHostAdmin1...
[Nest] 91  - 06/04/2024, 8:23:32 AM   ERROR [RunCommand] Failed to run data migration
[Nest] 91  - 06/04/2024, 8:23:32 AM   ERROR [RunCommand] Error: Feature administrator not found
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
node:internal/errors:984
  const err = new Error(message);
              ^

Error: Command failed: yarn predeploy
    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at runPredeployScript (file:///app/scripts/self-host-predeploy.js:67:3)
    at file:///app/scripts/self-host-predeploy.js:75:1
    at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 20,
  stdout: null,
  stderr: null
}

Node.js v20.14.0

LIHAQ avatar Jun 04 '24 08:06 LIHAQ

that's known issue, will be hotfixed soon

forehalo avatar Jun 04 '24 08:06 forehalo

that's known issue, will be hotfixed soon

I can't use it until it's fixed. The website won't open

LIHAQ avatar Jun 04 '24 08:06 LIHAQ

please upgrade to the latest image

forehalo avatar Jun 04 '24 09:06 forehalo

same issue

rpCal avatar Jun 19 '24 15:06 rpCal

affine_selfhosted | error Command failed with exit code 1. affine_selfhosted | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. affine_selfhosted | error Command failed with exit code 1. affine_selfhosted | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 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: 1, 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.16.0 affine_selfhosted | running predeploy script. affine_selfhosted | yarn run v1.22.22 affine_selfhosted | $ yarn prisma migrate deploy && node --import ./scripts/register.js ./dist/data/index.js run affine_selfhosted | $ /app/node_modules/.bin/prisma migrate deploy affine_selfhosted | Error: request to https://binaries.prisma.sh/all_commits/393aa359c9ad4a4bb28630fb5613f9c281cde053/debian-openssl-3.0.x/libquery_engine.so.node.gz.sha256 failed, reason: getaddrinfo EAI_AGAIN binaries.prisma.sh

Same problem, Synology 7.2 version, tried to deploy two months ago, but still can't do it...

SlippinDylan avatar Aug 28 '24 10:08 SlippinDylan

the installation process (self-host) is stuck in this place, what could be the problem?

affine_selfhosted | Node.js v20.16.0 affine_selfhosted | running predeploy script. affine_selfhosted | yarn run v1.22.22 affine_selfhosted | $ yarn prisma migrate deploy && node --import ./scripts/register.js ./dist/data/index.js run affine_selfhosted | Killed 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: 137, affine_selfhosted | signal: null, affine_selfhosted | output: [ null, null, null ], affine_selfhosted | pid: 20, affine_selfhosted | stdout: null, affine_selfhosted | stderr: null affine_selfhosted | }

vnetesov avatar Sep 01 '24 08:09 vnetesov