Raspberry PI 3B+ Buster, Server not working

Raspberry Pi 3B+ Server localhost:3030 does not work after install Anvil App Server Jar.

Failed to start built-in Postgres database: java.lang.IllegalStateException: Process 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? (Linux/arm)

tail .anvil-data/postgres.log.

initdb: cannot be run as root
Please log in (using, e.g., “su”) as the (unprivileged) user that will
own the server process.

What could be the solution to this?

I follow this tutorial above and works great … you try

2 Likes

Yes it worked thank you. Needed Java virtual machine. Do you know how to run it as a background service?

1 Like

I create a bash file and it will run everytime i start RaspberryPi … easy :slight_smile:

I am a bit new to yaml. Can you please give me a link or bash script to get me started. Tried web search but did not succeed.

#!/bin/bash

cd /home/pi
. env/bin/activate
echo “DONE”
anvil-app-server --app your_app_name

this is what i have in my bash file.
you only need to create an empty file, inside you put that, save … run … and its done

Of course, you need to clone your app from git hub before you do that, to /home/pi
And already create the environment env as you see in the tutorial

you try

##Somehow bash did not work for me so I adopted systemd method.

sudo nano /etc/systemd/system/camera.service

##and inserted the following in the file:

[Unit]
Description=camera service
After=network.target

[Service]
ExecStart=anvil-app-server --app <my_app_name_here>
WorkingDirectory=/home/pi/
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi

[Install]
WantedBy=multi-user.target

##ctrl+x then y then enter to save
##and it worked after doing this on terminal

sudo systemctl enable camera.service
sudo systemctl start camera.service
sudo systemctl daemon-reload

Perfect. Thank you for your assistance

2 Likes