I have Drupal running in a docker container and nginx running in another container.

When I do the login call through postman or directly on the webserver cli it works perfectly. But when I do call from within my application I get a timeout after 30 seconds.

From server:

[email protected]:/var/www/html $ curl -X POST \ 'http://api.swappr.localhost/user/login?_format=json' \ -H 'Postman-Token: a9c80844-ed69-4d24-b205-6475b7e469dc' \ -H 'cache-control: no-cache' \ -d '{"name":"[email protected]", "pass":"password"}' {"current_user":{"uid":"21","name":"[email protected]"},"csrf_token":"yf5YBYyY4YvXCcufLyTWeKnvbhq5sdcZHpgmsVDeSRY","logout_token":"PEarVS7vPi5idARarGQzrrXAYcJL9YkiXmoHw_a7yJE"}

In code:

$response = \Drupal::httpClient()->post(
            ['name' => '[email protected]', 'pass' => 'password']

cURL error 28: Operation timed out after 30001 milliseconds with 0 bytes received (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

Anyone knows what could cause this problem?

  • 1
    Sounds like a networking problem?
    – Kevin
    Commented Jan 17, 2019 at 15:38

1 Answer 1


Okay turns out it was xdebug. I had to allow more simultaneous connections in the PHP Debug settings of PHP Storm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.