W
Wasp•10mo 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
25 Replies
kapa.ai
kapa.ai•10mo 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•10mo ago
Are you able to connect to the database with psql to test it out or when you disable pg boss?
amin
aminOP•10mo 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•10mo 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•10mo 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•10mo ago
TBH I'm not a PostgreSQL expert but it seems your config might be off and needs a bit of adjusting šŸ˜„
amin
aminOP•10mo 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•10mo ago
Wohooo @amin, you just became a Waspeteer level 2!
miho
miho•10mo 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
aminOP•10mo 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
aminOP•10mo ago
this is what I get
miho
miho•10mo 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
aminOP•10mo ago
It's really strange! because WASP app automatically will pass the connection string to PGboss!
miho
miho•10mo ago
Have you tried any of the 3 things I mentioned here?
amin
aminOP•10mo ago
Hmm, do you mean stackoverflow?
miho
miho•10mo ago
Maybe try adding ?sslmode=require at the end of you DATABASE_URL connection string?
Try making them the same or specify the user/db name explicitly.
And some other answers suggest you might need to allow the 10.1.143.190 host to connect to the DB.
amin
aminOP•10mo ago
Ah, yes. ssl isn't required. This IP will connect automatically to DB if I comment PGBoss. Now, I'm passing some like this: PG_BOSS_NEW_OPTIONS='{"connectionString":"postgresql://postgresWaspDevUser:postgresWaspDevPass@localhost:5432/octopus_plugin-27b4e80472","ssl":{"rejectUnauthorized":false}}' but it doesn't work yet
miho
miho•10mo ago
I'd maybe suggest going to the pg-boss repo and creating an issue there: https://github.com/timgit/pg-boss/issues since it seems specific to PgBoss + your setup. I'm not sure I else I can help šŸ¤·ā€ā™‚ļø
GitHub
Issues Ā· timgit/pg-boss
Queueing jobs in Node.js using PostgreSQL like a boss - Issues Ā· timgit/pg-boss
amin
aminOP•10mo ago
Thank you so much I'll do that
miho
miho•10mo ago
Thank you šŸ™ please report back when you got some sort of an update, we would really appreciate it!
ayo
ayo•4mo ago
Any update on this? I'm running into the same issue with AWS. When I use aurora it works fine, but when I use just plain RDS I get this error. I opened a new question before seeing this https://discord.com/channels/686873244791210014/1322388928413700158
MEE6
MEE6•4mo ago
Wohooo @ayo, you just became a Waspeteer level 2!
ayo
ayo•4mo ago
I solved this by adding ?sslmode=no-verify to the db connection string. I think it works for dev phase
Filip
Filip•4mo ago
Glad you got it fixed, but make sure to remove it before production šŸ˜„
ayo
ayo•4mo ago
šŸ˜… definitely

Did you find this page helpful?