Issue
I’m trying to make an API call to my Jenkins instance using my domain user but it’s failing with:
curl: (7) Failed to connect to yourdomain.com port X: Connection timed out
It mainly affects users with a "@" character.
Environment
-
CloudBees CI (CloudBees Core) on modern cloud platforms - Managed controller
-
CloudBees CI (CloudBees Core) on modern cloud platforms - Operations Center
-
CloudBees CI (CloudBees Core) on traditional platforms - Client controller
-
CloudBees CI (CloudBees Core) on traditional platforms - Operations Center
Resolution
This is caused by the "@" character, that makes the call interpret your user’s domain as the URL to reach.
It can be fixed by replacing your call, defining the user and token as an argument.
-
Example of a command that will fail
curl https://youruser@yourdomain.com:yourtoken@jenkins.yourdomain.com/api/json
-
Example of a successful command
curl -u youruser@yourdomain.com:yourtoken https://jenkins.yourdomain.com/api/json
This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.