W
Waspβ€’6mo 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β€’6mo 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β€’6mo ago
Are you able to connect to the database with psql to test it out or when you disable pg boss?
amin
aminOPβ€’6mo 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β€’6mo 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β€’6mo 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β€’6mo ago
TBH I'm not a PostgreSQL expert but it seems your config might be off and needs a bit of adjusting πŸ˜„
amin
aminOPβ€’6mo 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β€’6mo ago
Wohooo @amin, you just became a Waspeteer level 2!
miho
mihoβ€’6mo 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β€’6mo 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β€’6mo ago
this is what I get
miho
mihoβ€’6mo 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β€’6mo ago
It's really strange! because WASP app automatically will pass the connection string to PGboss!
miho
mihoβ€’6mo ago
Have you tried any of the 3 things I mentioned here?
amin
aminOPβ€’6mo ago
Hmm, do you mean stackoverflow?
miho
mihoβ€’6mo 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β€’6mo 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β€’6mo 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β€’6mo ago
Thank you so much I'll do that
miho
mihoβ€’6mo ago
Thank you πŸ™ please report back when you got some sort of an update, we would really appreciate it!
Want results from more Discord servers?
Add your server