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

Failed to authenticate after upgrade to DSM 7 #169

Open
mjozefcz opened this issue Oct 22, 2021 · 1 comment
Open

Failed to authenticate after upgrade to DSM 7 #169

mjozefcz opened this issue Oct 22, 2021 · 1 comment

Comments

@mjozefcz
Copy link

mjozefcz commented Oct 22, 2021

After synology upgrade to DSM 7, the _initialize_api_sid fails on

Traceback (most recent call last):
  File "synology-snapshot.py", line 34, in <module>
    surveillance = SurveillanceStation(api_url, username, password, verify_ssl=verify_ssl, timeout=timeout)
  File "/root/synology-snapshot-docker/.venv/lib/python3.8/site-packages/synology/surveillance_station.py", line 13, in __init__
    self._api = Api(url, username, password, timeout, verify_ssl)
  File "/root/synology-snapshot-docker/.venv/lib/python3.8/site-packages/synology/api.py", line 74, in __init__
    self._initialize_api_sid()
  File "/root/synology-snapshot-docker/.venv/lib/python3.8/site-packages/synology/api.py", line 102, in _initialize_api_sid
    response = self._get_json_with_retry(api['url'], payload)
  File "/root/synology-snapshot-docker/.venv/lib/python3.8/site-packages/synology/api.py", line 303, in _get_json_with_retry
    return self._get_json(url, payload)
  File "/root/synology-snapshot-docker/.venv/lib/python3.8/site-packages/synology/api.py", line 318, in _get_json
    raise ValueError('Invalid or failed response', content)
ValueError: ('Invalid or failed response', {'error': {'code': 103}, 'success': False})

Based on WebAPi documentation it seems like the requested API method doesn't exist.

_api_info structure:

{'_api_info': {'auth': {'name': 'SYNO.API.Auth', 'url': 'https://IP:5001/webapi/entry.cgi', 'version': 2},
               'camera': {'name': 'SYNO.SurveillanceStation.Camera', 'url': 'https://IP:5001/webapi/entry.cgi', 'version': 1},
               'camera_event': {'name': 'SYNO.SurveillanceStation.Camera.Event', 'url': 'https://IP:5001/webapi/entry.cgi', 'version': 1},
               'home_mode': {'name': 'SYNO.SurveillanceStation.HomeMode', 'url': 'https://IP:5001/webapi/entry.cgi', 'version': 1},
               'snapshot': {'name': 'SYNO.SurveillanceStation.SnapShot', 'url': 'https://IP:5001/webapi/entry.cgi', 'version': 1},
               'video_stream': {'name': 'SYNO.SurveillanceStation.VideoStream', 'url': 'https://IP:5001/webapi/SurveillanceStation/videoStreaming.cgi', 'version': 1}},
 '_base_url': 'https://IP:5001/webapi/',
 '_password': 'foo',
 '_sid': None,
 '_timeout': 30,
 '_username': 'bar',
 '_verify_ssl': False}
(Pdb++)

Surveillance station version: 8.2.9-7301
https://www.synology.com/en-uk/releaseNote/SurveillanceStation

@mjozefcz
Copy link
Author

I've bumped the SYNO.API.Auth to 7 and changed the login method from "Login" to "login" and it started working.
Looks like we need some api discovery to setup proper parameters.

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

1 participant