Hi, after installing anvil-app-server with pip on Win10 64-bit and starting an app I get this error:
Failed to start built-in Postgres database: java.lang.IllegalStateException: Process [.anvil-data\db-bin\PG-aaa7d03a0c0eb51f9510c27dc059d022\bin\initdb.exe, -A, trust, -U, postgres, -D, .anvil-data\db, -E, UTF-8] failed
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? (Windows 10/amd64)
with Python 3.8.3 and
openjdk version "11.0.7" 2020-04-14 LTS
OpenJDK Runtime Environment Corretto-11.0.7.10.1 (build 11.0.7+10-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.7.10.1 (build 11.0.7+10-LTS, mixed mode)
Thanks @jeff and @Tony.Nguyen, it must be something else - I’m running Anvil App Server successfuly on another Win10 machine without any problems, without virtualenv nor linux subsystem. It must be something else. One difference that I could think of is that on the other machine I have Postgres standalone installation - however Anvil App Server uses its own.
I found the cause - Anvil App Server uses Embedded Posgres database which is build (for Windows) using Visual Studio 2013 and thus needs Microsoft Visual C++ Redistributable Packages for Visual Studio 2013. After installing it, reboot the machine and Anvil App Server works as expected.
There might be other issues with Embedded Posgres - you can pin down the problem with running initdb.exe, -A, trust, -U, postgres, -D, .anvil-data\db, -E, UTF-8 within
.anvil-data\db-bin\PG-<…>\bin on command prompt and observe the behaviour.