Debug tips
This commit is contained in:
@@ -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:
|
When debugging an issue always set the highest log level:
|
||||||
|
|
||||||
`LOG_LEVEL='debug'`
|
`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:
|
Start the container via the **terminal** with a command similar to this one:
|
||||||
|
|
||||||
`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:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run --rm --network=host \
|
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.
|
> ⚠ 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`:
|
To prevent a Docker container from automatically restarting in a Docker Compose file, specify the restart policy as `no`:
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ def timeNowTZ():
|
|||||||
def updateState(db, newState):
|
def updateState(db, newState):
|
||||||
|
|
||||||
# ?? Why is the state written to the DB?
|
# ?? 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
|
#sql = db.sql
|
||||||
|
|
||||||
@@ -63,6 +65,8 @@ def checkPermissionsOK():
|
|||||||
dbR_access = (os.access(fullDbPath, os.R_OK))
|
dbR_access = (os.access(fullDbPath, os.R_OK))
|
||||||
dbW_access = (os.access(fullDbPath, os.W_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', ['\n'])
|
||||||
mylog('none', ['Permissions check (All should be True)'])
|
mylog('none', ['Permissions check (All should be True)'])
|
||||||
mylog('none', ['------------------------------------------------'])
|
mylog('none', ['------------------------------------------------'])
|
||||||
|
|||||||
Reference in New Issue
Block a user