Issue with accessing artifactory repos behind corporate proxies with Chocolatey

  artifactory, chocolatey, nuget, windows

We are trying to setup Chocolatey for our windows deployments in our infrastructure but we are running into below issue with accessing jfrog Artifactory repos behind corporate proxy with Chocolatey.

Error: [NuGet] This operation is not supported for a relative URI.

Our current setup:
Central jfrog artifactory server which is accessed through our nginx proxies(diff per environment running in a docker container). The same setup works fine with our YUM deploys for Linux but having issues with Chocolatey.

chocolatey-nuget-poc is a NuGet repo in artifactory.

Source added to chocolatey – http://artif/artifactory/api/nuget/chocolatey-nuget-poc by running the below command.

choco source add -n='artif' -s='http://artif/artifactory/api/nuget/chocolatey-nuget-poc' -u='username' -p='password'

Artif is the short DNS for proxies that gets automatically resolved based on the environment.

When I try to list or search the packages by running “choco list –all” or I try to install a package that exists in the repo by running “choco install -y <package>” I’m getting “[NuGet] This operation is not supported for a relative URI.” Error.

Below is the full o/p with trace enabled.

PS C:Usersadmin> choco source list
Chocolatey v0.10.15
artif - http://artif/artifactory/api/nuget/chocolatey-nuget-poc (Authenticated)| Priority 0|Bypass Proxy - False|Self-Service - False|Admin Onl
y - False.

PS C:Usersadmin> choco list --all --trace
Chocolatey v0.10.15
 Operating System Version Number: 6.3.9600.0
System.Net Error: 0 : [15724] Can't retrieve proxy settings for Uri 'http://artif/artifactory/api/nuget/chocolatey-nuget-poc'. Error code: 12180.
System.Net Information: 0 : [15724] Associating HttpWebRequest#44041463 with ServicePoint#60828848
System.Net Information: 0 : [15724] Associating Connection#10588721 with HttpWebRequest#44041463
System.Net.Sockets Information: 0 : [15724] Socket#28189627 - Created connection from <SOURCE_IP>:<PORT_NUM> to <TARGET_IP>:80.
System.Net Information: 0 : [15724] Connection#10588721 - Created connection from <SOURCE_IP>:<PORT_NUM> to <TARGET_IP>:80.
System.Net Information: 0 : [15724] Associating HttpWebRequest#44041463 with ConnectStream#1658455
System.Net Information: 0 : [15724] HttpWebRequest#44041463 - Request: GET /artifactory/api/nuget/chocolatey-nuget-poc HTTP/1.0

System.Net Information: 0 : [15724] ConnectStream#1658455 - Sending headers
{
User-Agent: NuGet/0.10.15.0 (Microsoft Windows NT 6.3.9600.0)
Host: artif
}.
System.Net Information: 0 : [15724] Connection#10588721 - Received status line: Version=1.1, StatusCode=200, StatusDescription=OK.
System.Net Information: 0 : [15724] Connection#10588721 - Received headers
{
Connection: close
X-Artifactory-Id: <ARTIFACTORY_ID>
X-Artifactory-Node-Id: art4
DataServiceVersion: 1.0
Cache-Control: max-age=259200,public
Content-Type: application/xml;charset=utf-8
Date: Wed, 18 Nov 2020 19:48:33 GMT
Expires: Sat, 21 Nov 2020 19:48:33 GMT
Server: Artifactory/6.11.6
X-Proxy-Cache: HIT
}.
System.Net Information: 0 : [15724] ConnectStream#14926099::ConnectStream(Buffered -1 bytes.)
System.Net Information: 0 : [15724] Associating HttpWebRequest#44041463 with ConnectStream#14926099
System.Net Information: 0 : [15724] Associating HttpWebRequest#44041463 with HttpWebResponse#117163
System.Net Information: 0 : [15724] Associating HttpWebRequest#1054474 with ServicePoint#60828848
System.Net Information: 0 : [15724] Associating Connection#9490272 with HttpWebRequest#1054474
System.Net.Sockets Information: 0 : [15724] Socket#18303590 - Created connection from <SOURCE_IP>:53523 to <TARGET_IP>:80.
System.Net Information: 0 : [15724] Connection#9490272 - Created connection from <SOURCE_IP>:53523 to <TARGET_IP>:80.
System.Net Information: 0 : [15724] Associating HttpWebRequest#1054474 with ConnectStream#6195855
System.Net Information: 0 : [15724] HttpWebRequest#1054474 - Request: GET /artifactory/api/nuget/chocolatey-nuget-poc/$metadata HTTP/1.0

