Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgresql database connection problem #362

Closed
DanieleLattaioli opened this issue May 16, 2024 · 16 comments
Closed

Postgresql database connection problem #362

DanieleLattaioli opened this issue May 16, 2024 · 16 comments

Comments

@DanieleLattaioli
Copy link

DanieleLattaioli commented May 16, 2024

Expected Behaviour

I'm following the book "Serveless for everyone else" with faasd. I've reached the section "Storing data with databases" and followed the instructions to setup a function that works with a db.
First of all, I've followed the instruction of the section "Adding a database - Postgresql" and this is the output for the sudo journalctl -t openfaas:postgresql

mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: The files belonging to this database system will be owned by user "postgres".
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: This user must also own the server process.
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: The database cluster will be initialized with locale "en_US.utf8".
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: The default database encoding has accordingly been set to "UTF8".
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: The default text search configuration will be set to "english".
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: Data page checksums are disabled.
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: fixing permissions on existing directory /var/lib/postgresql/data/pgdata ... ok
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: creating subdirectories ... ok
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: selecting default max_connections ... 100
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: selecting default shared_buffers ... 128MB
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: selecting default timezone ... Etc/UTC
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: selecting dynamic shared memory implementation ... posix
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: creating configuration files ... ok
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: running bootstrap script ... ok
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: performing post-bootstrap initialization ... ok
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: WARNING: enabling "trust" authentication for local connections
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: You can change this by editing pg_hba.conf or using the option -A, or
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: --auth-local and --auth-host, the next time you run initdb.
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: syncing data to disk ... ok
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: Success. You can now start the database server using:
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]:     pg_ctl -D /var/lib/postgresql/data/pgdata -l logfile start
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: waiting for server to start....2024-05-16 17:38:42.986 UTC [40] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 2024-05-16 17:38:42.994 UTC [41] LOG:  database system was shut down at 2024-05-16 17:38:42 UTC
mag 16 19:38:42 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 2024-05-16 17:38:42.997 UTC [40] LOG:  database system is ready to accept connections
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]:  done
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: server started
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: waiting for server to shut down....2024-05-16 17:38:43.105 UTC [40] LOG:  received fast shutdown request
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 2024-05-16 17:38:43.107 UTC [40] LOG:  aborting any active transactions
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 2024-05-16 17:38:43.108 UTC [40] LOG:  background worker "logical replication launcher" (PID 47) exited with exit code 1
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 2024-05-16 17:38:43.109 UTC [42] LOG:  shutting down
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 2024-05-16 17:38:43.117 UTC [40] LOG:  database system is shut down
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]:  done
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: server stopped
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: PostgreSQL init process complete; ready for start up.
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 2024-05-16 17:38:43.214 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 2024-05-16 17:38:43.214 UTC [1] LOG:  listening on IPv6 address "::", port 5432
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 2024-05-16 17:38:43.216 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 2024-05-16 17:38:43.223 UTC [59] LOG:  database system was shut down at 2024-05-16 17:38:43 UTC
mag 16 19:38:43 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 2024-05-16 17:38:43.227 UTC [1] LOG:  database system is ready to accept connections
mag 16 20:02:08 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 2024-05-16 18:02:08.645 UTC [1] LOG:  received smart shutdown request
mag 16 20:02:08 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 2024-05-16 18:02:08.647 UTC [1] LOG:  background worker "logical replication launcher" (PID 65) exited with exit code 1
mag 16 20:02:08 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 2024-05-16 18:02:08.648 UTC [60] LOG:  shutting down
mag 16 20:02:08 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[5025]: 2024-05-16 18:02:08.656 UTC [1] LOG:  database system is shut down
mag 16 20:02:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: 
mag 16 20:02:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: PostgreSQL Database directory appears to contain a database; Skipping initialization
mag 16 20:02:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: 
mag 16 20:02:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: 2024-05-16 18:02:10.158 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
mag 16 20:02:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: 2024-05-16 18:02:10.158 UTC [1] LOG:  listening on IPv6 address "::", port 5432
mag 16 20:02:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: 2024-05-16 18:02:10.163 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
mag 16 20:02:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: 2024-05-16 18:02:10.174 UTC [14] LOG:  database system was shut down at 2024-05-16 18:02:08 UTC
mag 16 20:02:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: 2024-05-16 18:02:10.177 UTC [1] LOG:  database system is ready to accept connections
mag 16 20:21:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: 2024-05-16 18:21:10.916 UTC [1] LOG:  could not open file "postmaster.pid": No such file or directory
mag 16 20:21:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: 2024-05-16 18:21:10.916 UTC [1] LOG:  performing immediate shutdown because data directory lock file is invalid
mag 16 20:21:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: 2024-05-16 18:21:10.916 UTC [1] LOG:  received immediate shutdown request
mag 16 20:21:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: 2024-05-16 18:21:10.916 UTC [1] LOG:  could not open file "postmaster.pid": No such file or directory
mag 16 20:21:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: 2024-05-16 18:21:10.917 UTC [18] WARNING:  terminating connection because of crash of another server process
mag 16 20:21:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: 2024-05-16 18:21:10.917 UTC [18] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
mag 16 20:21:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: 2024-05-16 18:21:10.917 UTC [18] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
mag 16 20:21:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: 2024-05-16 18:21:10.917 UTC [19] LOG:  could not open temporary statistics file "pg_stat/global.tmp": No such file or directory
mag 16 20:21:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: 2024-05-16 18:21:10.919 UTC [1] LOG:  database system is shut down

