Skip to content

HTTP request fails intermittently, but works via command line curl #643

@themightyoarfish

Description

@themightyoarfish

auto fwjson = http_client->get("api/v1/system/firmware", timeout_sec);

This line in the client sometimes fails for us with this error

  what():  CurlClient::execute_request failed for the url: [http://os-122422000616.local/api/v1/system/firmware] with the error message: Couldn't connect to server

When SensorHTTP::create() is invoked. Simply retrying a few times makes it go away. Meanwhile I can never reproduce this behaviour when just using curl on the command line in a loop

while true; do curl --request GET http://os-122422000616.local/api/v1/system/firmware && echo "result was $?"; done

(always successful).

This has happened with several different rev7 devices, and I'm not sure how to troubleshoot. The scanners work normally once connected.

Any advice on how to investigate?

I have not yes tried with current master, as it has introduced some install issues wrt to the version we're using, but the HTTP code is identical.

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