Skip to content

Commit 0cf1c72

Browse files
authored
docs: Possible issues during setup (db/supertoken race condition) (#7136)
1 parent db0ccc5 commit 0cf1c72

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

docs/DEVELOPMENT.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,58 @@ Add "user" field to docker-compose.dev.yml
4545
- Click on `Start Hive` in the bottom bar of VSCode
4646
- Open the UI (`http://localhost:3000` by default) and Sign in with any of the identity provider
4747
- Once this is done, you should be able to log in and use the project
48+
49+
#### Possible Issues During Setup
50+
51+
If you encounter an error such as:
52+
53+
```
54+
error: relation "supertokens_*" does not exist
55+
```
56+
57+
it usually means that the **Supertokens database tables** were not initialized correctly.
58+
59+
##### Steps to fix it
60+
61+
1. **Ensure no local PostgreSQL instance is running**
62+
63+
- The local PostgreSQL service on your machine might conflict with the one running in Docker.
64+
- Stop any locally running PostgreSQL service and make sure the database used by Hive is the one
65+
from Docker Compose.
66+
67+
2. **Handle possible race conditions between `db` and `supertokens` containers**
68+
69+
- This issue may occur if `supertokens` starts before the `db` container is fully initialized.
70+
- To fix:
71+
1. Stop all running containers:
72+
```bash
73+
docker compose -f ./docker/docker-compose.dev.yml down
74+
```
75+
2. Start only the database:
76+
```bash
77+
docker compose -f ./docker/docker-compose.dev.yml up db
78+
```
79+
3. Wait until the database is ready (you should see “database system is ready to accept
80+
connections” in logs).
81+
4. Start the `supertokens` service:
82+
```bash
83+
docker compose -f ./docker/docker-compose.dev.yml up supertokens
84+
```
85+
5. Once `supertokens` successfully creates all the tables, start the rest of the containers:
86+
```bash
87+
docker compose -f ./docker/docker-compose.dev.yml up -d
88+
```
89+
90+
3. **If only Supertokens tables were created**
91+
- Run the setup command again to ensure all services are initialized properly:
92+
```bash
93+
pnpm local:setup
94+
```
95+
- Then restart the Hive Console using the VSCode “Start Hive” button.
96+
97+
After completing these steps, reload the Hive UI at [http://localhost:3000](http://localhost:3000),
98+
and you should be able to log in successfully.
99+
48100
- Once you generate the token against your organization/personal account in hive, the same can be
49101
added locally to `hive.json` within `packages/libraries/cli` which can be used to interact via the
50102
hive cli with the registry (Use `http://localhost:3001/graphql` as the `registry.endpoint` value

0 commit comments

Comments
 (0)