Issues with production installation: PSQL / rails failed

I am trying to install FabManager on Ubuntu 22.04 with Docker 24.0.5 using the standard production install script.

To Reproduce
Steps to reproduce the behavior:

  1. Start production installation script
  2. Observe error, see below

I continued with the installation process, but later on more errors appear (such as the fabmanager docker image failing to access a HTTP socket), so I figured something else must be wrong here.

Server

  • OS: Ubuntu 22.04.3 LTS
  • Kernel: 5.15.0
  • Fab-manager version: latest from production script

Additional context
This is the output of the install script

#======================================================================#
#    ____  __   ____       _  _   __   __ _   __    ___  ____  ____    #
#   (  __)/ _\ (  _ \ ___ ( \/ ) / _\ (  ( \ / _\  / __)(  __)(  _ \   #
#    ) _)/    \ ) _ ((___)/ \/ \/    \/    //    \( (_ \ ) _)  )   /   #
#   (__) \_/\_/(____/     \_)(_/\_/\_/\_)__)\_/\_/ \___/(____)(__\_)   #
#                                                                      #
#======================================================================#

                 Welcome to Fab-manager's setup assistant


Thank you for installing Fab-manager.
This script will guide you through the installation process of Fab-manager

Please report any feedback or improvement request on https://feedback.fab-manager.com/
For bug reports, please open a new issue on https://github.com/sleede/fab-manager/issues
You can call for community assistance on https://forum.fab-manager.com/

You can interrupt this installation at any time by pressing Ctrl+C
If you do not feel confortable with this installation, you can subscribe to our hosting offers:
https://www.fab-manager.com/saas-offer

Continue? (Y/n) Y
detecting group docker for current user...
myuser adm cdrom sudo dip video plugdev lpadmin lxd docker
detecting sudo...
/usr/bin/sudo
detecting curl...
/usr/bin/curl
detecting sed...
/usr/bin/sed
detecting openssl...
/usr/bin/openssl
detecting docker...
/usr/bin/docker
detecting systemctl...
/usr/bin/systemctl
detecting docker version...
detecting docker-compose...
docker-compose version 1.29.2, build unknown
docker-py version: 5.0.3
CPython version: 3.10.12
OpenSSL version: OpenSSL 3.0.2 15 Mar 2022
[ ✔ ] All requirements successfully checked. 

We recommend nginx to serve the application over the network (internet). You can use your own solution or let this script install and configure nginx for Fab-manager.
If you want to install Fab-manager behind a reverse proxy, you may not need to install the integrated nginx.
Do you want install nginx? (Y/n) Y


We highly recommend to secure the application with HTTPS. You can use your own certificate or let this script install and configure let's encrypt for Fab-manager.
If this server is publicly available on the internet, you can use Let's encrypt to automatically generate and renew a valid SSL certificate for free.
Do you want install let's encrypt? (Y/n) n


What's the domain name where the instance will be active (eg. fab-manager.com)?
Please input the domain name > test.domain
Do you have any other domain (eg. a www. alias)? (y/N) n
Fab-Manager will be installed in /tmp/fabman/
Continue? (Y/n) y

We will now configure the environment variables.
This allows you to customize Fab-manager's appearance and behavior.
Proceed? (Y/n) n


We will now setup the database.
Continue? (Y/n) Y
Creating fabman_fabmanager_run ... done
D, [2024-01-16T14:44:50.276651 #1] DEBUG -- sentry: Initializing the background worker with 8 threads
D, [2024-01-16T14:44:51.620252 #1] DEBUG -- :    (970.0ms)  CREATE DATABASE "fablab_production" ENCODING = 'unicode'
Created database 'fablab_production'
D, [2024-01-16T14:44:51.622407 #1] DEBUG -- sentry: Shutting down background worker
D, [2024-01-16T14:44:51.622596 #1] DEBUG -- sentry: Killing session flusher
Creating fabman_fabmanager_run ... done
D, [2024-01-16T14:44:57.281120 #1] DEBUG -- sentry: Initializing the background worker with 8 threads
2024-01-16T14:44:57.448Z pid=1 tid=4jd uniquejobs=client until_executed=uniquejobs:cc0574218e68e72b42b613c67a256545 INFO: Adding dead VersionCheckWorker job 6d6d520a50af0d37a33c0a2d
rails aborted!
failed to execute:
psql --set ON_ERROR_STOP=1 --quiet --no-psqlrc --output /dev/null --file /usr/src/app/db/structure.sql fablab_production

Please check the output above for any errors and make sure that `psql` is installed in your PATH and has proper permissions.


Tasks: TOP => db:schema:load
(See full trace by running task with --trace)
D, [2024-01-16T14:44:57.681516 #1] DEBUG -- sentry: Shutting down background worker
D, [2024-01-16T14:44:57.681578 #1] DEBUG -- sentry: Killing session flusher
ERROR: 1


We will now create the default administrator of Fab-manager.
Please input a valid email address > 

So loading the database schema fails.

Hello,
Same issue as @herodot here!
Fresh installation on a Ubuntu 23.04 image.

Here the error after the installation script ends.

fabmanager-1     | Error: Cannot open an HTTP server: socket.error reported errno.EACCES (13)
fabmanager-1     | For help, use /usr/bin/supervisord -h

I got that too, got error messages about permissions to /usr/src/app/tmp missing.
The last version working for me was 6.3.6, but from 6.3.7 these lines were removed from Dockerfile:

chmod -R a+w /usr/src/app && \
chmod -R a+w /var/run

I added them and built the image locally, and that seemed to do the trick

Thank you @Snowstrom! Could you describe the steps to build the image locally?

Sure,

I had a working 6.3.6. instance running when I did it, so I guess I’m describing an upgrade. But I can’t see why it shouldn’t work from scratch. Just be careful so the setup script doesn’t owerwrite your docker-compose.yml file after you’ve modified it.
Building fab-manager locally (any good place in the file system):

git clone https://github.com/sleede/fab-manager.git

Edit /fab-manager/Dockerfile so that the WEB app section ends like:


    mkdir -p /usr/src/app/tmp/pids && \
    chmod -R a+w /usr/src/app && \
    chmod -R a+w /var/run

Then build the image:


docker build fab-manager
docker images #(copy image id for fab-manager, check that it was built recently)
docker tag <IMAGE ID> fab-manager

If you´re upgrading, just change the service fabmanager in /apps/fabmanager/docker-compose.yml to:

fabmanager:
    image: fab-manager

and run

docker compose down && docker compose up -d

docker compose ps should show status up and port 3000/tcp for the image fab-manager

If you’re installing from scratch with the setup script, run the script until after it has created the installation directory:

Please supply sudo password for the following command: sudo mkdir -p /apps/fabmanager

And then connect another terminal and do the adjustments to /apps/fabmanager/docker-compose.yml

I don’t know if it’s correct in any way, but it worked and I got 6.3.10 up and running :slight_smile:

Hey @Snowstrom! Thanks a lot!
I did what you explain, but that wasn’t enough.
So based on the last commit on the Dockerfile, I added the packages postgresql and postgresql-client:

RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -\
  && apt-get update -qq && apt-get install -qq --no-install-recommends \
    nodejs \
    postgresql \
    postgresql-client \
  && apt-get upgrade -qq \
  && apt-get clean \
  && rm -rf /var/lib/apt/lists/*\
  && npm install -g yarn@1

And it looks like it work!
I didn’t check if we need the chmod and the postgresql packages.

1 « J'aime »