Bug description
The startup procedure introduced in commit 8f105d9 requires users to run two separate commands:
docker compose up -d
docker compose exec web ./manage.py setup-powersync-storage
However, the first command starts PowerSync before its required PostgreSQL role and schema have been created. As a result, PowerSync can initially fail, after which the user must run the second command to initialize its storage.
This could look like a not clear or reliable setup procedure: an error during the first documented step appears to indicate that the deployment failed, even though the user is expected to continue with the next step.
The numbered bullet points in the README are also misleading because they suggest a straightforward sequence of successful setup steps. They do not explain that PowerSync may fail during the first step or that the second command is required to recover from that state.
Steps to reproduce
-
Set up a fresh wger Docker installation.
-
Run:
-
Check the PowerSync service and its logs.
-
Observe that PowerSync can fail because its database role and schema do not exist.
-
Run the separately documented initialization command:
docker compose exec web ./manage.py setup-powersync-storage
-
Restart or wait for the affected service to recover.
Expected behavior
A fresh installation should have a clear, reliable startup procedure that requires only:
The required PowerSync database role and schema should be initialized automatically before PowerSync starts. Users should not encounter an expected error as part of the documented setup process.
Actual behavior
The documented procedure requires two commands.
The first command starts PowerSync before its storage has been initialized, so the service can fail. The user must then run a second command to create the required database objects.
The README presents these commands as ordinary sequential steps without making the intermediate failure clear, resulting in a confusing and misleading setup experience.
Proposed fix
Add a one-shot powersync_init service that:
- Waits for PostgreSQL to become healthy.
- Runs
./manage.py setup-powersync-storage.
- Completes successfully before the
powersync service starts.
Update the README to:
- Document
docker compose up -d as the complete startup procedure.
- Remove the separate manual initialization step.
- Remove the misleading numbered bullet points.
- Explain that the
powersync_init service initializes the required database role and schema automatically.
Acceptance criteria
Bug description
The startup procedure introduced in commit 8f105d9 requires users to run two separate commands:
However, the first command starts PowerSync before its required PostgreSQL role and schema have been created. As a result, PowerSync can initially fail, after which the user must run the second command to initialize its storage.
This could look like a not clear or reliable setup procedure: an error during the first documented step appears to indicate that the deployment failed, even though the user is expected to continue with the next step.
The numbered bullet points in the README are also misleading because they suggest a straightforward sequence of successful setup steps. They do not explain that PowerSync may fail during the first step or that the second command is required to recover from that state.
Steps to reproduce
Set up a fresh wger Docker installation.
Run:
docker compose up -dCheck the PowerSync service and its logs.
Observe that PowerSync can fail because its database role and schema do not exist.
Run the separately documented initialization command:
docker compose exec web ./manage.py setup-powersync-storageRestart or wait for the affected service to recover.
Expected behavior
A fresh installation should have a clear, reliable startup procedure that requires only:
docker compose up -dThe required PowerSync database role and schema should be initialized automatically before PowerSync starts. Users should not encounter an expected error as part of the documented setup process.
Actual behavior
The documented procedure requires two commands.
The first command starts PowerSync before its storage has been initialized, so the service can fail. The user must then run a second command to create the required database objects.
The README presents these commands as ordinary sequential steps without making the intermediate failure clear, resulting in a confusing and misleading setup experience.
Proposed fix
Add a one-shot
powersync_initservice that:./manage.py setup-powersync-storage.powersyncservice starts.Update the README to:
docker compose up -das the complete startup procedure.powersync_initservice initializes the required database role and schema automatically.Acceptance criteria
docker compose up -d.powersync_initwaits for a healthy PostgreSQL service.docker compose config --quietsucceeds.