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

ResponseErrorException: 100006 for hardware CL2E3372HM #159

Closed
nipil opened this issue Nov 17, 2022 · 8 comments
Closed

ResponseErrorException: 100006 for hardware CL2E3372HM #159

nipil opened this issue Nov 17, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@nipil
Copy link

nipil commented Nov 17, 2022

Hello

I'm trying to use huawei-lte-api 1.6.7 package in a python 3.9.2 virtualenv on debian 11

When running any of the provided examples i get an unknown error response 10006.
This error code is not (yet) defined i enums/client.py.

My hardware is a E3372 using HiLink software, with the information below from the web interface :

  • Hardware version : CL2E3372HM
  • Software version : 22.328.62.00.1080
  • Web UI version : 17.100.19.04.1080

What can i do to help you diagnost this missing error handling ?

Thanks in advance
Nicolas

@nipil nipil changed the title Unknown response error exception 1000006 for hardware CL2E3372HM ResponseErrorException: 1000006 for hardware CL2E3372HM Nov 17, 2022
@nipil nipil changed the title ResponseErrorException: 1000006 for hardware CL2E3372HM ResponseErrorException: 100006 for hardware CL2E3372HM Nov 17, 2022
@Salamek
Copy link
Owner

Salamek commented Nov 17, 2022

Hi, i just tested my E3372 and it works ~fine (well there is small bug in 1.6.7, but it should still work ~):

  • Hardware version : CL1E3372SM Ver.A
  • Software version : 22.286.03.03.1202
  • Web UI version : 16.100.05.02.1202

Maybe try to use version 1.6.4? If it does same thing (huawei-lte-api==1.6.4)...

@nipil
Copy link
Author

nipil commented Nov 17, 2022

I just tried the 1.6.4 and is working great, thanks for the idea of reverting to a previous version !

  • i can run data_dump.py and device_info.py ang get actual output
  • i was able to toggle client.dial_up.set_mobile_dataswitch(1) and connect

For 1.6.7 here is the full trace (by the way my hardware is not password nor pin protected)

(venv) user@debian:~/huawei-lte-api/examples$ python3 data_dump.py http://192.168.8.1
Traceback (most recent call last):
  File "/home/user/huawei-lte-api/examples/../huawei_lte_api/api/User.py", line 61, in _login
    result = self._session.post_set('user/login', {
  File "/home/user/huawei-lte-api/examples/../huawei_lte_api/Session.py", line 215, in post_set
    self._post(endpoint, data, refresh_csrf, prefix, is_encrypted, is_json)
  File "/home/user/huawei-lte-api/examples/../huawei_lte_api/Session.py", line 34, in wrapped
    return fn(*args, **kw)
  File "/home/user/huawei-lte-api/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/user/huawei-lte-api/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.ResponseErrorException: 100006: Unknown

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/huawei-lte-api/examples/data_dump.py", line 33, in <module>
    with Connection(args.url, username=args.username, password=args.password) as connection:
  File "/home/user/huawei-lte-api/examples/../huawei_lte_api/Connection.py", line 31, in __init__
    self.user_session = UserSession(self, username, password) if username or password else None
  File "/home/user/huawei-lte-api/examples/../huawei_lte_api/api/User.py", line 27, in __init__
    self.user.login(username, password, True)
  File "/home/user/huawei-lte-api/examples/../huawei_lte_api/api/User.py", line 112, in login
    return self._login(username, password, PasswordTypeEnum(int(state_login['password_type'])))
  File "/home/user/huawei-lte-api/examples/../huawei_lte_api/api/User.py", line 86, in _login
    raise error_code_to_exception.get(e.code, ResponseErrorException)(
huawei_lte_api.exceptions.ResponseErrorException: 100006: Unknown

Hope it helps

@Salamek
Copy link
Owner

Salamek commented Nov 17, 2022

Yea, thx there were some changes in login/session handling in 1.6.7, we will need to address that...

@nipil
Copy link
Author

nipil commented Nov 18, 2022

After reading the discussion in #156, i can confirm that if i reactivate the login with 1.6.7 it works fine with my hardware above

While using default user/pass (admin/admin) i get the following behaviour :

  • both or only --password correct : device_info.py runs fine
  • no --username and --password, or only --username : i get "100008: Unknown"
  • explicitely wrong username or password : 108006: Username or Password wrong
  • too many failed password : i first got 108007: Unknown then next try i got 108007: Password overrun

Then i wait for a few minutes and i can run device_info.py --password admin ... successfully again.

@nipil
Copy link
Author

nipil commented Nov 18, 2022

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

Salamek commented Dec 19, 2022

@nipil can you pls test latest 1.6.9 if it fixes login issue? (it should have same behavior as 1.6.4).
I'll look on that logout issue with set login info later...

@Salamek Salamek reopened this Dec 19, 2022
@nipil
Copy link
Author

nipil commented Dec 19, 2022

@Salamek i can confirm that both data_dump and device_info (and my own code) work as intended with 1.6.9, wether it be with authentication enabled or disabled. Only with authentication enabled there is a logout exception. THANKS !

@Salamek
Copy link
Owner

Salamek commented Dec 19, 2022

@nipil good, i'm closing this issue then, logout error is tracked in separate issue #163

@Salamek Salamek closed this as completed Dec 19, 2022
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