curl working from cmd line but dbr.http.get hangs

(4 posts) (2 voices)

Tags:

No tags yet.

  1. maron, Member

    I have a curl request that works perfectly from the cmd line

    curl "user:pass@server-ip:port/path/to/endpoint"

    but when I try it using dbr.http.get on the same server

    select 'dbr.http.get',"user:pass@server-ip:port/path/to/endpoint";
    select 1;

    It just hangs and times out. The server in question is in a different VPC in AWS - but I thought that if I have access from cmd line it should also work in a report.

    Is there any way to debug this?

    I tried dbr.http.get to other endpoints within our setup and it works fine.

  2. myDBR Team, Key Master

    Hi,
    If the server using HTTPS, have you have defined the curl.cainfo in the php.ini?

    You can use the debug option. It should give you detailed info what is going on.

    select 'dbr.http.debug', 1;

    --
    myDBR Team

  3. maron, Member

    It is not https - just an internal http request.

    It times out with the debug option as well - is there any log that I could view?

  4. myDBR Team, Key Master

    If it is just a basic cURL call, this is what myDBR performs:

    curl_init();
    curl_setopt($ch, CURLOPT_URL,"user:pass@server-ip:port/path/to/endpoint");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_exec($ch);

    You can try that in separate PHP test.

    As for the differences between PHP cURL and the command-line curl, a few possibilities include:
    - Firewall settings preventing web access
    - Proxy in use but not properly configured
    - Service requiring specific headers
    - PHP using a different DNS resolver

    --
    myDBR Team


Reply

You must log in to post.