Comments (16)
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.
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](https://private-user-images.githubusercontent.com/6358735/331381864-957054c8-6042-4fd0-8a7d-3346436d3e6a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3NDMwNDMsIm5iZiI6MTcyMTc0Mjc0MywicGF0aCI6Ii82MzU4NzM1LzMzMTM4MTg2NC05NTcwNTRjOC02MDQyLTRmZDAtOGE3ZC0zMzQ2NDM2ZDNlNmEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjNUMTM1MjIzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NmQwMDZiN2ZlMTQ2YjdlZWEzOTk1YWY5MGJjM2NmYjAzNGUwMzlmY2RmYzQ5YTJmOTIzZmVmMTE3NmYzZWU4ZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Yk-UojDwmPfnIvhgX3znPE8Jd9MqllMrQ7gPBsYPnxg)
I'm running Ubuntu 24.04 on amd64 - executed through multipass.
Here's psql running:
![Screenshot 2024-05-16 at 22 00 51](https://private-user-images.githubusercontent.com/6358735/331383303-1c3e89d1-2fee-4814-8190-e7fbef57d721.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3NDMwNDMsIm5iZiI6MTcyMTc0Mjc0MywicGF0aCI6Ii82MzU4NzM1LzMzMTM4MzMwMy0xYzNlODlkMS0yZmVlLTQ4MTQtODE5MC1lN2ZiZWY1N2Q3MjEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjNUMTM1MjIzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MGUxNDNmZmY1MDJiODgxZGI0ZjU4MDRlOTYzNGQzOGQxOWUyZTMxYTk4NTkyMTY3OTRjZTllMjdiMzM1ODlmNiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.yyWeClIU5c9Eayf7Ficpd7NqZPXRqUsdU61WnjB3tDw)
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.
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:
from faasd.
What do you have in /etc/passwd
? Can you share it here?
from faasd.
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.
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.
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.
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.
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](https://private-user-images.githubusercontent.com/6358735/331590782-dd5a9bf2-5339-420d-a306-feb5441378a7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3NDMwNDMsIm5iZiI6MTcyMTc0Mjc0MywicGF0aCI6Ii82MzU4NzM1LzMzMTU5MDc4Mi1kZDVhOWJmMi01MzM5LTQyMGQtYTMwNi1mZWI1NDQxMzc4YTcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjNUMTM1MjIzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjFkYzNkYWJhYzY0NWEyYmFjZTJhZjQxZWEyNzZiN2RlM2QxOTkxNjA1ZGMwOGU5ODU0YjRiOGI5OWJmNWVjOCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.FPr6X09dAY9naJVqLWLWGLO-cx2_Jxzm2cAgJTEKW-w)
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.
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.
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.
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.
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.
Is there any possibility of meeting privately to talk freely about the instructions in the book?
from faasd.
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.
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)
- Issues with rust HOT 1
- Access host's network from a docker-compose.yaml's service HOT 5
- Support request for Docker installed with faasd (invalid) HOT 5
- Can docker-compose be used with faasd? HOT 8
- Support question on MQTT HOT 4
- Executing install.sh fails because of wrong version HOT 1
- Grafana installation - volume permissions HOT 2
- Multi-node support HOT 3
- Support request for monitoring with cAdvisor HOT 6
- NATS JetStream support HOT 2
- disable printing function invocation duration
- Terrraform install fails on macOS Sonoma HOT 2
- faasd and faasd provider in different ports HOT 1
- faasd namespace support openfaas=true instead of openfaas=1
- Is Scale to Zero included in the Community Edition of OpenFaaS? HOT 8
- support faasd get HOT 1
- MemoryLimit needs changing to: MemoryMax
- Deprecate 32-bit Arm support HOT 1
- Additional property postgresql is not allowed HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faasd.