Trying to run psql -h 10.62.0.1 -U postgres and create the initial schema with psql.

Current Behaviour

psql: error: connection to server at "10.62.0.1", port 5432 failed: Connessione scaduta Is the server running on that host and accepting TCP/IP connections?

Your Environment

  • OS and architecture:
    Apple Silicon M1 Pro with 16GB RAM / 512GB SSD
    UTM 4.5.2 version
    Ubuntu 22.04 for faasd instance and the other vm where i create functions

  • Versions:

go version
not installed

containerd -version
containerd containerd.io 1.6.31 e377cd56a71523140ca6ae87e30244719194a521

uname -a
Linux danieleclient-QEMU-Virtual-Machine 6.5.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May  7 11:19:33 UTC 2 aarch64 aarch64 aarch64 GNU/Linux

cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

faasd version
0.18.8
@alexellis
Copy link
Member

alexellis commented May 16, 2024

These instructions have been tested extensively. There are a few important steps outlined that must be followed carefully, if you miss one, you would perhaps receive an error like this.

The logs are quite hard to read, it seems like they've been put all on one line? You should use three backticks instead of one.

mag 16 20:21:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: 2024-05-16 18:21:10.916 UTC [1] LOG:  could not open file "postmaster.pid": No such file or directory
mag 16 20:21:10 danieleserver-QEMU-Virtual-Machine openfaas:postgresql[6079]: 2024-05-16 18:21:10.916 UTC [1] LOG:  performing immediate shutdown because data directory lock file is invalid

This implies the mounts may be incorrect or not owned by the correct user. It might make sense to remove the directories and start over.

I'll also ask one or two people if they have time to try out this section to compare with what they see.

@alexellis
Copy link
Member

alexellis commented May 16, 2024

I ran the installer, then followed all the instructions in the eBook and this is what I got:

Screenshot 2024-05-16 at 21 57 43

I'm running Ubuntu 24.04 on amd64 - executed through multipass.

Here's psql running:

Screenshot 2024-05-16 at 22 00 51

I also deleted the directories, and started over then saw that I could update :11 to :16 for the docker-compose.yaml and it also worked.

@DanieleLattaioli
Copy link
Author

This morning in my faasd instance I tried to remove the /var/lib/faasd/postgresql directory and then I restored the docker-compose.yaml to original.
Then I repeated the instructions in the ebook to "Adding a database - Postgresql" , so I've added the code to the docker-compose.yaml, created the /var/lib/faas/postgresql/pgdata dir and /var/lib/faas/postgresql/run dir, etc
When I ran sudo journalctl -t openfaas:postgresql, it showed the same yesterday's logs.
So I've reinstalled faasd on a new vm and start again, and after the procedure the result after sudo journalctl -t openfaas:postgresql is this:
Screenshot 2024-05-17 alle 11 58 05

@alexellis
Copy link
Member

What do you have in /etc/passwd? Can you share it here?

@DanieleLattaioli
Copy link
Author

