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

Exception on log-out ResponseErrorWrongSessionToken: 125003: Wrong Session Token #163

Open
Salamek opened this issue Dec 19, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@Salamek
Copy link
Owner

Salamek commented Dec 19, 2022

As mentioned in #159 :

One last addition : logout seems to fail on my hardware even with an account set, as shown below :
EDIT: this behaviour is common to 1.6.4 and 1.6.7 when using default account

# ./data_dump.py --username admin --password admin http://192.168.8.1
...
==== Developer.atport_status
100002: No support

Traceback (most recent call last):
  File "/home/npillot/huawei-lte-api_1.6.7/examples/./data_dump.py", line 334, in <module>
    dump(client.developer.atport_status)
  File "/home/npillot/huawei-lte-api_1.6.7/examples/./../huawei_lte_api/Connection.py", line 54, in __exit__
    self.close()
  File "/home/npillot/huawei-lte-api_1.6.7/examples/./../huawei_lte_api/Connection.py", line 42, in close
    self.user_session.close()
  File "/home/npillot/huawei-lte-api_1.6.7/examples/./../huawei_lte_api/api/User.py", line 30, in close
    self.user.logout()
  File "/home/npillot/huawei-lte-api_1.6.7/examples/./../huawei_lte_api/api/User.py", line 115, in logout
    return self._session.post_set('user/logout', {
  File "/home/npillot/huawei-lte-api_1.6.7/examples/./../huawei_lte_api/Session.py", line 215, in post_set
    self._post(endpoint, data, refresh_csrf, prefix, is_encrypted, is_json)
  File "/home/npillot/huawei-lte-api_1.6.7/examples/./../huawei_lte_api/Session.py", line 34, in wrapped
    return fn(*args, **kw)
  File "/home/npillot/huawei-lte-api_1.6.7/examples/./../huawei_lte_api/Session.py", line 254, in _post
    response_data = cast(str, self._check_response_status(self._process_response_data(response)))
  File "/home/npillot/huawei-lte-api_1.6.7/examples/./../huawei_lte_api/Session.py", line 156, in _check_response_status
    raise error_code_to_exception.get(error_code, ResponseErrorException)(
huawei_lte_api.exceptions.ResponseErrorWrongSessionToken: 125003: Wrong Session Token
@Salamek
Copy link
Owner Author

Salamek commented Jan 15, 2023

Should be fixed in #169 i guess...

@Salamek Salamek closed this as completed Jan 15, 2023
@scop
Copy link
Contributor

scop commented Jan 16, 2023

Hm, I'm not sure, in #169 ResponseErrorLoginRequiredException and ResponseErrorNotSupportedException are the suppressed exceptions, whereas here ResponseErrorWrongSessionToken is raised.

Then again I might be missing something. Or then again ResponseErrorWrongSessionToken could be similarly suppressed as the other two, doesn't seem there's anything that could be done about that as far as closing a session goes either.

@Salamek
Copy link
Owner Author

Salamek commented Jan 17, 2023

Oh, you are right, wrong exception

@Salamek Salamek reopened this Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants