flobz / psa_car_controller

Control psa car with connected_car v4 API.
GNU General Public License v3.0
391 stars 199 forks source link

Docker loses parts of the data on restart #236

Closed JHCD closed 2 years ago

JHCD commented 2 years ago

Describe the bug I have installed the current latest version (20.09.2021) of the Docker image on my server. The initial setup worked as expected.

Only every time I restart the Docker, part of the configuration is reset. In addition to the manual re-login to PSA, settings in the config are also lost (ABRP and weather token are set to null). ABRP can be added again via the URL, but the weather token is never taken into account, as it is set to null directly on restart. And if I have to enter the otp data again, why then in the terminal and not on the website?

To Reproduce Steps to reproduce the behavior:

  1. Start docker container
  2. Set-Up the config
  3. Restart docker

Environment (please complete the following information):

flobz commented 2 years ago

Hello, Can you provide your docker command?

JHCD commented 2 years ago

Command: /bin/sh -c /psa_car_controller/docker_files/init.sh

Envs:

flobz commented 2 years ago

No the command you use to start the container.

JHCD commented 2 years ago

I don't know where to see what QNAP is doing as a command. The docker container is configured in the UI and started transparently in the background.

JHCD commented 2 years ago

I still had an idea that it was due to the changing IP address. But also with a fixed IP I have the same behavior. The log file always begins with the following lines, after which the settings for ABRP and weather are gone. The vehicle history is also not immediately available again.

2021-10-07 09:17:25,066 :: WARNING :: Can't get car model, please report an issue on github with your car model and first ten letter of your VIN : VXEVEEHZ8L
2021-10-07 09:17:35,108 :: ERROR :: Can't refresh token HTTPSConnectionPool(host='idpcvs.opel.com', port=443): Max retries exceeded with url: /am/oauth2/access_token (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f67ba30d0f0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))
2021-10-07 09:17:35,110 :: INFO :: save config change
2021-10-07 09:17:35,176 :: WARNING :: Can't get language
2021-10-07 09:17:37,114 :: INFO :: update_data

The unknown model is another vehicle in my account (see discussion).

flobz commented 2 years ago

You need to create a docker volume to save a config. Please look how docker works.

JHCD commented 2 years ago

Of course I have set up a corresponding Docker volume. Otherwise my configuration would not be overwritten.

JHCD commented 2 years ago

I found a "solution", I added sleep 30 in init.sh and the server starts as expected now.

mhellmeier commented 8 months ago

Similar problem here. @flobz : Maybe you could have a look again into it?