danieleserver@danieleserver-QEMU-Virtual-Machine:/etc$ cat passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
systemd-network:x:100:102:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:101:103:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
messagebus:x:102:105::/nonexistent:/usr/sbin/nologin
systemd-timesync:x:103:106:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
syslog:x:104:111::/home/syslog:/usr/sbin/nologin
_apt:x:105:65534::/nonexistent:/usr/sbin/nologin
tss:x:106:113:TPM software stack,,,:/var/lib/tpm:/bin/false
uuidd:x:107:116::/run/uuidd:/usr/sbin/nologin
systemd-oom:x:108:117:systemd Userspace OOM Killer,,,:/run/systemd:/usr/sbin/nologin
tcpdump:x:109:118::/nonexistent:/usr/sbin/nologin
avahi-autoipd:x:110:119:Avahi autoip daemon,,,:/var/lib/avahi-autoipd:/usr/sbin/nologin
usbmux:x:111:46:usbmux daemon,,,:/var/lib/usbmux:/usr/sbin/nologin
dnsmasq:x:112:65534:dnsmasq,,,:/var/lib/misc:/usr/sbin/nologin
kernoops:x:113:65534:Kernel Oops Tracking Daemon,,,:/:/usr/sbin/nologin
avahi:x:114:121:Avahi mDNS daemon,,,:/run/avahi-daemon:/usr/sbin/nologin
cups-pk-helper:x:115:122:user for cups-pk-helper service,,,:/home/cups-pk-helper:/usr/sbin/nologin
rtkit:x:116:123:RealtimeKit,,,:/proc:/usr/sbin/nologin
whoopsie:x:117:124::/nonexistent:/bin/false
sssd:x:118:125:SSSD system user,,,:/var/lib/sss:/usr/sbin/nologin
speech-dispatcher:x:119:29:Speech Dispatcher,,,:/run/speech-dispatcher:/bin/false
fwupd-refresh:x:120:126:fwupd-refresh user,,,:/run/systemd:/usr/sbin/nologin
nm-openvpn:x:121:127:NetworkManager OpenVPN,,,:/var/lib/openvpn/chroot:/usr/sbin/nologin
saned:x:122:129::/var/lib/saned:/usr/sbin/nologin
colord:x:123:130:colord colour management daemon,,,:/var/lib/colord:/usr/sbin/nologin
geoclue:x:124:131::/var/lib/geoclue:/usr/sbin/nologin
pulse:x:125:132:PulseAudio daemon,,,:/run/pulse:/usr/sbin/nologin
gnome-initial-setup:x:126:65534::/run/gnome-initial-setup/:/bin/false
hplip:x:127:7:HPLIP system user,,,:/run/hplip:/bin/false
gdm:x:128:134:Gnome Display Manager:/var/lib/gdm3:/bin/false
danieleserver:x:1000:1000:danieleserver,,,:/home/danieleserver:/bin/bash
lightdm:x:129:137:Light Display Manager:/var/lib/lightdm:/bin/false
sshd:x:130:65534::/run/sshd:/usr/sbin/nologin

@alexellis
Copy link
Member

Re checking the logs for postgresql.. on a fresh install the image has to be pulled and started up so it may not be there immediately. You should also use the command to browse the faasd logs. The status command only shows the last few lines.

@DanieleLattaioli
Copy link
Author

I've just re-run sudo journalctl -t openfaas:postgresql and sudo journalctl -t openfaas:faasd commands, but there are no entries yet

@alexellis
Copy link
Member

alexellis commented May 17, 2024

The command should be sudo journalctl -u faasd -f - I'll update it in the book.

To simulate it, you can restart the faasd service.

@alexellis
Copy link
Member

This is a multipass VM and it worked immediately, perhaps you could try that if you have Ubuntu on a host system somewhere.

Screenshot 2024-05-17 at 13 19 20

Not sure what's different in your system, but I don't know how to help you further. The example works as expected for me every time I try it.

@DanieleLattaioli
Copy link
Author

I'm trying multipass.
I've created a vm through UTM where i've installed Ubuntu 22.04. Then i've installed multipass, but when i run the multipass launch --name faasd command i receive this
`launch failed: Cannot connect to /var/snap/lxd/common/lxd/unix.socket: QLocalSocket::connectToServer: Invalid name

Please ensure the LXD snap is installed and enabled. Also make sure
the LXD interface is connected via snap connect multipass:lxd lxd.
`
I've also installed multipass in my own Mac, and there it works.
What is the problem for the vm with Ubuntu?

