FAQ
Common problems and questions

Ghostwriter CLI Reports an Issue with PostgreSQL

You may encounter an issue with PostgreSQL while upgrading an existing installation. Ghostwriter v2.x.x and lower used environment variables stored in files under .envs/.production/.postgres. Beginning with v3.0.0, Ghostwriter no longer uses the .envs/ files and you must transfer your PostgreSQL username and password to the new configuration file.
By default, Ghostwriter CLI generates a random password for a default postgres user. Update the configuration with your Postgres credentials by running these commands:
1
./ghostwriter-cli config set POSTGRES_USER <YOUR USER>
2
./ghostwriter-cli config set POSTGRES_PASSWORD <YOUR PASSWORD>
Copied!
If that does not work or you need to change the credentials, you may do so with the psql tool. First, start the containers even if initialization will fail due to the bad password.
1
docker exec -it ghostwriter_postgres_1 bash
2
psql -U postgres
Copied!
Use the \password command to set a new password for the postgres user:
1
postgres=# \password postgres
2
Enter new password:
3
Enter it again:
4
postgres=# \q
Copied!
If postgres is not your username, change the command to use your chosen username. If you are not sure what the username is, run the \du command:
1
postgres=# \du
2
List of roles
3
Role name | Attributes | Member of
4
-----------+------------------------------------------------------------+-----------
5
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
Copied!
That sets the new password and \q quits the psql console. Set your new password in Ghostwriter's config, and then bring the containers down and back up.
1
./ghostwriter-cli containers down
2
./ghostwriter-cli config set POSTGRES_PASSWORD <NEW PASSWORD>
3
./ghostwriter-cli containers up
Copied!
If the passwords still do not match, you may need to try again. Copy/pasting the password may not work. If you try to paste the new password, you might not be setting the password you expect. It is best to type the password manually.
Copy link