Need to check heroku server logs

Priority: High
Request: Need to check heroku server logs so that i can debug the issue we are facing during testing on staging server,
Also need to do migrations on staging server:
docker-compose exec web python3 manage.py makemigrations docker-compose exec web python3 manage.py migrate
Project: ex-curator-18446
staging link: https://ex-curator-18446-staging.herokuapp.com/

Hello, @farzpal.singh.

The migrations are run during a release phase after each deployment to staging/production with python manage.py migrate - you control that through the release section in your heroku.yml, please read more about it here - Building Docker Images with heroku.yml | Heroku Dev Center

The makemigrations command is supposed to be run only in development, the migration files committed and then the command I posted above runs them in staging/production.

In your staging logs I see the following error that’s occurred the latest:

c 28 05:47:31 ex-curator-18446-staging app/web.1 The above exception was the direct cause of the following exception:
Dec 28 05:47:31 ex-curator-18446-staging app/web.1 Traceback (most recent call last):
Dec 28 05:47:31 ex-curator-18446-staging app/web.1   File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/exception.py", line 34, in inner
Dec 28 05:47:31 ex-curator-18446-staging app/web.1     response = get_response(request)
Dec 28 05:47:31 ex-curator-18446-staging app/web.1   File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py", line 115, in _get_response
Dec 28 05:47:31 ex-curator-18446-staging app/web.1     response = self.process_exception_by_middleware(e, request)
Dec 28 05:47:31 ex-curator-18446-staging app/web.1   File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py", line 113, in _get_response
Dec 28 05:47:31 ex-curator-18446-staging app/web.1     response = wrapped_callback(request, *callback_args, **callback_kwargs)
Dec 28 05:47:31 ex-curator-18446-staging app/web.1   File "/opt/webapp/home/views.py", line 24, in home
Dec 28 05:47:31 ex-curator-18446-staging app/web.1     for post in all_posts:
Dec 28 05:47:31 ex-curator-18446-staging app/web.1   File "/usr/local/lib/python3.6/dist-packages/django/db/models/query.py", line 274, in __iter__
Dec 28 05:47:31 ex-curator-18446-staging app/web.1     self._fetch_all()
Dec 28 05:47:31 ex-curator-18446-staging app/web.1   File "/usr/local/lib/python3.6/dist-packages/django/db/models/query.py", line 1242, in _fetch_all
Dec 28 05:47:31 ex-curator-18446-staging app/web.1     self._result_cache = list(self._iterable_class(self))
Dec 28 05:47:31 ex-curator-18446-staging app/web.1   File "/usr/local/lib/python3.6/dist-packages/django/db/models/query.py", line 55, in __iter__
Dec 28 05:47:31 ex-curator-18446-staging app/web.1     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
Dec 28 05:47:31 ex-curator-18446-staging app/web.1   File "/usr/local/lib/python3.6/dist-packages/django/db/models/sql/compiler.py", line 1142, in execute_sql
Dec 28 05:47:31 ex-curator-18446-staging app/web.1     cursor.execute(sql, params)
Dec 28 05:47:31 ex-curator-18446-staging app/web.1   File "/usr/local/lib/python3.6/dist-packages/django/db/backends/utils.py", line 67, in execute
Dec 28 05:47:31 ex-curator-18446-staging app/web.1     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
Dec 28 05:47:31 ex-curator-18446-staging app/web.1   File "/usr/local/lib/python3.6/dist-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
Dec 28 05:47:31 ex-curator-18446-staging app/web.1     return executor(sql, params, many, context)
Dec 28 05:47:31 ex-curator-18446-staging app/web.1   File "/usr/local/lib/python3.6/dist-packages/django/db/backends/utils.py", line 84, in _execute
Dec 28 05:47:31 ex-curator-18446-staging app/web.1     return self.cursor.execute(sql, params)
Dec 28 05:47:31 ex-curator-18446-staging app/web.1   File "/usr/local/lib/python3.6/dist-packages/django/db/utils.py", line 89, in __exit__
Dec 28 05:47:31 ex-curator-18446-staging app/web.1     raise dj_exc_value.with_traceback(traceback) from exc_value
Dec 28 05:47:31 ex-curator-18446-staging app/web.1   File "/usr/local/lib/python3.6/dist-packages/django/db/backends/utils.py", line 84, in _execute
Dec 28 05:47:31 ex-curator-18446-staging app/web.1     return self.cursor.execute(sql, params)
Dec 28 05:47:31 ex-curator-18446-staging app/web.1 django.db.utils.ProgrammingError: relation "posts_perk" does not exist
Dec 28 05:47:31 ex-curator-18446-staging app/web.1 LINE 1: ...rk"."media_size", "posts_perk"."website_url" FROM "posts_per...

Looks like you have an undefined relation, or in fact do need to run the makemigrations locally and commit them.

I encourage you to run fresh builds of your image in Docker Compose locally (docker-compose build --no-cache) before pushing to staging/production to make sure no dependencies and migrations are absent (most common issue).