Giter Club home page Giter Club logo

Comments (16)

alexellis avatar alexellis commented on June 26, 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.

from faasd.

alexellis avatar alexellis commented on June 26, 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.

from faasd.

DanieleLattaioli avatar DanieleLattaioli commented on June 26, 2024

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

from faasd.

alexellis avatar alexellis commented on June 26, 2024

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

from faasd.

DanieleLattaioli avatar DanieleLattaioli commented on June 26, 2024
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

from faasd.

alexellis avatar alexellis commented on June 26, 2024

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.

from faasd.

DanieleLattaioli avatar DanieleLattaioli commented on June 26, 2024

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

from faasd.

alexellis avatar alexellis commented on June 26, 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.

from faasd.

alexellis avatar alexellis commented on June 26, 2024

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.

from faasd.

DanieleLattaioli avatar DanieleLattaioli commented on June 26, 2024

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?

from faasd.

DanieleLattaioli avatar DanieleLattaioli commented on June 26, 2024

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.

from faasd.

alexellis avatar alexellis commented on June 26, 2024

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?

from faasd.

rgee0 avatar rgee0 commented on June 26, 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/.

from faasd.

DanieleLattaioli avatar DanieleLattaioli commented on June 26, 2024

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

from faasd.

alexellis avatar alexellis commented on June 26, 2024

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.

from faasd.

alexellis avatar alexellis commented on June 26, 2024

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.

from faasd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.