@DanieleLattaioli
Copy link
Author

Now I'm using multipass, but nothing is changed.
When I run sudo journalctl -t openfaas:postgresql and sudo journalctl -t openfaas:faasd there are no entries.
Instead when I run sudo journalctl -u faasd -f this is the output

May 17 18:04:34 faasd faasd[9058]: 2024/05/17 18:04:34 Resolver: "gateway"="10.62.0.17"
May 17 18:04:34 faasd faasd[9058]: 2024/05/17 18:04:34 Resolver: "queue-worker"="10.62.0.18"
May 17 18:04:34 faasd faasd[9058]: 2024/05/17 18:04:34 Resolver: "postgresql"="10.62.0.19"
May 17 18:04:34 faasd faasd[9058]: 2024/05/17 18:04:34 Looking up IP for: "gateway"
May 17 18:04:34 faasd faasd[9058]: 2024/05/17 18:04:34 Proxy from: 0.0.0.0:8080, to: gateway:8080 (10.62.0.17)
May 17 18:04:34 faasd faasd[9058]: 2024/05/17 18:04:34 Looking up IP for: "postgresql"
May 17 18:04:34 faasd faasd[9058]: 2024/05/17 18:04:34 Proxy from: 10.62.0.1:5432, to: postgresql:5432 (10.62.0.19)
May 17 18:04:34 faasd faasd[9058]: 2024/05/17 18:04:34 faasd: waiting for SIGTERM or SIGINT
May 17 18:04:34 faasd faasd[9058]: 2024/05/17 18:04:34 Proxy from: 127.0.0.1:9090, to: prometheus:9090 (10.62.0.16)
May 17 18:07:13 faasd faasd[9058]: 2024/05/17 18:07:13 unable to dial to 10.62.0.19:5432, error: dial tcp 10.62.0.19:5432: connect: no route to host

And

ubuntu@faasd:~$ psql -h 10.62.0.1 -U postgres
psql: error: connection to server at "10.62.0.1", port 5432 failed: server closed the connection unexpectedly
	This probably means the server terminated abnormally
	before or while processing the request.

@openfaas openfaas deleted a comment from DanieleLattaioli May 17, 2024
@alexellis
Copy link
Member

I don't want to copy/paste the instructions from the book here.

As I said, the command was wrong for faasd logs: #362 (comment)

There is a new copy with commands that don't need any editing as 1.14.

@rgee0 is has also done independent testing and I'll let him comment here.

I don't think I can support you any more with this, since it's something with your specific environment, or a missed step. It works for me, and for others. Sorry that I can't really afford to spend more time looking at an individual's setup of Postgresql. It's more of an extra than core functionality.

why not run it on the host directly if you need it?

@rgee0
Copy link
Contributor

rgee0 commented May 17, 2024

I've just run it up on Multipass myself. Worked fine.

Looks like postgres itself is bombing, which if you've got the compose format right points to something possibly in the setup of /var/lib/faasd/postgresql/.

@DanieleLattaioli
Copy link
Author

Is there any possibility of meeting privately to talk freely about the instructions in the book?

@alexellis
Copy link
Member

If you consult the eBook it explains about a weekly meeting where you can come and talk to us and ask questions - https://docs.openfaas.com/community/

As for this Postgresql example, there must be a step you're missing or skipping or something odd in your environment. I've spent collectively 2-3 days supporting you personally with this, and your initial confusion about secrets that we spoke about over email. I can't afford to spend this amount of time supporting users for things which multiple people have tested, and have shown to work. I'm sorry.

The eBook is not about how to run Postgresql inside faasd, that's just bonus material, supplementary. If you can't get it to work when you should use managed Postgresql or install it directly on your host via apt.

I've also published 1.14 of the eBook which you can get for free, which changes the commands slightly, that may help.

I'd also ask you to read carefully everything I've said. I told you there was a new command to get faasd logs, but you didn't read it and continued to use the old command. You need to follow instructions 1:1 for some of these things or they won't work.

@alexellis
Copy link
Member

If anyone else lands here having issues with the postgresql example, study the commands carefully, it works, multiple people have shown that. If in doubt, start over or install it on the host.

I'm going to lock this issue for future discussion since there is no further action on our part.

@openfaas openfaas locked as resolved and limited conversation to collaborators May 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants