Howto download assets from raw repository

1,436 views
Skip to first unread message

Mariska

unread,
Nov 2, 2018, 7:04:25 AM11/2/18
to Nexus Users
Hi,
I've uploaded some artifacts to a hosted raw repository. However, I'm unable to download those artifacts.

I can run a curl query to retrieve the downloadUrl, but when I then try to download it, I get a 404.

command to search the assets:
$ curl -sSL -k -u admin:admin123 -X GET -G https://nexus3.domain.local/service/rest/v1/assets?repository=cc-oc-raw-internal
{
 
"items" : [ {
   
"downloadUrl" : "https://nexus3.domain.local/repository/cc-oc-raw-internal/./Certificates/XXX/xxx_holland_subordinate_ca.pem",
   
"path" : "./Certificates/XXX/xxx_holland_subordinate_ca.pem",
   
"id" : "Y2Mtb2MtcmF3LWludGVybmFsOmJiNmM2ZWY5Nzk2ZGFjODM5NjI2NDY3NmUzNGM1YTMw",
   
"repository" : "cc-oc-raw-internal",
   
"format" : "raw",
   
"checksum" : {
     
"sha1" : "7b49911346694edd404a1006308b61f4e3833eeb",
     
"md5" : "526b154c4f835198c68fd63ef5b1f5df"
   
}
 
}],
}

If I then try to download the asset based on the downloadUrl, I get a 404:
curl k -u admin:admin123 -fsSL https://nexus3.domain.local/repository/cc-oc-raw-internal/./Certificates/XXX/xxx_holland_subordinate_ca.pem -O  
curl
: (22) The requested URL returned error: 404 Certificates/XXX/xxx_holland_subordinate_ca.pem



Am I doing something wrong?

Thanks,
Mariska

Michael Martz

unread,
Nov 2, 2018, 8:35:40 AM11/2/18
to talla...@gmail.com, nexus...@glists.sonatype.com
I suspect it's because the path to the asset starts with "./". Perhaps you could try removing the ./ from the url? What does the browse tree look like for that asset?
--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/18ce6439-3429-458f-aad0-f135dc924f47%40glists.sonatype.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.


--
Michael Martz
Software Engineer
Sonatype

Mariska

unread,
Nov 5, 2018, 3:23:23 AM11/5/18
to Nexus Users, talla...@gmail.com

The dot is visible in the UI view:

Screenshot_20181105_091302.png


However, it was indeed caused by the "." in the path. I've removed the assets and uploaded them again without the "." and now I can download them. Maybe you can add a note to the documentation that a '.' is not allowed. I thought I saw a "." in the example in the UI, however, it turns out, this is the "." from "e.g." after I enlarged my browser :-)

Thanks for the suggestion, Michael!

Mariska.
Reply all
Reply to author
Forward
0 new messages