1
votes

I have a Rails 5 app that I have uploaded to Heroku. I have the lowest PostgreSQL plan (hobby-dev 10,000 rows). I followed the Import instructions on this link.

When I attempt to run my app I get a relation "xxxx" does not exist error with a 500 Internal Server Error. When I checked the data section for my app none of my databases appear. I tried again to execute the following command from my multiple AWS S3 database dumps. Every time I did a refresh command on the data page it looked like the counts were increasing but when everything was done none of my databases appeared. No errors appeared in my terminal or in the data section so I assumed the databases were not there.

heroku pg:backups:restore 'https://s3.amazonaws.com/me/items/3H0q/mydb.dump' DATABASE_URL

I received an email stating that I have about 80% of the allocated rows for my plan so they are somewhere. I've done heroku restart but still cannot access them. I don't know where to find/access the databases or where to go from here.

Output of heroku run rails c:

[xxxxxxxxxx (master)]$ heroku run rails c
Running rails c on ⬢ xxxxxxxx... up, run.4346 (Free)
Loading production environment (Rails 5.0.1)
irb(main):001:0> 
2
what happens when you run heroku run rails c?user2954587
try loading your models....User.first. Can you?user2954587
I just updated my question with the output. It gets to my Rails app but the first thing it does is check a database login on model User. That is where the app crashes with the "relation 'user' does not exist". I have no problems running it on my local machine. It's just when it's uploaded to Heroku. Where can I see my databases in Heroku?Pamela Cook - LightBe Corp
@AnnaS Please post your comment as an answer and I will check it. I will explain what happened on your answer.Pamela Cook - LightBe Corp

2 Answers

0
votes

DATABASE_URL represents the HEROKU_POSTGRESQL_COLOR_URL of the database you wish to restore to. Did you do this? => You must specify a database configuration variable to restore the database.

0
votes

Did you migrate your database in heroku? It might be the issue.

heroku run rake db:migrate

Anytime you want to migrate/seed or use any rake command on heroku, you need to heroku run it.