Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Trouble installing through Docker on ARM64 #1879

Open
LeavingBeta opened this issue Apr 20, 2023 · 12 comments
Open

[BUG] Trouble installing through Docker on ARM64 #1879

LeavingBeta opened this issue Apr 20, 2023 · 12 comments
Labels
help wanted Extra attention is needed self-hosted This issue is relevant for the self-hosted version

Comments

@LeavingBeta
Copy link

LeavingBeta commented Apr 20, 2023

Errors when installing through docker on a Raspberry Pi 4

Following the steps in Run with Docker Compose on a Raspberry Pi 4 ends up with errors.
The ghostfolio-development-ghostfolio-1 container shuts down with this in its logs:

prisma:warn Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures. If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "aarch64".

Error: Not Found https://binaries.prisma.sh/all_commits/659ef412370fa3b41cd7bf6e94587c1dfb7f67e7/linux-arm-openssl-1.1.x/libquery_engine.so.node.gz

error Command failed with exit code 1.

After doing some digging I found this thread online: prisma/prisma#17284

They found that this is a 404
https://binaries.prisma.sh/all_commits/d6e67a83f971b175a593ccc12e15c4a757f93ffe/linux-arm-openssl-1.1.x/prisma-fmt.gz

while this exists
https://binaries.prisma.sh/all_commits/d6e67a83f971b175a593ccc12e15c4a757f93ffe/linux-arm64-openssl-1.1.x/prisma-fmt.gz

So with this knowledge I set an environment variable for the container ghostfolio-ghostfolio-1 that specifies PRISMA_CLI_BINARY_TARGETS = linux-arm64-openssl-1.1.x

Now we get a different error:

prisma:warn Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures. If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "aarch64".

Error: Migration engine exited. Error: Could not find migration-engine binary. Searched in:

- /ghostfolio/apps/api/node_modules/@prisma/engines/migration-engine-linux-arm-openssl-1.1.x

- /ghostfolio/apps/api/node_modules/prisma/migration-engine-linux-arm-openssl-1.1.x

- /ghostfolio/apps/api/node_modules/migration-engine-linux-arm-openssl-1.1.x

- /ghostfolio/apps/api/node_modules/prisma/runtime/migration-engine-linux-arm-openssl-1.1.x

error Command failed with exit code 1.
@dtslvr dtslvr added help wanted Extra attention is needed self-hosted This issue is relevant for the self-hosted version labels Apr 22, 2023
@biejay
Copy link

biejay commented May 11, 2023

Got the same problem

@LeavingBeta LeavingBeta changed the title [BUG] Trouble installing through docker on Raspberry Pi [BUG] Trouble installing through Docker on ARM64 Raspberry Pi 4 May 12, 2023
@LeavingBeta LeavingBeta changed the title [BUG] Trouble installing through Docker on ARM64 Raspberry Pi 4 [BUG] Trouble installing through Docker on ARM64 May 12, 2023
@musantro
Copy link

musantro commented Jun 13, 2023

I ran through the same issue these days with an RPi3b+. I've been investigating around the issue but first I would like to ask,

@LeavingBeta are you running 32 or 64 bit OS on your RPi4?

@LeavingBeta
Copy link
Author

I ran through the same issue these days with an RPi3b+. I've been investigating around the issue but first I would like to ask,

@LeavingBeta are you running 32 or 64 bit OS on your RPi4?

64 bit OS

@musantro
Copy link

musantro commented Jun 13, 2023

In my case I am using armv7l which is basically 32 bit, although I receive exactly the same errors.

If it is 64 bit OS, I am curious how it throws an error like this if yours is aarch64 so in theory it should match the specs.

Just to clarify myself and try to understand if we are experiencing the same issue, what's your output of uname -a?

Also, if you follow the thread on the issue you mentioned, the OP finally managed to work by installing 64bit raspbian instead of 32 bit.

I have been investigating around this issue, and in my case, the problem is clear, there is no support for armv7l (armhf) for prisma, specifically prisma-engines.

There are some intentions to try to cross-compile prisma-engines using armhf as default architecture prisma/prisma-engines#3881, but right now there is no luck. In theory, if we manage to recompile prisma-engines we could use those custom engines and add them like this.

Long story short: I depend on prisma-engines to get a fully working library for armhf.

