"password authentication for user" after clicking on Heroku

I followed the heroku documentation to install the django application and it worked fine at first. A day later, I pushed some changes on the server. After that, I was unable to access the application at all: FATAL: password authentication failed for user "drjstoymyqyarj"

I can no longer sync db:

 $ heroku run python manage.py syncdb Running `python manage.py syncdb` attached to terminal... up, run.1 Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line utility.execute() File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv self.execute(*args, **options.__dict__) File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute output = self.handle(*args, **options) File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/base.py", line 371, in handle return self.handle_noargs(**options) File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 57, in handle_noargs cursor = connection.cursor() File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/backends/__init__.py", line 306, in cursor cursor = self.make_debug_cursor(self._cursor()) File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 177, in _cursor self.connection = Database.connect(**conn_params) File "/app/.heroku/venv/lib/python2.7/site-packages/psycopg2/__init__.py", line 179, in connect connection_factory=connection_factory, async=async) psycopg2.OperationalError: FATAL: password authentication failed for user "drjstoymyqyarj" FATAL: password authentication failed for user "drjstoymyqyarj" 

I used the database settings recommended in the heroku document:

 import dj_database_url DATABASES = {'default': dj_database_url.config(default='postgres://localhost')} 

When I check the logs after pushing the code to the server, there is a suspicious Process exited with status 143 , which I had not noticed before. Maybe something is connected with this?

 $ heroku logs heroku[web.1]: State changed from up to starting heroku[web.1]: Stopping all processes with SIGTERM heroku[web.1]: Starting process with command `python ./manage.py runserver 0.0.0.0:41048 --noreload` app[web.1]: Validating models... app[web.1]: app[web.1]: 0 errors found app[web.1]: Django version 1.4, using settings 'ClosetList.settings' app[web.1]: Development server is running at http://0.0.0.0:41048/ app[web.1]: Quit the server with CONTROL-C. heroku[web.1]: Process exited with status 143 heroku[web.1]: State changed from starting to up 

[change]
A similar msg error with heroku pg:psql . However, I can open the Django shell with heroku run python manage.py shell , but I cannot access any data from it (of course, the same error).
[/ Edit]

any help with this is appreciated.

+7
source share
1 answer

Run

 heroku config 

and check if more than two dbs heroes are configured, and also check if your configured DB indicates DATABASE_URL. If not, then you can promote your default db DATABASE_URL by running:

 heroku pg:promote HEROKU_POSTGRESQL_GREEN 

Where HEROKU_POSTGRESQL_GREEN is your database name, you will see HEROKU_POSTGRESQL_GREEN_URL in your configuration.

Once your customized database is transferred to the default database, you are ready to go.

+10
source

All Articles