Skip to content

Aruba Central Streaming API Client Failed due to Bad Request #35

Open

Description

@Karl90

Hi All,

We have realized that since early this week, the "wsclient_public.py" python client for the Aruba Central streaming API is no longer working due to a bad request:

  File "/dev_py/aruba/lib/python3.9/site-packages/websocket/_handshake.py", line 150, in _get_resp_headers
    raise WebSocketBadStatusException("Handshake status {status} {message} -+-+- {headers} -+-+- {body}".format(status=status, message=status_message, headers=resp_headers, body=response_body), status, status_message, resp_headers, response_body)
websocket._exceptions.WebSocketBadStatusException: Handshake status 400 Bad Request -+-+- {'date': 'Fri, 15 Sep 2023 08:40:34 GMT', 'content-type': 'text/plain; charset=utf-8', 'content-length': '19', 'connection': 'keep-alive', 'x-content-type-options': 'nosniff', 'strict-transport-security': 'max-age=31536000; includeSubDomains', 'x-frame-options': 'SAMEORIGIN', 'x-request-start': 't=1694767234.499', 'x-xss-protection': '1; mode=block'} -+-+- b'Unsubscribed Topic\n'

We haven't introduced a change on the client side and it is being executed as follows:

python3 wsclient_public.py --hostname <aruba-central-instance>.central.arubanetworks.com --jsoninput input.json --decode_data
We've also ensured to use the last version available and the issue persist.

Please, can you help us to fix the client?

Thank you very much,

Best regards,

Karl.

