Debug tips

This commit is contained in:
Jokob-sk
2023-07-18 08:06:32 +10:00
parent 536d789535
commit 98fb02282b
2 changed files with 22 additions and 14 deletions

View File

@@ -1,23 +1,17 @@
## More Logging
# Debugging and troubleshooting
Please follow tips 1 - 4 to get a more detailed error.
## 1. More Logging 📃
When debugging an issue always set the highest log level:
`LOG_LEVEL='debug'`
## Check the _dev image and open issues
## 2. Surfacing errors when container restarts 🔁
If possible, check if your issue got fixed in the `_dev` image before opening a new issue. The container is:
`jokobsk/pi.alert_dev:latest`
> ⚠ Please backup your DB and config beforehand!
Please also search [open issues](https://github.com/jokob-sk/Pi.Alert/issues).
## Surfacing errors when container restarts
Start the container via the terminal with a command similar to this one:
Start the container via the **terminal** with a command similar to this one:
```bash
docker run --rm --network=host \
@@ -31,7 +25,17 @@ docker run --rm --network=host \
> ⚠ Please note, don't use the `-d` parameter so you see the error when the container crashes. Use this error in your issue description.
## Disable restart behavior
## 3. Check the _dev image and open issues ❓
If possible, check if your issue got fixed in the `_dev` image before opening a new issue. The container is:
`jokobsk/pi.alert_dev:latest`
> ⚠ Please backup your DB and config beforehand!
Please also search [open issues](https://github.com/jokob-sk/Pi.Alert/issues).
## 4. Disable restart behavior 🛑
To prevent a Docker container from automatically restarting in a Docker Compose file, specify the restart policy as `no`:

View File

@@ -30,6 +30,8 @@ def timeNowTZ():
def updateState(db, newState):
# ?? Why is the state written to the DB?
# The state is written to the DB so the front-end can use the value to display the current state in the header of the app
# The Parameters DB table is used to communicate with the front end.
#sql = db.sql
@@ -63,6 +65,8 @@ def checkPermissionsOK():
dbR_access = (os.access(fullDbPath, os.R_OK))
dbW_access = (os.access(fullDbPath, os.W_OK))
mylog('none', ['\n'])
mylog('none', ['The container restarted (started). If this is unexpected check bit.ly/PiAlertDebug for troubleshooting tips.'])
mylog('none', ['\n'])
mylog('none', ['Permissions check (All should be True)'])
mylog('none', ['------------------------------------------------'])