@pedrommvv
Copy link

Also using RPI 4 with OS 64, using docker-compose. It seems related to prisma.

Creating ghostfolio-development_postgres_1 ... done
Creating ghostfolio-development_redis_1    ... done
Recreating ghostfolio-development_ghostfolio_1 ... done
Attaching to ghostfolio-development_redis_1, ghostfolio-development_postgres_1, ghostfolio-development_ghostfolio_1
ghostfolio_1  | yarn run v1.22.19
ghostfolio_1  | $ yarn database:migrate && yarn database:seed && node main
postgres_1    | 
postgres_1    | PostgreSQL Database directory appears to contain a database; Skipping initialization
postgres_1    | 
postgres_1    | 2023-06-18 03:12:43.373 UTC [1] LOG:  starting PostgreSQL 12.15 (Debian 12.15-1.pgdg120+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
postgres_1    | 2023-06-18 03:12:43.373 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
postgres_1    | 2023-06-18 03:12:43.373 UTC [1] LOG:  listening on IPv6 address "::", port 5432
postgres_1    | 2023-06-18 03:12:44.294 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres_1    | 2023-06-18 03:12:44.374 UTC [27] LOG:  database system was shut down at 2023-06-18 03:11:26 UTC
postgres_1    | 2023-06-18 03:12:44.450 UTC [1] LOG:  database system is ready to accept connections
redis_1       | 1:C 18 Jun 2023 03:12:43.005 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis_1       | 1:C 18 Jun 2023 03:12:43.005 # Redis version=7.0.11, bits=64, commit=00000000, modified=0, pid=1, just started
redis_1       | 1:C 18 Jun 2023 03:12:43.005 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redis_1       | 1:M 18 Jun 2023 03:12:43.006 * monotonic clock: POSIX clock_gettime
redis_1       | 1:M 18 Jun 2023 03:12:43.008 * Running mode=standalone, port=6379.
redis_1       | 1:M 18 Jun 2023 03:12:43.009 # Server initialized
redis_1       | 1:M 18 Jun 2023 03:12:43.009 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. 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.
redis_1       | 1:M 18 Jun 2023 03:12:43.013 * Ready to accept connections
ghostfolio_1  | $ prisma migrate deploy
ghostfolio_1  | Prisma schema loaded from prisma/schema.prisma
ghostfolio_1  | Datasource "db": PostgreSQL database "ghostfolio-db", schema "public" at "postgres:5432"
ghostfolio_1  | 
ghostfolio_1  | 65 migrations found in prisma/migrations
ghostfolio_1  | 
ghostfolio_1  | 
ghostfolio_1  | No pending migrations to apply.
ghostfolio_1  | $ prisma db seed
ghostfolio_1  | Running seed command `node prisma/seed.js` ...
ghostfolio_1  | PrismaClientInitializationError: 
ghostfolio_1  | Invalid `prisma.tag.createMany()` invocation:
ghostfolio_1  | 
ghostfolio_1  | 
ghostfolio_1  | Prisma Client could not locate the Query Engine for runtime "linux-arm64-openssl-3.0.x".
ghostfolio_1  | 
ghostfolio_1  | This happened because Prisma Client was generated for "debian-openssl-3.0.x", but the actual deployment required "linux-arm64-openssl-3.0.x".
ghostfolio_1  | Add "linux-arm64-openssl-3.0.x" to `binaryTargets` in the "schema.prisma" file and run `prisma generate` after saving it:
ghostfolio_1  | 
ghostfolio_1  | generator client {
ghostfolio_1  |   provider      = "prisma-client-js"
ghostfolio_1  |   binaryTargets = ["debian-openssl-1.1.x", "linux-arm64-openssl-1.1.x", "native", "linux-arm64-openssl-3.0.x"]
ghostfolio_1  | }
ghostfolio_1  | 
ghostfolio_1  | The following locations have been searched:
ghostfolio_1  |   /ghostfolio/apps/api/node_modules/.prisma/client
ghostfolio_1  |   /ghostfolio/apps/api/node_modules/@prisma/client
ghostfolio_1  |   /ghostfolio/dist/apps/api/node_modules/@prisma/client
ghostfolio_1  |   /tmp/prisma-engines
ghostfolio_1  |   /ghostfolio/apps/api/prisma
ghostfolio_1  |     at An.handleRequestError (/ghostfolio/apps/api/node_modules/@prisma/client/runtime/library.js:174:7205)
ghostfolio_1  |     at An.handleAndLogRequestError (/ghostfolio/apps/api/node_modules/@prisma/client/runtime/library.js:174:6358)
ghostfolio_1  |     at /ghostfolio/apps/api/node_modules/@prisma/client/runtime/library.js:177:2908
ghostfolio_1  |     at async /ghostfolio/apps/api/node_modules/@prisma/client/runtime/library.js:177:3123
ghostfolio_1  |     at async t._executeRequest (/ghostfolio/apps/api/node_modules/@prisma/client/runtime/library.js:177:10621)
ghostfolio_1  |     at async main (/ghostfolio/apps/api/prisma/seed.js:5:3) {
ghostfolio_1  |   clientVersion: '4.15.0',
ghostfolio_1  |   errorCode: undefined
ghostfolio_1  | }
ghostfolio_1  | 
ghostfolio_1  | An error occurred while running the seed command:
ghostfolio_1  | Error: Command failed with exit code 1: node prisma/seed.js
ghostfolio_1  | error Command failed with exit code 1.
ghostfolio_1  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ghostfolio_1  | error Command failed with exit code 1.
ghostfolio_1  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ghostfolio-development_ghostfolio_1 exited with code 1

@ms32035
Copy link
Contributor

ms32035 commented Jun 18, 2023

For the last one looks more like one of these is the culprit
#2053
#2070
Looks like an inconsistency in openssl version (1 vs 3) rather than architecture.

@dtslvr
Copy link
Member

dtslvr commented Jun 19, 2023

Looks like an inconsistency in openssl version (1 vs 3) rather than architecture.

Your change has been released with Ghostfolio 1.282.0. Can you please give feedback?

@ms32035
Copy link
Contributor

ms32035 commented Jun 19, 2023

@dtslvr works good. Thanks 👍

@pedrommvv
Copy link

Working on pi 4 OS 64bit as well. Thank you.

@JohannesFoltin
Copy link

JohannesFoltin commented Aug 16, 2023

Two Months later. I got the Problem again on an Rasp 4 Model B
uname -a gives me:
Linux pi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
Log from failing docker (ghostfolio):

yarn run v1.22.19
$ yarn database:migrate && yarn database:seed && node main
$ prisma migrate deploy
prisma:warn Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures. If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "aarch64".
Error: Failed to fetch sha256 checksum at https://binaries.prisma.sh/all_commits/4bc8b6e1b66cb932731fb1bdbbc550d1e010de81/linux-arm-openssl-3.0.x/migration-engine.sha256. 404 Not Found

If you need to ignore this error (e.g. in an offline environment), set the PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING environment variable to a truthy value.
Example: PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING=1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

with PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING=1 in the .env i got this error:

yarn run v1.22.19
$ yarn database:migrate && yarn database:seed && node main
$ prisma migrate deploy
prisma:warn Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures. If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "aarch64".
Error: Not Found https://binaries.prisma.sh/all_commits/4bc8b6e1b66cb932731fb1bdbbc550d1e010de81/linux-arm-openssl-3.0.x/migration-engine.gz
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Image is up to date

@matt852
Copy link

matt852 commented Jan 15, 2024

I get a 404 unauthorized just from browsing to https://binaries.prisma.sh/ in my web browser.

It appears the original package is no longer maintained, and has been transferred to a new owner/repo. This is the issuedetailing the transfer of ownership.

Here is an issue opened recently with this same issue, but has the attention of the developer. I'm not sure of the fix yet, but so far I think:

  1. An updated binary needs to be hosted somewhere
  2. Ghostfolio needs to be updated to point to the new binary, along with the new checksum

@steebchen
Copy link

@matt852 Please correct me if I'm wrong, but it looks like you are pointing to Go client issues which are completely unrelated to this repo as it is using the JS client; not the Go client.

This part in the prisma.schema might need to be adapted to make sure it runs on more platforms:

https://github.com/ghostfolio/ghostfolio/blob/main/prisma/schema.prisma#L4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed self-hosted This issue is relevant for the self-hosted version
Projects
None yet
Development

No branches or pull requests

9 participants