question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GW will not start after upgrade, DJANGO cannot find POSTGRES username

See original GitHub issue

Hi all!

I attempted an upgrade from a very old version of GW to the latest and now I can’t get GW to start. Issues I’ve found are:

  • DJANGO did not have the right username/password for PostGres. I noted from the Wiki FAQ that this could be resolved by logging into the POSTGRES docker instance and running psql as postgres to update the password. This not work for me as the user for POSTGRES was different than the defaults, and so I would repeatedly get a “Fatal: role postgres does not exist” error. For anyone else struggling with this, the solution is to locate the username in the “.envs/.production/.postgres” file, and then run docker exec -it ghostwriter_postgres_1 bash and then psql -U <username you just got> -d postgres which will allow you to change/set the password. For me, the username was ‘changeme’

  • DJango will not start (constantly restarts) with the following error displayed when I run docker run -ti --entrypoint /bin/sh ghostwriter_production_django “/entrypoint: line 10: POSTGRES_USER: parameter not set”. I have tried running ./ghostwriter-cli-linux config set POSTGRES_USER <username previously used to login to postgres> and taking the containers up and down with no success. The FAQ says “you must transfer your PostgreSQL username and password to the new configuration file.” When I run ./ghostwriter-cli-linux config I can see that the username and password have been defined correctly and match the ones I previously used to login to POSTGRES

Any debugging I can do to work out why the DJANGO container doesn’t seem to be able to start up?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
SecurityJoncommented, Jul 1, 2022

Yep!

I had to change some file system permissions as I couldn’t upload templates anymore but apart from that all seems to be working correctly.

0reactions
chrismaddalenacommented, Aug 3, 2022

Thanks for sharing, @AnubisSec! I have added an FAQ section in the wiki with an in-depth discussion of transferring the Postgres configuration. Hopefully, that will help anyone running into this in the future.

https://www.ghostwriter.wiki/getting-help/faq#ghostwriter-cli-reports-an-issue-with-postgresql

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrate PostgreSQL ID's from serial to identity after upgrading ...
Django will not migrate any previously created serial columns. Existing databases will thus use identity columns for new tables, whilst ...
Read more >
Not able to connect postgresql with django - Stack Overflow
In my settings file it had uppercase and so Django didn't recognize the database. Doesn't seem to be the issue here, but others...
Read more >
How To Set Up Django with Postgres, Nginx, and Gunicorn on ...
In this guide, you will install and configure some components on Debian 11 to support and serve Django applications. You will be setting...
Read more >
Deploying Django to AWS ECS with Terraform - TestDriven.io
In this tutorial, we'll look at how to deploy a Django app to AWS ECS with Terraform.
Read more >
Docker Compose with Django Apps | Runnable Docker Guides
You need to set your PostgreSQL username and password (at least your password, PostgreSQL defaults to user and database postgres ). Next: Docker...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found