After Deploy App is not connecting to postgres anymore - postgresql

after deploying my changes to heroku my strapi app isn't starting anymore.
[2020-11-10T15:47:29.476Z] debug :no_entry:️ Server wasn't able to start properly.
2020-11-10T15:47:29.479699+00:00 app[web.1]: [2020-11-10T15:47:29.479Z] error error: password authentication failed for user "xxxxxxxxxxxxx"
Checked the ENVs everything looks fine but it is not working.
I saw that postgresql updated my database, since that point it is broken.
heroku-postgresql: Update DATABASE by heroku-postgresql
Today at 4:22 PM · v34
Please help me can´t do anything rn.

Related

Strapi instalation has error: connect ECONNREFUSED 127.0.0.1:5432

I just install Strapi but with PostgreQL DB (not using -- quickstart which means SQLite)
1. yarn create strap'-app name-of-my-project,
2. submit all QA=default step-by-step (database=strapi, port=default, login/password nothing fancy, and last without SSL connection)
And the finall result is not so descriptive. Only server error with connecting, which I don't know
Connection test failed: connect ECONNREFUSED 127.0.0.1:5433
Problem solved! (after 2 hours of trying instalation)
The answer is => You have to install PostgreSQL DB too on your computer
Once its done, next, you can run Strapi by yarn develop
So the problem is solved. Other problem in meantime solved
`Server wasn't able to start properly. Error: The server does not support SSL connections. Try to install without SSL connection (last question in Strapi install process)
I know you resolved the issue but just posting this in case anybody needs specific instructions.
I followed this tutorial and it's working for me now.
Sidenote: Once I installed Postgres and ran the command psql postgres it prompted me to enter my password. Despite putting in the correct password it still gave me an error that it is the wrong password, so I ran psql postgres postgres and then entering my password resolved the issue for me.
Instead of downloading postgres you can apply docker and it works the same
Link: https://blog.dehlin.dev/docker-with-strapi-v4
I had the same problem and as Kris says above, you need to install postgresql, pgAdmin and create the database first to then can create your Strapi project linked to you database.
I followed this youtube tutorial (in spanish) to solve it very easy.
Also need to avoid enable SSL for your local project. If you need to change this option in the future you can make it in the strapi config/database.js file.
Good luck!

Postgres DB stuck in recovery mode

I have an application build with RoR and on Postgres db on separate server (VM with Linux red hat).
I am facing an issue with the db, it suddenly is stuck in the recovery mode, and I can’t access it even from the server console.
The only way is to restart the whole server and again it works fine.
Error details:
Exception
PG::ConnectionBad
Error
FATAL: the database system is in recovery mode
Please any advise for this issue?

Cannot connect to Heroku MongoDB

I created an Ionic app with NodeJS backend and Mongo database and deployed it to Heroku (with mLab MongoDB add-on). It worked well for a day. The next day I was unable to connect to the DB. The app went to sleep in the meantime, but when I opened it in the browser it woke up. I know that because I saw the static text that I put on the index page. But a few seconds later, an error page appeared. From the console and network tabs output I could figure out that the app is unable to access the database and to fetch data.
I found a post on the internet where the author said that he had the same issue and that he deleted the db instance on Heroku and created a new one. So I did the same and then I was able to start my app normally again.
Today the same thing happened - I can't connect. When I switch the DB URI in the code to mongodb://localhost/mydbname and run the application locally, it works perfectly, so I concluded that the app code itself is fine, there's only an issue with connecting to the DB. It also wouldn't work locally if I try to target the DB on Heroku.
I thought that I might forgot the credentials, so I went to the Heroku dashboard and changed both the username and the password. Then I tried to connect through the console with mongo ds<number>.mlab.com:<port>/heroku_<name> -u <username> -p <password>. Here's the output:
MongoDB shell version v3.6.3
connecting to: mongodb://ds213239.mlab.com:13239/heroku_d3xjtj3x
2018-03-16T16:09:18.215+0100 W NETWORK [thread1] Failed to connect to 54.236.230.76:13239 after 5000ms milliseconds, giving up.
2018-03-16T16:09:18.216+0100 E QUERY [thread1] Error: couldn't connect to server ds213239.mlab.com:13239, connection attempt failed :
connect#src/mongo/shell/mongo.js:251:13
#(connect):1:6
exception: connect failed
Currently I'm using free version of both hosting and DB add-on, because I want only to test the app and to show it to my client (who will then decide if he wants to pay for the Heroku services). If I have nothing to show and if this happens each time, well, that would suck.
And here's the fun part: I wanted to try to open the app one more time so that I could copy and paste the exact error message here. And this time it worked normally! (???) The only thing I did is that I changed the username and pass on the DB dashboard, but I didn't push the updated code and I also didn't change it in the MONGODB_URI config variable.
Does anyone have an idea why does this happen? Is there a way to keep the DB awake and accessible (without paying extra)?
Thanks.
EDIT: It doesn't work again!!! Literally 30 seconds after submitting this post I tried to access the app again and it didn't work! There is an error page which says:
Error: Uncaught (in promise): [object Object]
at c (http://localhost:8100/build/polyfills.js:3:19752)
at c (http://localhost:8100/build/polyfills.js:3:19461)
at http://localhost:8100/build/polyfills.js:3:20233
at t.invokeTask (http://localhost:8100/build/polyfills.js:3:15660)
at Object.onInvokeTask (http://localhost:8100/build/vendor.js:4973:33)
at t.invokeTask (http://localhost:8100/build/polyfills.js:3:15581)
at r.runTask (http://localhost:8100/build/polyfills.js:3:10834)
at o (http://localhost:8100/build/polyfills.js:3:7894)
at e.invokeTask [as invoke] (http://localhost:8100/build/polyfills.js:3:16823)
at p (http://localhost:8100/build/polyfills.js:2:27648)
ONE MORE EDIT: I deleted the DB again, created a new one, changed the connection string in my app and pushed the changes. Now it works normally. I'll check again tomorrow and update this post.
NEW EDIT: One day later, the app doesn't connect to the DB again. And again I get the same error message.
Wtf, Heroku???

Heroku Postgres can't connect from heroku app

So I have a go rest api running on Heroku. I had the free tier version but now we have moved the app to production and upgraded to a standard-0 database. None of my code changed the only thing that changed were environmental variables to connect to the database. However, when I try to connect to the database I get this error:
[BRONZE] [5-1] sql_error_code = 28000 FATAL: no pg_hba.conf entry for host "54.234.***.***", user "ub21ndj3*****", database "d8useg2o3****", SSL off
From my understanding its an SSL issue. What I don't understand is my app is running on Heroku servers so I shouldn't need to create a tls config to connect to the database and the same code was working with the previous database. Would there be another issue why I'm getting this error?
Heroku's standard databases and above require SSL connections as of April, 2016. You can see the Changelog entry here. You were able to use the same application code on a hobby database because they do not have the same restriction.

Mean stack deployed successfully on heroku but I get Application Error

I successfully deployed my app to Heroku, Added mLab as my add-on
I also set
heroku config:set MONGOLAB_URI=mongodb://[myusername]:[mypassword]#ds119508.mlab.com:19508/heroku_l1q51vhd
but still I get:
I got the answer. The problem was with authentication. I made new user/pass and it works. You can use Mongochef to check if your connection and authentication with db is correct.