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

filestation.FileStation() - "Error 402 - Denied permission" on version 0.7.x #159

Closed
tblaudez opened this issue Mar 8, 2024 · 8 comments

Comments

@tblaudez
Copy link

tblaudez commented Mar 8, 2024

Describe the bug
I have a Python script that uses filestation.FileStation() to connect to a Synology NAS using a password and an OTP code, and with the secure flag set to True.
After updating synology-api from version 0.6.3 to 0.7.1, the script now fails to log in with the following error :

Login failed: Error 402 - Denied permission

To Reproduce
Steps to reproduce the behavior:

  1. Execute the following script with synology-api==0.6.3
filestation.FileStation('<IP>', '<PORT>', '<USER>', '<PASSWORD>', secure=True, otp_code='<OTP>', debug=True).logout()
  1. Execute the same script with synology-api==0.7.1

Expected behavior
Executing the script with synology-api==0.7.1 should not raise any error

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Microsoft Windows 11 Professionnal 10.0.22631 N/A build 22631
  • Python version: Python 3.11.8

Additional context
N/A

@N4S4
Copy link
Owner

N4S4 commented Mar 8, 2024

Soon there will be a new release that might fix some login issue. We are looking for more reports that upload functions are working. Could you try to use the updated github version 7.1.1 and see if issue persist?

@tblaudez
Copy link
Author

tblaudez commented Mar 8, 2024

I've tried with the latest commit from main (9ada8fc) and the issues persists

@N4S4
Copy link
Owner

N4S4 commented Mar 8, 2024

It is a strange error because i do not have any issue logging in. I see the execution script ur using .logout are u trying to login right?

@N4S4
Copy link
Owner

N4S4 commented Mar 8, 2024

Could you try to split the script assigning the login to a var than do what you need to do?

test = filestation.FileStation('<IP>', '<PORT>', '<USER>', '<PASSWORD>', secure=True, otp_code='<OTP>', debug=True)

test.logout()

@tblaudez
Copy link
Author

tblaudez commented Mar 13, 2024

I used this syntax because this part of my script is merely a test to check if the given credentials are correct.
So I just log in and log out immediately.

I tried again this time assigning Filestation to a variable but the issue persists (still on commit 9ada8fc).

@N4S4
Copy link
Owner

N4S4 commented Mar 13, 2024

That is strange. The only thing comes in my mind you can try to change is to change 'enable_syno_token' in auth to 'no' and see what happens. This is the only change made to the api lately.

def login(self, application: str) -> None:
        login_api = 'auth.cgi?api=SYNO.API.Auth'
        params = {'version': self._version, 'method': 'login', 'account': self._username,
                  'passwd': self._password, 'session': application, 'format': 'cookie', 'enable_syno_token':'yes'}

Could you try this?

@fabtesta
Copy link

The latest lib version works for me.
I've forked this repo (#164) to add the test cases to cover possible differences from my environment, changing the test cases config values.

client info

  • windows 10
  • python 3.12

dsm info

  • DSM 7.1.1-42962 Update 6
  • Synology model DS716+II

@N4S4
Copy link
Owner

N4S4 commented Mar 14, 2024

it seems like an isolated case, have you checked your DSM config? i know was working before but people testing did not find same or other issues, i will keep looking at comments but i will close the issue

@N4S4 N4S4 closed this as completed Mar 14, 2024
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