Fatal error: No default database configured - postgresql

When I try to do a migration of my database in heroku using vapor I get the following error when I run heroku run Run -- migrate --env production
FluentKit/Databases.swift:160: Fatal error: No default database configured.
I execute heroku config and created a database before migration.
Local migration works for me without problem. From a database management software if I can access the database without problem.
Thanks

Related

can't restore odoo database in the same environment?

I am tried to take a backup from my odoo 12 server and this was done correctly, immediately I am trying to restore it again, and I found this error
Database restore error: Postgres subprocess ('/usr/bin/pg_restore', '--dbname=database_name', '--no-owner', '/tmp/tmp2bohi3ne') error 1
odoo installed and running with docker-compose
so how can I restore it again

'Yarn Prisma Migrate Dev' fails with Error: P1000 stating the credentials provided are not valid. These credentials work on all other machines

Whenever I run the command yarn prisma migrate dev --preview-feature or just yarn prisma migrate dev I receive:
Error: P1000: Authentication failed against database server at `localhost`, the provided database credentials for `dbusername` are not valid.
The exact same setup and credentials on all other machines work so I know it doesn't have to do with the credentials. This is using a PostgreSQL database on Docker, with the prisma seed and schema in VS Code.
It possibly that the credentials are not actually being checked since I don't see any failed attempts show up in the log on the Docker side of things. Any ideas on how to resolve this or that I need to provide more info?

Error while using pg:push to a Heroku PostgreSQL database

I'm trying to push a local PostgreSQL database to one I've created on a Heroku app. To set up the Heroku database, I ran heroku addons:create heroku-postgresql:hobby-dev -a jasons-react-jobly-app, where jasons-react-jobly-app is the name of my Heroku app.
Then I ran heroku pg:push jobly DATABASE_URL -a jasons-react-jobly-app, where jobly is the name of my local database.
This throws the below error:
heroku-cli: Pushing jobly ---> postgresql-animate-30221
case
------------------------------------
0.9992547478473790.999254747847379
(1 row)
! Cannot read property 'includes' of undefined
The error looks like an error that JavaScript throws when it tries to read properties of an undefined object or something, but I'm not sure where that would be happening in this database push. The app runs completely fine on my local machine with no errors. There is no case column in any of my database tables, so I'm not sure where that number is coming from either.
Also, if I check my Heroku config variables with heroku config, I see:
DATABASE_URL: postgres://iqawqkjfiybndd:c3e921131c239ccd6c880ad4b601deeaa4558339a90ebedc562a5575c9099f42#ec2-54-156-85-145.compute-1.amazonaws.com:5432/dul2u6r13aq5i
So I know the database exists.
Any help with solving this error?
You need to fetch the name of the DB that you see attached to the heroku app on heroku dashboard.
At this url https://dashboard.heroku.com/apps/{put-your-app-name-here}/resources
To get all app names in heroku cli do heroku apps and you will know which app's DB name you want from its dashboard.
Once you have the name of the DB (it will look like this "postgresql-pointy-81624")
use that name in the command to push local db to that db on heroku .
Here are steps to make sure everything works correctly
1- Check the connectivity to the heroku db first by doing
heroku pg:psql postgresql-[somedb name as found above] --app {your-app-name}
2- If it says to reset the DB and you can afford to reset then reset it using
heroku pg:reset -a {your-app-name}
3- Lastly do the migration of DB using this command
heroku pg:push jobly postgresql-[db name found above] -a {your-app-name}
if everything works as expected you will see this message
heroku-cli: Pushing complete.

Heroku Postgresql Database

I have created database in heroku hobby-dev and uploaded table from postgresql and used app.db.create_all() to trigger database model but its showing psycopg2 wheel package will be renamed from release 2.8 and suggesting us to install psycopg2-binary and we installed that too and still app.db.create_all() not working.
The error doesn't relate to database Integration. There should be some error in Backend that's why It's giving 500.
For checking the error in heroku logs using heroku cli, use this :
heroku logs -t
Alternatively, you can view the logs on the App dashboard.
I hope this helps.

newly installed postgres startup error

I have installed postgres & also started the server. But, when I tried to start console using psql, I'm getting error like database "****"(any database) does not exists. How to resolve this error?? I don't have acces to psql shell. And is there other way to create or change startup database without accessing psql.