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

Peugeot: AttributeError: 'NoneType' object has no attribute 'embedded' on new login // The connection was refused. #946

Open
Apollon77 opened this issue Sep 2, 2024 · 5 comments

Comments

@Apollon77
Copy link
Contributor

Apollon77 commented Sep 2, 2024

Describe the bug
When doing a new login with 3.5.3 I got the following error after entering the oauth code from web dev tools

psacc-1  | 2024-09-02 14:40:40,881 :: INFO :: Connected with result code {'session present': 0}
psacc-1  | 2024-09-02 14:40:40,882 :: INFO :: subscribe to psa/RemoteServices/to/cid/AP-ACNT200001088381/#
psacc-1  | 2024-09-02 14:40:40,883 :: INFO :: subscribe to psa/RemoteServices/events/MPHRTServices/XXXXXXXX
psacc-1  | 2024-09-02 14:40:40,883 :: WARNING :: Disconnected with result code 5
psacc-1  | 2024-09-02 14:40:40,884 :: WARNING :: The connection was refused.

2024-09-02 14:18:11,508 :: INFO :: 
Your vehicles: ["{'vin': 'XXXXXXXXXX', 'vehicle_id': '**looooooooooong id!!**', 'label': 'e-208', 'brand': 'Peugeot', 'abrp_name': 'peugeot:e208:20:50', 'battery_power': 46, 'fuel_capacity': 0, 'max_elec_consumption': 70, 'max_fuel_consumption': 0}"]
2024-09-02 14:18:11,509 :: INFO :: save config change
2024-09-02 14:18:11,509 :: INFO :: App version 3.5.3
2024-09-02 14:18:13,050 :: ERROR :: finish_oauth:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/config_oauth.py", line 56, in finish_oauth
    config_views.INITIAL_SETUP.connect(code)
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 134, in connect
    app.load_app()
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/car_controller.py", line 104, in load_app
    logger.info(str(self.myp.get_vehicles()))
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 141, in get_vehicles
    for vehicle in res.embedded.vehicles:
AttributeError: 'NoneType' object has no attribute 'embedded'

Environment (please complete the following information):

  • OS: Proxmox LXC with Docker in it
  • Brand and model of car: Peugeot
  • Application version (commit number, branch or tag): 3.5.3
  • Log from http://server_address:port/log and browser console log - see above
@Apollon77
Copy link
Contributor Author

PS: Interestingly the APP also shows an error ... lets see ... maybe thy have issues

@Apollon77
Copy link
Contributor Author

Ok, got that error now again after the app was back ... then it worked, band also OTP flow worked, but I still have

psacc-1  | 2024-09-02 16:05:50,140 :: INFO :: subscribe to psa/RemoteServices/to/cid/AP-ACNT200001088381/#
psacc-1  | 2024-09-02 16:05:50,140 :: INFO :: subscribe to psa/RemoteServices/events/MPHRTServices/VR3XXXXXXXX
psacc-1  | 2024-09-02 16:05:50,140 :: WARNING :: Disconnected with result code 5
psacc-1  | 2024-09-02 16:05:50,140 :: WARNING :: The connection was refused.
psacc-1  | 2024-09-02 16:05:58,323 :: INFO :: Connected with result code {'session present': 0}
psacc-1  | 2024-09-02 16:05:58,323 :: INFO :: subscribe to psa/RemoteServices/to/cid/AP-ACNT200001088381/#
psacc-1  | 2024-09-02 16:05:58,323 :: INFO :: subscribe to psa/RemoteServices/events/MPHRTServices/VR3XXXXXXXX
psacc-1  | 2024-09-02 16:05:58,323 :: WARNING :: Disconnected with result code 5
psacc-1  | 2024-09-02 16:05:58,323 :: WARNING :: The connection was refused.
psacc-1  | 2024-09-02 16:06:14,483 :: INFO :: Connected with result code {'session present': 0}
psacc-1  | 2024-09-02 16:06:14,483 :: INFO :: subscribe to psa/RemoteServices/to/cid/AP-ACNT200001088381/#
psacc-1  | 2024-09-02 16:06:14,484 :: INFO :: subscribe to psa/RemoteServices/events/MPHRTServices/VR3XXXXXXXX
psacc-1  | 2024-09-02 16:06:14,484 :: WARNING :: Disconnected with result code 5
psacc-1  | 2024-09-02 16:06:14,484 :: WARNING :: The connection was refused.
psacc-1  | 2024-09-02 16:06:46,616 :: INFO :: Connected with result code {'session present': 0}
psacc-1  | 2024-09-02 16:06:46,616 :: INFO :: subscribe to psa/RemoteServices/to/cid/AP-ACNT200001088381/#
psacc-1  | 2024-09-02 16:06:46,616 :: INFO :: subscribe to psa/RemoteServices/events/MPHRTServices/VR3XXXXXXXX
psacc-1  | 2024-09-02 16:06:46,616 :: WARNING :: Disconnected with result code 5
psacc-1  | 2024-09-02 16:06:46,616 :: WARNING :: The connection was refused.
psacc-1  | 2024-09-02 16:07:51,003 :: INFO :: Connected with result code {'session present': 0}
psacc-1  | 2024-09-02 16:07:51,003 :: INFO :: subscribe to psa/RemoteServices/to/cid/AP-ACNT200001088381/#
psacc-1  | 2024-09-02 16:07:51,003 :: INFO :: subscribe to psa/RemoteServices/events/MPHRTServices/VR3XXXXXXXX
psacc-1  | 2024-09-02 16:07:51,003 :: WARNING :: Disconnected with result code 5
psacc-1  | 2024-09-02 16:07:51,003 :: WARNING :: The connection was refused.
...