System.Net Information: 0 : [15724] ConnectStream#6195855 - Sending headers
{
User-Agent: NuGet/0.10.15.0 (Microsoft Windows NT 6.3.9600.0)
Host: artif
}.
System.Net Information: 0 : [15724] Connection#9490272 - Received status line: Version=1.1, StatusCode=200, StatusDescription=OK.
System.Net Information: 0 : [15724] Connection#9490272 - Received headers
{
Connection: close
X-Artifactory-Id: <ARTIFACTORY_ID>
X-Artifactory-Node-Id: art4
DataServiceVersion: 1.0
Cache-Control: max-age=259200,public
Content-Type: application/xml;charset=utf-8
Date: Wed, 18 Nov 2020 19:48:33 GMT
Expires: Sat, 21 Nov 2020 19:48:33 GMT
Server: Artifactory/6.11.6
X-Proxy-Cache: HIT
}.
System.Net Information: 0 : [15724] ConnectStream#55762700::ConnectStream(Buffered -1 bytes.)
System.Net Information: 0 : [15724] Associating HttpWebRequest#1054474 with ConnectStream#55762700
System.Net Information: 0 : [15724] Associating HttpWebRequest#1054474 with HttpWebResponse#32102252
System.Net Information: 0 : [15724] ContentLength=-1
System.Net Information: 0 : [23096] Associating HttpWebRequest#56380403 with ServicePoint#60828848
System.Net Information: 0 : [23096] Associating Connection#24418974 with HttpWebRequest#56380403
System.Net.Sockets Information: 0 : [23096] Socket#37061622 - Created connection from <SOURCE_IP>:53524 to <TARGET_IP>:80.
System.Net Information: 0 : [23096] Connection#24418974 - Created connection from <SOURCE_IP>:53524 to <TARGET_IP>:80.
System.Net Information: 0 : [23096] Associating HttpWebRequest#56380403 with ConnectStream#30311863
System.Net Information: 0 : [23096] HttpWebRequest#56380403 - Request: GET /artifactory/api/nuget/chocolatey-nuget-poc/Search()?$orderby=Id,Version%20desc&$skip=0&$top=30&searchTerm=''&targetFr
amework=''&includePrerelease=false HTTP/1.1

System.Net Information: 0 : [23096] ConnectStream#30311863 - Sending headers
{
DataServiceVersion: 1.0;NetFx
MaxDataServiceVersion: 2.0;NetFx
User-Agent: Chocolatey Core
Accept: application/atom+xml,application/xml
Accept-Charset: UTF-8
Host: artif
Accept-Encoding: gzip, deflate
}.
System.Net Information: 0 : [23096] Connection#24418974 - Received status line: Version=1.1, StatusCode=200, StatusDescription=OK.
System.Net Information: 0 : [23096] Connection#24418974 - Received headers
{
Transfer-Encoding: chunked
Connection: keep-alive
X-Artifactory-Id: 64be1a761a00dc64f9334333559e6162ec059020
X-Artifactory-Node-Id: art3
DataServiceVersion: 2.0
Cache-Control: max-age=259200,public
Content-Type: application/atom+xml;charset=utf-8
Date: Wed, 18 Nov 2020 19:48:33 GMT
Expires: Sat, 21 Nov 2020 19:48:33 GMT
Server: Artifactory/6.11.6
X-Proxy-Cache: HIT
}.
System.Net Information: 0 : [23096] ConnectStream#6628809::ConnectStream(Buffered -1 bytes.)
System.Net Information: 0 : [23096] Associating HttpWebRequest#56380403 with ConnectStream#6628809
System.Net Information: 0 : [23096] Associating HttpWebRequest#56380403 with HttpWebResponse#58017747
System.Net Information: 0 : [23096] ContentLength=-1
[NuGet] This operation is not supported for a relative URI.
0 packages found.

I tried setting up the proxy in the choco config as well as suggested in How to configure Chocolatey to use a corporate proxy? but still getting the same error.

Appreciate any suggestions on resolving the issue.

Source: Windows Questions

LEAVE A COMMENT