Datepicker redesign + DB connection fixes for Prod

This commit is contained in:
AG
2025-12-18 20:49:34 +02:00
parent 3a8f132b91
commit b6cb3059af
10 changed files with 472 additions and 78 deletions

View File

@@ -142,3 +142,34 @@ Point your domain (e.g., `gym.yourdomain.com`) to the NAS IP and the mapped port
- Forward Hostname / IP: `[NAS_IP]`
- Forward Port: `3033`
- Websockets Support: Enable (if needed for future features).
## 6. Troubleshooting
### "Readonly Database" Error
If you see an error like `Invalid prisma.userProfile.upsert() invocation: attempt to write a readonly database`:
1. **Verify Permissions:** Run the diagnostic script inside your container:
```bash
docker exec -it node-apps node /usr/src/app/gymflow/server/check_db_perms.js
```
2. **Fix Permissions:** If the checks fail, run these commands on your NAS inside the `gymflow/server` directory:
```bash
sudo chmod 777 .
sudo chmod 666 prod.db
```
*Note: SQLite needs write access to the directory itself to create temporary journaling files (`-wal`, `-shm`).*
3. **Check Docker User:** Alternatively, ensure your Docker container is running as a user who owns these files (e.g., set `user: "1000:1000"` in `docker-compose.yml` if your NAS user has that ID).
### "Invalid ELF Header" Error
If you see an error like `invalid ELF header` for `better-sqlite3.node`:
This happens because the `node_modules` contains Windows binaries (from your local machine) instead of Linux binaries.
1. **Fix Inside Container:** Run the following command to force a rebuild of native modules for Linux:
```bash
docker exec -it node-apps /bin/sh -c "cd /usr/src/app/gymflow/server && npm rebuild better-sqlite3"
```
2. **Restart Container:** After rebuilding, restart the container:
```bash
docker-compose restart nodejs-apps
```