in the log now

@Apollon77 Apollon77 changed the title Peugeot: AttributeError: 'NoneType' object has no attribute 'embedded' on new login Peugeot: AttributeError: 'NoneType' object has no attribute 'embedded' on new login // The connection was refused. Sep 2, 2024
@Antyrael
Copy link

Antyrael commented Sep 3, 2024

I'm having the same issue, also for Peugeot, using country code NL.

Relevant part of my logs:

024-09-03 17:48:21,320 :: INFO :: App version 3.5.3
2024-09-03 17:48:22,515 :: ERROR :: finish_oauth:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/config_oauth.py", line 56, in finish_oauth
config_views.INITIAL_SETUP.connect(code)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 134, in connect
app.load_app()
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/car_controller.py", line 104, in load_app
logger.info(str(self.myp.get_vehicles()))
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 141, in get_vehicles
for vehicle in res.embedded.vehicles:
AttributeError: 'NoneType' object has no attribute 'embedded'

@vinc-vo
Copy link

vinc-vo commented Sep 5, 2024

I'm getting the same error.

OS: Debian running Docker
Brand and model of car: Peugeot e2008 (2020)
Application version (commit number, branch or tag): 3.5.3

2024-09-05 16:04:28,494 :: INFO :: 192.168.xxx.xxx - - [05/Sep/2024 16:04:28] "GET /config_connect?url=https%3A//idpcvs.peugeot.com/am/oauth2/authorizXXXXXXX HTTP/1.0" 200 -
2024-09-05 16:04:28,755 :: INFO :: 192.168.xxx.xxx - - [05/Sep/2024 16:04:28] "GET /_dash-layout HTTP/1.0" 200 -
2024-09-05 16:04:28,761 :: INFO :: 192.168.xxx.xxx - - [05/Sep/2024 16:04:28] "GET /_dash-dependencies HTTP/1.0" 200 -
2024-09-05 16:04:29,024 :: INFO :: 192.168.xxx.xxx - - [05/Sep/2024 16:04:29] "POST /_dash-update-component HTTP/1.0" 200 -
2024-09-05 16:04:29,073 :: INFO :: 192.168.xxx.xxx - - [05/Sep/2024 16:04:29] "POST /_dash-update-component HTTP/1.0" 204 -
2024-09-05 16:05:29,274 :: INFO :: save config change
2024-09-05 16:05:29,816 :: INFO :: 
Your vehicles: ["{'vin': 'xxxxxxxxxxxxxxxxxxxxxxx', 'vehicle_id': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'label': 'xxxxxxx', 'brand': 'Peugeot', 'abrp_name': 'peugeot:xxxxxxx', 'battery_power': 46, 'fuel_capacity': 0, 'max_elec_consumption': 70, 'max_fuel_consumption': 0}"]
2024-09-05 16:05:29,817 :: INFO :: save config change
2024-09-05 16:05:29,818 :: INFO :: App version 3.5.3
2024-09-05 16:05:31,735 :: ERROR :: finish_oauth:
Traceback (most recent call last):
 File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/config_oauth.py", line 56, in finish_oauth
   config_views.INITIAL_SETUP.connect(code)
 File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 134, in connect
   app.load_app()
 File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/car_controller.py", line 104, in load_app
   logger.info(str(self.myp.get_vehicles()))
 File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 141, in get_vehicles
   for vehicle in res.embedded.vehicles:
AttributeError: 'NoneType' object has no attribute 'embedded'
2024-09-05 16:05:31,738 :: INFO :: 192.168.xxx.xxx - - [05/Sep/2024 16:05:31] "POST /_dash-update-component HTTP/1.0" 200 -
2024-09-05 16:05:54,860 :: INFO :: save config change

Update: I managed to revert back to image v3.5.1 on docker. I did not need to log in after reverting, so I guess my old token is still valid.

@vinc-vo
Copy link

vinc-vo commented Sep 21, 2024

Just updated again to v3.5.3. I still got the error on the first try, but tried again and it finally works :)

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

3 participants