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

Connection Error #56

Closed
SaqlainHussainShah opened this issue Feb 24, 2021 · 11 comments
Closed

Connection Error #56

SaqlainHussainShah opened this issue Feb 24, 2021 · 11 comments

Comments

@SaqlainHussainShah
Copy link

I am trying to log in to NAS file station it is giving me following error
ConnectionError: HTTPSConnectionPool(host='https', port=443): Max retries exceeded with url: //IP:portwebapi/auth.cgi?api=SYNO.API.Auth&version=2&method=login&account=username&passwd=password&session=FileStation&format=cookie (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f94b4092f10>: Failed to establish a new connection: [Errno -2] Name or service not known

@N4S4
Copy link
Owner

N4S4 commented Feb 24, 2021

Can you give more informations?
For a better troubleshooting, can you post the code which gives you this error?

@SaqlainHussainShah
Copy link
Author

SaqlainHussainShah commented Feb 24, 2021

`from synology_api import filestation, downloadstation

fl = filestation.FileStation('172.16.0.200', '5000', 'name', 'password', secure=True, cert_verify=True)
fl.get_info()

dwn = downloadstation.DownloadStation('172.16.0.200', '5000', 'username', 'password', secure = True)

dwn.get_info()`

This was the code causing problem
I changed cert_verify to False and now it gives me following issues
keyError Traceback (most recent call last)
in
8 fl.get_info()
9
---> 10 dwn = downloadstation.DownloadStation('172.16.0.200', '5000', 'username', 'password', secure = True)
11
12 dwn.get_info()

~/.local/lib/python3.7/site-packages/synology_api/downloadstation.py in init(self, ip_address, port, username, password, secure, cert_verify)
9 self._bt_search_id = ''
10 self._bt_search_id_list = []
---> 11 self.session.login('DownloadStation')
12 self.session.get_api_list('DownloadStation')
13

~/.local/lib/python3.7/site-packages/synology_api/auth.py in login(self, application)
28 else:
29 session_request = requests.get(self._base_url + login_api, param, verify=self._verify)
---> 30 self._sid = session_request.json()['data']['sid']
31 self._session_expire = False
32 return 'User logging... New session started!'

KeyError: 'data'

@SaqlainHussainShah
Copy link
Author

Can you please help me in this regard @N4S4

@N4S4
Copy link
Owner

N4S4 commented Feb 24, 2021

Ok let me do some checks when i get home. As reminder you can join the telegram group t.me/SynologyApi

I will let you know anyway

@SaqlainHussainShah
Copy link
Author

SaqlainHussainShah commented Feb 25, 2021 via email

@N4S4
Copy link
Owner

N4S4 commented Feb 25, 2021

ok so are you using it on your local network or from remote?
if from remote are you sure router port forwarding rules are correct?
are you having a valid certificate to connect with https?

@N4S4
Copy link
Owner

N4S4 commented Feb 25, 2021

i have just noticed that you are using port 5000, secure must be used for https only on port 5001 unless you modified it, try 5001 with secure True or 5000 with secure False

@SaqlainHussainShah
Copy link
Author

SaqlainHussainShah commented Feb 25, 2021 via email

@N4S4
Copy link
Owner

N4S4 commented Feb 25, 2021

so try 5000 with secure False and cert_verify false

@N4S4
Copy link
Owner

N4S4 commented Mar 1, 2021

I will close this issue as no activity,
I will keep answering if help is needed, or join the telegram or slack group

@N4S4 N4S4 closed this as completed Mar 1, 2021
@darth-anish
Copy link

@N4S4 I am facing the original error raised in this issue. Could you please help?

Errror message:

requests.exceptions.ConnectionError: HTTPConnectionPool(host='https', port=80): Max retries exceeded with url: //ip_address:2112/webapi/auth.cgi?api=SYNO.API.Auth&version=7&method=login&account=username&passwd=pw&session=FileStation&format=cookie (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ff9ee3cae20>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

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