anvil-works / anvil-runtime

The runtime engine for hosting Anvil web apps
https://anvil.works/open-source
Other
904 stars 117 forks source link

M1 Big Sur MacOsx missing postgres binaries #42

Open gtrad opened 3 years ago

gtrad commented 3 years ago

Hi there,

Big fan of your app server and anvil.works. I've successfully launched several apps on windows and linux builds, however I am having issues with my new mac air with the M1 chip.

After activating the virtual environment, installing anvil-app-server and creating a test app, when I launch I get the following error:

Failed to start built-in Postgres database: java.lang.IllegalStateException: Missing postgres binaries More logs are available in .anvil-data/postgres.log. Some common causes of this problem:

  • Are you launching this server as 'root' on a UNIX system? Postgres will not run as root; try launching the server as an ordinary user.
  • Are you running this server on an unusual architecture or OS? (Mac OS X/aarch64)

further, when opening the .anvil-data log the following warnings are displayed:

[INFO io.zonky.test.db.postgres.embedded.EmbeddedPostgres] Detected a Darwin aarch64 system [INFO io.zonky.test.db.postgres.embedded.DefaultPostgresBinaryResolver] Detected distribution: 'Unknown' [TRACE io.zonky.test.db.postgres.embedded.DefaultPostgresBinaryResolver] Searching for postgres binaries - location: 'postgres-darwin-arm_64.txz' [ERROR io.zonky.test.db.postgres.embedded.DefaultPostgresBinaryResolver] No postgres binaries were found, you must add an appropriate maven dependency that meets the following parameters - system: Darwin, architecture: arm_64

I suspect this is an issue with the postgressql package and the macosx, however I am far from an expert, I'd love to get any pointers :)

gtrad commented 3 years ago

Hi Meredydd,
I've done some more digging and think it is the version of io.zonky.test.db.postgres.embedded running, as 1.3.0 should now have compatibility with the M1 Rosetta emulator

Alcampopiano commented 2 years ago

Hello folks, I am seeing this same issue with M1s (exact error and logs).

I'm currently undergoing a review for a publication using an Anvil app. Any workaround would be very much appreciated!

gtrad commented 2 years ago

Hello folks, I am seeing this same issue with M1s (exact error and logs).

I'm currently undergoing a review for a publication using an Anvil app. Any workaround would be very much appreciated!

Hi Alcampopiano,

I was able to overcome this by creating my own run time, which I’ve been meaning to pull request - I can upload the custom runtime on my git, which would quickly solve your problem :)

luxiaolei commented 2 years ago

Hello folks, I am seeing this same issue with M1s (exact error and logs). I'm currently undergoing a review for a publication using an Anvil app. Any workaround would be very much appreciated!

Hi Alcampopiano,

I was able to overcome this by creating my own run time, which I’ve been meaning to pull request - I can upload the custom runtime on my git, which would quickly solve your problem :)

Hi gtrad, could you pls instruct me where to find ur custom runtime? thanks:)

clauslang commented 2 years ago

Same issue here. Any news on this?

meredydd commented 2 years ago

This should be resolved in v1.7.0. Can you retest and confirm?

altryne commented 1 year ago

I'm having the same issue, not sure how to proceed. Failed to start built-in Postgres database

James-Smart commented 1 year ago

I seem to be hitting this one as well

James-Smart commented 1 year ago

I forked and managed to get this working. There were two things that needed to be changed. The optional darwin-arm64v8 posttgres dependency needed to be added. Only the linux ones were included. Additionally the postgres version needed to be bumped as the one specified did not have a darwin arm build. (interestingly I note that in the 1.6.6 release of anvil the included postgres is actually newer than the one in 1.7) I only bumped it up to the first version that has a darwin build (there was a version 10 but this one is compiled incorrectly)

James-Smart commented 1 year ago

I went ahead and made a pull request for the required changes.