W
Wasp-langβ€’3mo ago
amin

PGboss error on Linux server

Hello everyone, does anyone what is this problem when I want to run PGBoss on my server but it is working well on my local, I get this error:
pg-boss failed to start! error: no pg_hba.conf entry for host 10.1.143.190 , user octopus , database wasp_f994d74c_2fa3_4b4c_b3a6_bdaeee9f1ff8_40dd0d3a_28a9_4ea9_a2 , no encryption
20 Replies
kapa.ai
kapa.aiβ€’3mo ago
Hi @amin. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. The error message you're seeing suggests that there's an issue with the pg_hba.conf file, which is a PostgreSQL configuration file. It seems like the host 10.1.143.190 is not allowed to connect to the database wasp_f994d74c_2fa3_4b4c_b3a6_bdaeee9f1ff8_40dd0d3a_28a9_4ea9_a2 with the user octopus. This could be due to a variety of reasons, such as incorrect configuration of the pg_hba.conf file, network issues, or firewall settings. It's also possible that there's a discrepancy between your local and server environments that's causing this issue. Unfortunately, the provided knowledge sources do not contain specific information on how to resolve this issue. I would recommend checking the PostgreSQL documentation or relevant forums for more information on how to configure the pg_hba.conf file correctly. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @amin, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
miho
mihoβ€’3mo ago
Are you able to connect to the database with psql to test it out or when you disable pg boss?
amin
aminβ€’3mo ago
the backend will connect to DB psql via DATABASE_URL well. so when I disable pg boss it connect correctly. only PGboss can't connect
miho
mihoβ€’3mo ago
So, the app works without PG Boss and the psql connects successfully. Hmmm. That quite strange. I'll look into it and report back πŸ‘
miho
mihoβ€’3mo ago
It seems to be related to using/not using SSL [0]. Maybe try adding ?sslmode=require at the end of you DATABASE_URL connection string? Others suggest that it might be an issue of DB and user name differing. Try making them the same or specify the user/db name explicitly. [1] And some other answers suggest you might need to allow the 10.1.143.190 host to connect to the DB. [2] [0]: https://stackoverflow.com/a/59922411 [1]: https://serverfault.com/questions/1105921/why-does-postgres-tell-me-no-pg-hba-conf-entry-for-host-when-i-have-already [2]: https://dba.stackexchange.com/a/314445
Stack Overflow
Node.js, PostgreSQL error: no pg_hba.conf entry for host
I am following this article ((http://nodeexamples.com/2012/09/21/connecting-to-a-postgresql-database-from-node-js-using-the-pg-module/). I have already deployed my app to heroku and currently using
Server Fault
Why does Postgres tell me "no pg_hba.conf entry for host..." when I...
The story so far: I have installed Postgres on my Linux based desktop (HOST). I have created a test database, with test data, on HOST. I have added to the end of the pg_hba.conf file on HOST: host
Database Administrators Stack Exchange
Trouble connecting to a PostgreSQL Database? no pg_hba.conf entry f...
I have a computer I was just given that is hosting a PostgreSQL 14 database on it. On my local computer I have just freshly installed PgAdmin 4. On PgAdmin, I made a new server group named after the
miho
mihoβ€’3mo ago
TBH I'm not a PostgreSQL expert but it seems your config might be off and needs a bit of adjusting πŸ˜„
amin
aminβ€’3mo ago
Thanks for your guide, we have a system that it deploy some instance with different config DATABASE_URL, so I think it does't read DATABASE_URL or something like that
MEE6
MEE6β€’3mo ago
Wohooo @amin, you just became a Waspeteer level 2!
miho
mihoβ€’3mo ago
These two statements are conflicting then:
so I think it does't read DATABASE_URL or something like that
and
the backend will connect to DB psql via DATABASE_URL well. so when I disable pg boss it connect correctly. only PGboss can't connect
πŸ˜„
amin
aminβ€’3mo ago
Yes, I meant when I comment PGboss completely, it connects and doesn't crash the backend app so when I uncomment PGboss, it can't connect to DB. I think I have to set DB on different config for itself or something like that. or it can't at least read DATABASE_URL
amin
aminβ€’3mo ago
this is what I get
miho
mihoβ€’3mo ago
You can debug this yourself if you go to .wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js and add this on the line 8:
console.log(pgBossNewOptions);
console.log(pgBossNewOptions);
You shold see:
[ Server ] connectionString: 'postgresql://postgresWaspDevUser:postgresWaspDevPass@localhost:5432/todoApp-750db0df66'
[ Server ] connectionString: 'postgresql://postgresWaspDevUser:postgresWaspDevPass@localhost:5432/todoApp-750db0df66'
amin
aminβ€’3mo ago
It's really strange! because WASP app automatically will pass the connection string to PGboss!
miho
mihoβ€’3mo ago
Have you tried any of the 3 things I mentioned here?
amin
aminβ€’3mo ago
Hmm, do you mean stackoverflow?
Want results from more Discord servers?
Add your server