Webserver becomes unreachable within the day
Describe the bug After some time the server isn't reachable anymore. Also HA is not able to retrieve or send any information to the server.
To Reproduce Steps to reproduce the behavior:
-
what command did you use No specific command, it just occurs after a while
-
when the bug append ? Don't know, a while already
-
Does it persist after restarting the program? After restarting server is reachable both in browser and via HA. But after some time it is unreachable, browser goes into time out.
-
Does it persist after recreate config by going to http://server_address:port/config? Yes.
Config file Give the anonymize content of the config file
Environment (please complete the following information):
- OS: [e.g. Windows]: Linux - Running in docker container managed by portainer
- Brand and model of car: Peugeot E208
- Application version (commit number, branch or tag): 3.5.3
- Log from http://server_address:port/log and browser console log Can post the log but nothing special is shown as connection to the car still works. But no incoming traffic from my home network.
Additional context Already reinstalled and repulled the whole image, so I am a bit lost what to do.
I have the same problem i think. Need to manually restart the service because it stops working after "some days"
@grendyx
I have now incoorporated in my docker compose file a health check that checks if the webserver is still reachable. If it isnt reachable it will put the container to "unhealthy". Autoheal (another container) guards all containers and restarts unhealthy containers. In that way it is automatically rebooted, not really tidy but at least it works.
See below the restarts of the service:
@grendyx
I have now incoorporated in my docker compose file a health check that checks if the webserver is still reachable.
If it isnt reachable it will put the container to "unhealthy".
Autoheal (another container) guards all containers and restarts unhealthy containers.
In that way it is automatically rebooted, not really tidy but at least it works.
See below the restarts of the service:
Could you share your docker compose file. I'd like to do the same.
Do I need to do anything or should your magic do the trick? I'm just a user and don't know anything about dockers or coding etc :D.. Everything has worked for at least for a few days without restarting!
@wormvortex see code below:
name: psa_car_controller services: psa_car_controller: tty: true stdin_open: true container_name: peugeot_psa_car_controller ports: - 5000:5000 volumes: - psa_data:/config restart: unless-stopped image: flobz/psa_car_controller labels: - "autoheal=true" healthcheck: test: curl --fail http://localhost:5000 || exit 1 interval: 60s retries: 3 start_period: 90s timeout: 15s
volumes: psa_data: external: true
Can't get the formatting right here, but at least you can copy
Same for me. Are there any new findings?
@wormvortex see code below:
name: psa_car_controller services: psa_car_controller: tty: true stdin_open: true container_name: peugeot_psa_car_controller ports: - 5000:5000 volumes: - psa_data:/config restart: unless-stopped image: flobz/psa_car_controller labels: - "autoheal=true" healthcheck: test: curl --fail http://localhost:5000 || exit 1 interval: 60s retries: 3 start_period: 90s timeout: 15s
volumes: psa_data: external: true
Can't get the formatting right here, but at least you can copy
Finally got round to trying this and can't get it to work. Not sure if it's my formatting. I'm getting either `services.healthcheck Additional property interval is not allowed' or '(root) Additional property healthcheck is not allowed'
try:
healthcheck:
test: ['CMD-SHELL', 'curl --fail http://localhost:5000 || exit 1']
interval: 60s
retries: 3
start_period: 90s
timeout: 15s
try:
healthcheck: test: ['CMD-SHELL', 'curl --fail http://localhost:5000 || exit 1'] interval: 60s retries: 3 start_period: 90s timeout: 15s
That worked. Thanks!
If you want to use docker compose or stack you can use the following code:
services:
psa_car_controller:
container_name: peugeot_psa_car_controller
image: flobz/psa_car_controller
tty: true
stdin_open: true
ports:
- "5000:5000"
volumes:
- psa_data:/config
restart: unless-stopped
labels:
- "autoheal=true"
healthcheck:
test: ['CMD-SHELL', 'curl --fail http://localhost:5000 || exit 1']
interval: 60s
retries: 3
start_period: 90s
timeout: 15s
volumes:
psa_data:
try: healthcheck: test: ['CMD-SHELL', 'curl --fail http://localhost:5000 || exit 1'] interval: 60s retries: 3 start_period: 90s timeout: 15s
That worked. Thanks!
In my case I also had to add the 'autoheal' label and the autoheal service, but maybe the users above already had that added. Anyway, I had to add the following additions to my docker-compose.yml.
version: '3' services:
autoheal: image: willfarrell/autoheal:1.2.0 restart: always volumes: - /var/run/docker.sock:/var/run/docker.sock environment: - AUTOHEAL_CONTAINER_LABEL=autoheal` and: psa service ... labels: - "autoheal=true" healthcheck: test: ['CMD-SHELL', 'curl --fail http://localhost:5000 || exit 1'] interval: 30s timeout: 10s retries: 3
But this should just be a temporary workaround.
Is anyone already working on a resolution? If not I can try to fix it (not very familiar with python yet though), but before I spend time on it, is this project still active and open for merge requests @flobz?