Activity

  1. Karl90 commented on Sep 19, 2023

    @Karl90
    Author

    Dear Team,

    Please, can you help us with this?

    Taking a look on the last PRs we don't see major changes on the client, can it be linked with a change on the Streaming API?

    Regards,

    Karl.

  2. Karl90 commented on Sep 20, 2023

    @Karl90
    Author

    Dear Team,

    Please, can you double check if a change was introduced on the Streaming API?
    The client has not been changed and the failures seen are linked to bad requests performed by the client.

    Best regards,

    Karl.

  3. Karl90 commented on Sep 26, 2023

    @Karl90
    Author

    Hi All,

    Just to say that the same error is returned by the simple client:

    (aruba_central_streamingapi)$ python3 simple_app.py 
    --- request header ---
    GET /streaming/api HTTP/1.1
    Upgrade: websocket
    Host: XYZ.central.arubanetworks.com
    Origin: https://XYZ.central.arubanetworks.com
    Sec-WebSocket-Key: YYY
    Sec-WebSocket-Version: 13
    Connection: Upgrade
    UserName: abc@company.com
    Authorization: XXXXXX
    Topic: monitoring
    
    
    -----------------------
    --- response header ---
    HTTP/1.1 400 Bad Request
    Date: Tue, 26 Sep 2023 13:42:12 GMT
    Content-Type: text/plain; charset=utf-8
    Content-Length: 19
    Connection: keep-alive
    X-Content-Type-Options: nosniff
    Strict-Transport-Security: max-age=31536000; includeSubDomains
    X-Frame-Options: SAMEORIGIN
    X-Request-Start: t=1695735732.357
    X-XSS-Protection: 1; mode=block
    -----------------------
    Handshake status 400 Bad Request -+-+- {'date': 'Tue, 26 Sep 2023 13:42:12 GMT', 'content-type': 'text/plain; charset=utf-8', 'content-length': '19', 'connection': 'keep-alive', 'x-content-type-options': 'nosniff', 'strict-transport-security': 'max-age=31536000; includeSubDomains', 'x-frame-options': 'SAMEORIGIN', 'x-request-start': 't=1695735732.357', 'x-xss-protection': '1; mode=block'} -+-+- b'Unsubscribed Topic\n'
    Handshake status 400 Bad Request -+-+- {'date': 'Tue, 26 Sep 2023 13:42:12 GMT', 'content-type': 'text/plain; charset=utf-8', 'content-length': '19', 'connection': 'keep-alive', 'x-content-type-options': 'nosniff', 'strict-transport-security': 'max-age=31536000; includeSubDomains', 'x-frame-options': 'SAMEORIGIN', 'x-request-start': 't=1695735732.357', 'x-xss-protection': '1; mode=block'} -+-+- b'Unsubscribed Topic\n' - goodbye
    

    Please, can you help us to move forward?
    It looks like a change on any of the sides(either this client or the remote Streaming API) that triggers such bad request.

    thanks in advance,

    regards,

    Karl.

  4. Karl90 commented on Sep 26, 2023

    @Karl90
    Author

    @KarthikSKumar98 , have you seen this behaviour?

  5. KarthikSKumar98 commented on Sep 26, 2023

    @KarthikSKumar98
    Collaborator

    @Karl90 Hi, I haven't seen this behavior before. I did update the requirements.txt file in the streaming-api-client folder. The PR is still open. It will get merged soon. Could you check out the requirements.txt file and see if that resolves the issue - #36

    Could you also let me know what topic you are trying to stream when you are getting the error ?

  6. Karl90 commented on Sep 27, 2023

    @Karl90
    Author

    Hi @KarthikSKumar98 ,

    Thanks for your inputs.

    Indeed, I executed the code including your PR #36, but unfortunately the installation of the dependencies failed "as is", due to the version of greenlet:

    image

    When removing the specific version, the installation ends successfully.
    FYI, this is the actual requirements.txt that I am using:

    certifi==2023.7.22
    charset-normalizer==3.2.0
    gevent==23.9.1
    greenlet
    idna==3.4
    protobuf==4.24.3
    requests==2.31.0
    six==1.16.0
    urllib3==2.0.5
    websocket-client==1.6.3
    zope.event==5.0
    zope.interface==6.0
    

    When the code is executed, then the same issue is found:

    /aruba_central_sac/central-python-workflows/streaming-api-client/lib/python3.9/site-packages/websocket/_handshake.py", line 150, in _get_resp_headers
        raise WebSocketBadStatusException("Handshake status {status} {message} -+-+- {headers} -+-+- {body}".format(status=status, message=status_message, headers=resp_headers, body=response_body), status, status_message, resp_headers, response_body)
    websocket._exceptions.WebSocketBadStatusException: Handshake status 400 Bad Request -+-+- {'date': 'Wed, 27 Sep 2023 11:27:16 GMT', 'content-type': 'text/plain; charset=utf-8', 'content-length': '19', 'connection': 'keep-alive', 'x-content-type-options': 'nosniff', 'strict-transport-security': 'max-age=31536000; includeSubDomains', 'x-frame-options': 'SAMEORIGIN', 'x-request-start': 't=1695814036.112', 'x-xss-protection': '1; mode=block'} -+-+- b'Unsubscribed Topic\n'
    

    This actually started to happen 2 weeks ago, previously the client was able to pull the data from any topic, in this case we tested with the 'monitoring' one - which is very verbose.

    For the sake of transparency and isolate issues, all my tests are done with the latest version of the repo, the only change is the requirements.txt as seen previously, that is why I highly think that the issue relies on the remote streaming API or the source client, do you think that any of the packages can trigger the issue on the client?

    Thanks for the help!

    Karl.

  7. KarthikSKumar98 commented on Oct 3, 2023

    @KarthikSKumar98
    Collaborator

    Hi Karl! Could you let me know which Central cluster you are trying to stream data from ?

  8. Karl90 commented on Oct 4, 2023

    @Karl90
    Author

    Hi @KarthikSKumar98 ,

    Sure, this is the EU instance that I'm using:

    • hostname: app-eucentral3.central.arubanetworks.com
    • topic: monitoring

    BTW, I've been told that you also need to include the hostname in the input file. I also tried that and issue persisted.

    Best regards,

    Karl.

  9. KarthikSKumar98 commented on Oct 9, 2023

    @KarthikSKumar98
    Collaborator

    Hi Karl! I believe this issue could be due to a Streaming API bug. Would it be possible for you to file a TAC case regarding this?
    Once you filed it, please send me the TAC number on my email - karthik.satheesh-kumar@hpe.com
    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions