-
Notifications
You must be signed in to change notification settings - Fork 206
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
Comments
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.
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. |
What do you have in |
|
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. |
I've just re-run |
The command should be To simulate it, you can restart the faasd service. |
I'm trying multipass. Please ensure the LXD snap is installed and enabled. Also make sure |
Now I'm using multipass, but nothing is changed.
And
|
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? |
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/. |
Is there any possibility of meeting privately to talk freely about the instructions in the book? |
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. |
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. |
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
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:
The text was updated successfully, but these errors were encountered: