0

I am using curl to search artifacts from Artifactory, like this:

curl -s -u user:passwd http://artifactory:8081/artifactory/api/search/gavc?a=8710&v=REL-0041-20181219.003944-userdebug&c=fastboot | /usr/bin/jq -r .results[].uri

But it shows access denied error

[1] 25600
[2] 25601
[2]+  Done v=REL-0041-20181119.003944-userdebug
Access denied

access denied

I have no idea how to debug this problem, give me some idea please.

curl version: 7.47.0

2
  • try curl -s -u user:passwd "http://artifactory:8081/artifactory/api/search/gavc?a=8710&v=REL-0041-20181219.003944-userdebug&c=fastboot" first, your command is not correctly escaped Dec 19, 2018 at 2:27
  • Still access denied.
    – Corey
    Dec 19, 2018 at 2:31

2 Answers 2

3

It's several different questions.

  1. Your uri is not escaped so [1][2][2]+ messages means & treated as background execution, you need to quote uri with ""

  2. You use -s which means silent, so error messages are suppressed. Please remove -s and see what error curl encountered, solve them, and then you add back jq command.

  3. If your problem is essentially artifactory usage, you can add artifactory to your title.

1
  • 1
    I tried curl -v -u user:passwd "url", it prints more log and seems like this problem caused by proxy.
    – Corey
    Dec 19, 2018 at 3:46
0

Had similar issue.

Using the -v parameter i see that proxy -is- used even though localhost should -not- be used.

A workarount for me is to unset http env variables:

For your env see: set|grep -i http

unset ...

Next step is to exlude localhost, 127.0.0.1

no_proxy=localhost,127.0.0.1 export no_proxy

It may be set in /etc/environment or /etc/bash.bashrc

Check this too. Don't forget to logout/in if you change things here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .