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

Mac Func:HTTPAPI_ExecuteRequest Line:587 curl_easy_perform() failed: Out of memory #129

Closed
DandelionWenjing opened this issue Apr 4, 2018 · 8 comments
Assignees

Comments

@DandelionWenjing
Copy link

  • OS and version used:

  • Python runtime used: <python2.6>

  • SDK version used:

Description of the issue:

I have build the azure iot hub python SDK by the following steps:

  1. I have build the iot hub c SDK on the c folder in the python SDK by using the steps on the address https://github.com/Azure/azure-iot-sdk-c/blob/master/doc/devbox_setup.md#macos
  2. I have build the iot hub python SDK successfully by running the setup.sh and build.sh and generate the .so file.
  3. I met the problems as follows when I run the services samples in the python SDK:
Error: Time:Wed Apr  4 15:19:18 2018 File:/Users/zhaowenjing/azure-iot-sdk-python/c/c-utility/adapters/httpapi_curl.c Func:HTTPAPI_ExecuteRequest Line:587 curl_easy_perform() failed: Out of memory

Error: Time:Wed Apr  4 15:19:18 2018 File:/Users/zhaowenjing/azure-iot-sdk-python/c/c-utility/adapters/httpapi_curl.c Func:HTTPAPI_ExecuteRequest Line:589 (result = HTTPAPI_OPEN_REQUEST_FAILED)
Error: Time:Wed Apr  4 15:19:18 2018 File:/Users/zhaowenjing/azure-iot-sdk-python/c/c-utility/src/httpapiex.c Func:HTTPAPIEX_ExecuteRequest Line:475 unable to recover sending to a working state
Error: Time:Wed Apr  4 15:19:18 2018 File:/Users/zhaowenjing/azure-iot-sdk-python/c/iothub_service_client/src/iothub_devicemethod.c Func:sendHttpRequestDeviceMethod Line:321 HTTPAPIEX_SAS_ExecuteRequest failed
Error: Time:Wed Apr  4 15:19:18 2018 File:/Users/zhaowenjing/azure-iot-sdk-python/c/iothub_service_client/src/iothub_devicemethod.c Func:IoTHubDeviceMethod_Invoke Line:489 Failure sending HTTP request for device method invoke

Unexpected error IoTHubDeviceMethod.Invoke, IoTHubDeviceMethodResult.ERROR
  1. As the problems is the similar problem as the issue:
    curl_easy_perform() failed: Out of memory error when uploading blobs azure-iot-sdk-c#308
    I have tried to update my curl version to the latest:
curl --version
curl 7.59.0 (x86_64-apple-darwin17.3.0) libcurl/7.59.0 SecureTransport zlib/1.2.11
Release-Date: 2018-03-14

Code sample exhibiting the issue:

Console log of the issue:

@zolvarga
Copy link
Contributor

zolvarga commented Apr 9, 2018

@DandelionWenjing

Please make sure you are following the steps from the C issue you mentioned (#308). I copied them below for convenience.
Please also verify in the debugger the loaded binaries (so) when you try to run the program, just make sure the executable uses the latest curl.
Note: the DYLD_LIBRARY_PATH has to be set in the context of the running application.

Best Regards,
Zoltan

From issue #308
Could you try these updated steps please?

Install the latest version of curl
macosx:~ username$ brew install curl
At the end of the installation you will get this info:

Error: Failed to create /usr/local/opt/curl
...
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
...
==> Summary
🍺 /usr/local/Cellar/curl/7.58.0: 415 files, 3MB
Save the path "/usr/local/Cellar/curl/7.58.0", this is where the library and headers were actually installed.

Force link updates:
brew link curl --force
Set DYLD_LIBRARY_PATH:
export DYLD_LIBRARY_PATH="/usr/local/Cellar/curl/7.58.0/lib:$DYLD_LIBRARY_PATH"

@zolvarga zolvarga self-assigned this Apr 9, 2018
@Xirui
Copy link

Xirui commented Apr 19, 2018

Faced same issue. As @zolvarga you are reminding: I forget to set the DYLD_LIBRARY_PATH in the new openned terminal....I thought it was only needed during build the SDK.

This is not a big issue but annoying. When can we expect a fix?

Thanks @zolvarga

@pierreca
Copy link
Contributor

pierreca commented Jul 3, 2018

@Xirui can you clarify what type of fix you would like from us? it looks like this is an environment thing: the fix as far as I understand was to update the curl dependency and make sure our SDK could find it.

I'm not an expert on brew and macos but I'm not sure there's anything, from the source-code standpoint, that we can do to fix this.

@pierreca pierreca added the macos label Jul 3, 2018
@Xirui
Copy link

Xirui commented Jul 4, 2018

Hi @pierreca , sorry this was a while back. I could not recall every detail when having this issue.

But I agree this is more related to installation instructions than source code.

Sorry for could not be more helpful here.

@pierreca
Copy link
Contributor

@DandelionWenjing never got confirmation if you got through this issue with what @zolvarga suggested - would you mind letting us know?

@Xirui no problem - we are fully aware that our MacOS support isn't where it needs to be - we'll see if @DandelionWenjing can confirm anything and I'll try to follow up on a couple of other related issues. if we hear nothing we'll close the issue, but you can expect some improvements in the near future.

@pierreca
Copy link
Contributor

@DandelionWenjing @Xirui No updates in a while here so I'm tempted to close the issue. Furthermore, i've released pip packages for macos which should save you the trouble of building the SDK yourself:

Would you mind giving it a try?

pip install azure_iothub_device_client

it will still need to have boost installed, which you can deal with by doing:

brew install boost-python

or in the case of python3:

brew install boost-python3

Please do report if you're running into any sort of issue!

@pierreca
Copy link
Contributor

Closing after some inactivity, given we think issues are resolved.

@az-iot-builder-01
Copy link
Collaborator

@DandelionWenjing, @Xirui, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey

pierreca pushed a commit that referenced this issue Aug 28, 2019
module id for x509
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants