Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get artifact latest version error #72

Open
xrlin opened this issue Oct 18, 2016 · 1 comment
Open

Get artifact latest version error #72

xrlin opened this issue Oct 18, 2016 · 1 comment

Comments

@xrlin
Copy link

xrlin commented Oct 18, 2016

When i use this gem to get the latest version of an artiface. An error appear. Do i have something wrong in my code? The code and error are shown below.

code

latest_version = Artifact.latest_version(name: 'artifact.apk')
puts latest_version.inspect

error

/home/user/.rvm/gems/ruby-2.3.0/gems/artifactory-2.5.0/lib/artifactory/client.rb:374:in `error': The Artifactory server responded with an HTTP Error 400: `The groupId and artifactId cannot be empty' (Artifactory::Error::HTTPError)
    from /home/user/.rvm/gems/ruby-2.3.0/gems/artifactory-2.5.0/lib/artifactory/client.rb:255:in `block in request'
    from /home/user/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/net/http.rb:853:in `start'
    from /home/user/.rvm/gems/ruby-2.3.0/gems/artifactory-2.5.0/lib/artifactory/client.rb:245:in `request'
    from /home/user/.rvm/gems/ruby-2.3.0/gems/artifactory-2.5.0/lib/artifactory/client.rb:102:in `get'
    from /home/user/.rvm/gems/ruby-2.3.0/gems/artifactory-2.5.0/lib/artifactory/resources/artifact.rb:355:in `latest_version'
    from artifactory_test.rb:12:in `<main>'

Besides, the artifact object's last_modified, local_path, created values are nil but i can get these values from api using curl directly.

The Artifactory server version 4.13.0.

@mccartjm
Copy link

mccartjm commented Sep 7, 2017

I believe that group is now required when requesting the versions from Artifactory. I ran in to this same error.

latest_version = Artifact.latest_version(name: 'artifact.apk', group: )

When I added group, it fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants