I’m trying to deploy an app I’ve created in the anvil IDE locally for testing. I used to do this on my intel machine, however lately I’ve switched to Mac, with the M1 chip. The architecture of the chip is different, ARM x64.
Here is the 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)
The error is accompanied by the following log:
[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 that the version of io.zonky.test.db.postgres.embedded is the issue, as it was only recently updated to be compatible with the internal macosx emulating software.
I’ve tried downloading and changing the anvil-app-server source code to call the newer version of the dependency, however re-deploying using pip has proved tricky.
Any advice would be appreciated, as I am considering returning my mac
If you’ve got it building, you should be able to make an installable package! If you follow the instructions here, you should get a folder you can install with pip. If you make a tarball from that folder (tar -zcf app-server-custom-release.tgz python-package-build/), you should be able to copy it around and pip install app-server-custom-release.tgz anywhere!
After a few days of trouble shooting with the build, I am happy to report I’ve now got a custom instance which I can pip install. This installs the version with the newer io.zonky.test.db.postgres.embedded library. The app works well
Please note, for people reading this in the future, I also had to reinstall psycog2 to use psql-anvil-app-server, using this method:
and if that doesn’t work straight away, I also had to run: pip install psycopg2-binary
(also I don’t have to return my new mac)
I’m attempting to follow the readme at Anvil Runtime to run my own local Anvil Server on an M1 mac. When I run anvil-app-server --app MyTodoList I get this same message from this discussion thread. Are you running this server on an unusual architecture or OS? (Mac OS X/aarch64) etc.)
The only reason I’m doing this is because in this particular project I’m working with data that I don’t want stored in the cloud. I may find another solution, but I was hoping to practice making anvil apps because I have several other (cloud based) projects in mind for the future.
I ran into a few issues following @meredydd 's suggested “make an installable package” approach with the Runtime build instructions, I resolved some of those, changing node versions, etc., but I’m stuck at the ./build-all step. During the core build stage, I get
Tried to use insecure HTTP repository without TLS:
This is almost certainly a mistake; for details see
That FAQ seems to suggest proceeding through an insecure connection as the only option, but I don’t like that.
Any suggestions? This is an old thread, so are there any others successfully running a local anvil server on a Mac with M1 chip since then?