Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webserver becomes unreachable within the day #961

Open
R-dehaan opened this issue Sep 19, 2024 · 9 comments
Open

Webserver becomes unreachable within the day #961

R-dehaan opened this issue Sep 19, 2024 · 9 comments

Comments

@R-dehaan
Copy link

R-dehaan commented Sep 19, 2024

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:

  1. what command did you use
    No specific command, it just occurs after a while

  2. when the bug append ?
    Don't know, a while already

  3. 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.

  4. 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.

@R-dehaan R-dehaan changed the title Webserver becomes unreachable, whilst still receiving car data Webserver becomes unreachable within the day Sep 21, 2024
@grendyx
Copy link

grendyx commented Sep 23, 2024

I have the same problem i think. Need to manually restart the service because it stops working after "some days"

@R-dehaan
Copy link
Author

R-dehaan commented Sep 23, 2024

@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:
image

@wormvortex
Copy link

@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:

image

Could you share your docker compose file. I'd like to do the same.

@grendyx
Copy link

grendyx commented Sep 27, 2024

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!

@R-dehaan
Copy link
Author

R-dehaan commented Sep 27, 2024

@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

@soulcrash14
Copy link

Same for me. Are there any new findings?

@wormvortex
Copy link

wormvortex commented Nov 20, 2024

@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'

@kurim
Copy link
Contributor

kurim commented Nov 20, 2024

try:

    healthcheck:
      test: ['CMD-SHELL', 'curl --fail http://localhost:5000 || exit 1']
      interval: 60s
      retries: 3
      start_period: 90s
      timeout: 15s

@wormvortex
Copy link

try:

    healthcheck:
      test: ['CMD-SHELL', 'curl --fail http://localhost:5000 || exit 1']
      interval: 60s
      retries: 3
      start_period: 90s
      timeout: 15s

That worked. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants