When I perform an upload through our Jenkins server I get a 400 response from our Artifactory server. The following is the portion of the Jenkinsfile being run:
bat 'conan config install <config_repo>.git'
bat 'conan user -p <KEY> -r inseinc <USR>'
bat 'conan create -pr release . inseinc/stable'
bat 'conan upload cclconanlibs* --all -r inseinc -c'
The config_repo contains the enable_revisions flag like so:
[log]
run_to_output = True # environment CONAN_LOG_RUN_TO_OUTPUT
run_to_file = False # environment CONAN_LOG_RUN_TO_FILE
level = 50 # environment CONAN_LOGGING_LEVEL
print_run_commands = True # environment CONAN_PRINT_RUN_COMMANDS
[general]
default_profile = release
compression_level = 9 # environment CONAN_COMPRESSION_LEVEL
sysrequires_sudo = True # environment CONAN_SYSREQUIRES_SUDO
request_timeout = 60 # environment CONAN_REQUEST_TIMEOUT (seconds)
default_package_id_mode = semver_direct_mode # environment CONAN_DEFAULT_PACKAGE_ID_MODE
revisions_enabled = 1
[storage]
path = ./data
[hooks]
attribute_checker
When I remote into the server and run the commands by hand they execute successfully. However, when running inside the Jenkins Server the upload command returns a 400 error. After checking the Artifactory logs I can see that Conan is still trying to use the v1 API to upload:
20190809160045|19|REQUEST|172.17.0.65|service.jenkins.reta|GET|/api/conan/local_conan/v1/ping|HTTP/1.1|200|0
20190809160045|2|REQUEST|172.17.0.65|service.jenkins.reta|GET|/api/conan/local_conan/v1/conans/cclconanlibs/0.27.1-develop+build.23/inseinc/stable/digest|HTTP/1.1|400|0
The Windows machine also has the following environment variable set.
CONAN_REVISIONS_ENABLED=1
Software Versions:
Conan : 1.18.1
OS : Windows 10
Artifactory : 6.11.1
Jenkins : 2.187
As always, any insight is appreciated!
Hi @luckielordie
Can you please check and share that the API v2 is being used if you are calling the commands by hand in the server?
BTW, I think that setting revisions_enabled = 1 in conan.conf is enough, you do not need the CONAN_REVISIONS_ENABLED env-var.
Hi @memsharded
I can confirm if I run the commands by hand that the v2 API is used.
I set the Env Var out of pure desperation xD
20190809173741|19|REQUEST|172.17.0.65|service.jenkins.reta|GET|/api/conan/inseinc_conan/v1/ping|HTTP/1.1|200|0
20190809173742|575|REQUEST|172.17.0.65|service.jenkins.reta|GET|/api/conan/inseinc_conan/v2/conans/cclconanlibs/0.27.1/inseinc/stable/revisions/1acc68f4a908378274668aa6ac9788e8929bb26b/files/conanmanifest.txt|HTTP/1.1|404|0
This is interesting, just got a conan_trace output and it seems to be using Conan/1.10.0 in the User-Agent portion of the trace.
{"_action": "COMMAND", "name": "config_install", "parameters": {}, "time": 1565603036.4191353}
{"_action": "COMMAND", "name": "authenticate", "parameters": {"password": "**********", "remote_name": "inseinc"}, "time": 1565603037.8062952}
{"_action": "COMMAND", "name": "get_remote_by_name", "parameters": {}, "time": 1565603037.8082974}
{"_action": "REST_API_CALL", "duration": 0.07801008224487305, "headers": {"Authorization": "**********", "User-Agent": "Conan/1.10.0 (Python 3.6.6) python-requests/2.20.1", "X-Client-Anonymous-Id": "**********", "X-Conan-Client-Version": "1.10.0"}, "method": "GET", "time": 1565603037.8903055, "url": "https://artifactory.ingg.com/artifactory/api/conan/inseinc_conan/v1/ping"}
{"_action": "REST_API_CALL", "duration": 0.3530430793762207, "headers": {"Authorization": "**********", "User-Agent": "Conan/1.10.0 (Python 3.6.6) python-requests/2.20.1", "X-Client-Anonymous-Id": "**********", "X-Conan-Client-Version": "1.10.0"}, "method": "GET", "time": 1565603038.2443492, "url": "https://artifactory.ingg.com/artifactory/api/conan/inseinc_conan/v1/users/authenticate"}
{"_action": "COMMAND", "name": "create", "parameters": {"test_build_folder": null}, "time": 1565603039.137451}
{"_action": "GOT_RECIPE_FROM_LOCAL_CACHE", "_id": "cclconanlibs/0.27.1@inseinc/stable", "time": 1565603041.762748}
{"_action": "PACKAGE_BUILT_FROM_SOURCES", "_id": "cclconanlibs/0.27.1@inseinc/stable:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9", "duration": 0.1380317211151123, "log": null, "time": 1565603041.915782}
{"_action": "COMMAND", "name": "config_get", "parameters": {}, "time": 1565603042.68985}
{"_action": "COMMAND", "name": "upload", "parameters": {"all_packages": true, "confirm": true, "integrity_check": false, "package": null, "pattern": "cclconanlibs*", "policy": null, "query": null, "remote_name": "inseinc", "retry": 2, "retry_wait": 5}, "time": 1565603043.6319644}
{"_action": "REST_API_CALL", "duration": 0.07100892066955566, "headers": {"Authorization": "**********", "User-Agent": "Conan/1.10.0 (Python 3.6.6) python-requests/2.20.1", "X-Client-Anonymous-Id": "**********", "X-Client-Id": "service.jenkins.reta", "X-Conan-Client-Version": "1.10.0"}, "method": "GET", "time": 1565603043.8909998, "url": "https://artifactory.ingg.com/artifactory/api/conan/inseinc_conan/v1/ping"}
{"_action": "REST_API_CALL", "duration": 0.01300048828125, "headers": {"Authorization": "**********", "User-Agent": "Conan/1.10.0 (Python 3.6.6) python-requests/2.20.1", "X-Client-Anonymous-Id": "**********", "X-Client-Id": "service.jenkins.reta", "X-Conan-Client-Version": "1.10.0"}, "method": "GET", "time": 1565603043.9049978, "url": "https://artifactory.ingg.com/artifactory/api/conan/inseinc_conan/v1/conans/cclconanlibs/0.27.1/inseinc/stable/digest"}
{"_action": "EXCEPTION", "class": "RequestErrorException", "message": "{\n \"errors\" : [ {\n \"status\" : 400,\n \"message\" : \"Unsupported Conan v1 repository request for 'inseinc_conan'\"\n } ]\n}. [Remote: inseinc]", "time": 1565603043.9079976}
Okay gang, let us see who's really haunting my project!
It's old man Pipenv!
So PipEnv was configured to be using Conan 1.10.0 rather than a version that actually supports what I was doing. Heed my warning people who read this, don't fall for the same 2 day trap I did....
Most helpful comment
Okay gang, let us see who's really haunting my project!
It's old man Pipenv!
So PipEnv was configured to be using Conan 1.10.0 rather than a version that actually supports what I was doing. Heed my warning people who read this, don't fall for the same 2 day trap I did....