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

Server returned non-200 status: 404 Not Found #16

Open
davidstosik opened this issue Sep 3, 2014 · 10 comments
Open

Server returned non-200 status: 404 Not Found #16

davidstosik opened this issue Sep 3, 2014 · 10 comments

Comments

@davidstosik
Copy link

Hello,

I managed to install Gemnasium Toolbelt from APT repositories (=> version is 0.2.5) then set it up following README:

cd myapp/
gemnasium auth login #Then type email and password.
gemnasium configure kenzai/kenzai.me

Then I try to run autoupdate:

GEMNASIUM_TESTSUITE="bundle exec rake spec cucumber coveralls:push" gemnasium au

And it fails with following error:

Server returned non-200 status: 404 Not Found

I even tried to specify as much as possible in the command line:

GEMNASIUM_PROJECT_SLUG="kenzai/kenzai.me" GEMNASIUM_TESTSUITE="bundle exec rake spec cucumber coveralls:push" gemnasium -t [my Gemnasium token] -r au

And it fails with the same error (both times after running my test suite successfully).
On the other hand, the eval command works:

gemnasium eval -f=Gemfile,Gemfile.lock

Gives me a status of all packages.

Is there a problem with this version of Gemnasium toolbelt?

Thanks,

David

@gravis
Copy link
Member

gravis commented Sep 3, 2014

0.2.5 is the latest version, so it should be fine.
Let me investigate, and I'll get back to you asap.

Thanks

@gravis
Copy link
Member

gravis commented Sep 3, 2014

Hi David,

Your project being private, the env var:

GEMNASIUM_PROJECT_SLUG="kenzai/kenzai.me" 

is incorrect. You must use the project slug available in the project settings: https://gemnasium.com/kenzai/kenzai.me/settings

Could you please try again with this project slug instead?

On the other hand, we understand this is confusing, and have filled a ticket to be able to use the github slug as well.

Thanks,
Philippe

@davidstosik
Copy link
Author

The settings page tells me my slug is kenzai/kenzai.me :
Screenshot of the settings page

@gravis
Copy link
Member

gravis commented Sep 4, 2014

Indeed, I replied too quickly, sorry.
Ok, I will use my curl-knife this afternoon to see what's going on with your account.

thanks
Philippe

@gravis
Copy link
Member

gravis commented Sep 4, 2014

Hi,

The message from the API is not displayed by the toolbelt. It will be fixed in the next version (0.2.6):

{"message":"Cannot find branch '1106-xxxxxxx-xxxxxxx' for project 'kenzai/kenzai.me' in your user account."}

(from our logs).

So Gemnasium doesn't know anything about the current branch, and fails. To use the auto-update feature, the files must be sent priori to run the feature.
You may want to run:

gemnasium df  push -f Gemfile,Gemfile.lock

from the branch 1106-xxxxxxx-xxxxxxx (full name obfuscated) to let Gemnasium calculate the update sets.

Could you tell if it helps?

Thanks
Philippe

@davidstosik
Copy link
Author

Hi, thanks for your help. I tried again on our production branch, known of Gemnasium:

$ GEMNASIUM_TESTSUITE="bundle exec rake spec cucumber coveralls:push" gemnasium au
Executing test script: Executing test script...........(lots of dots)......done (930.485605s)
The current revision (347750a136eeb1e3471b0908d2d37f6d46ae0b01) is unknown on Gemnasium, please push your dependency files before running autoupdate.
See `gemnasium df help push`.
Server returned non-200 status: 409 Conflict

So I tried this:

$ gemnasium df push
[warning] No files given, scanning current directory instead.
Found: Gemfile
Found: Gemfile.lock
Sending files to Gemnasium: Server returned non-200 status: 422 status code 422

Note: my .gemnasium.yaml file contains the project slug:

gemnasium eval -f=Gemfile,Gemfile.lock

And ~/.netrc contains the right token to Gemnasium:

machine api.gemnasium.com
        login david@kenzai.me
        password [valid token, same as on Gemnasium.com]

Is there anything else I might be doing wrong?

@davidstosik
Copy link
Author

It seems I finally got it to work, but I'm not sure what I did that made it work...

@gravis
Copy link
Member

gravis commented Sep 8, 2014

Ok, I'm closing this for now, and will reopen if it occurs again.
Thanks for reporting it.

@gravis gravis closed this as completed Sep 8, 2014
@KazW
Copy link

KazW commented Jan 21, 2015

I'm getting the same issue, unfortunately I haven't had any luck with the following:
gemnasium --token $GEMNASIUM_TOKEN df push -f Gemfile,Gemfile.lock
Sending files to Gemnasium: Server returned non-200 status: 422 status code 422

The eval command works, and I'm able to get the project's current status. gemnasium --token $GEMNASIUM_TOKEN p s

@KazW
Copy link

KazW commented Jan 21, 2015

I managed to get this working, the problem turned out to be that the CI server was checking out a commit and not being on a branch. Being on a branch is not ideal, if additional commits have been made since a build was queued, they'll get pulled at the start of the build, and the build won't be testing the commit it should be. This is how CodeShip works, and this makes is how any CI server that doesn't have concurrent builds should operate.

This is the work around on CodeShip to get auto updating working:
Build Setup:

# Gemnasium Setup
cd $HOME
wget https://github.com/gemnasium/toolbelt/releases/download/${GEMNASIUM_VERSION}/gemnasium_${GEMNASIUM_VERSION}_linux_amd64.tar.gz
tar xf gemnasium_${GEMNASIUM_VERSION}_linux_amd64.tar.gz
cp gemnasium_${GEMNASIUM_VERSION}_linux_amd64/gemnasium bin/gemnasium
rm -rf gemnasium_${GEMNASIUM_VERSION}_linux_amd64 gemnasium_${GEMNASIUM_VERSION}_linux_amd64.tar.gz
# Project setup
cd $HOME/clone
git checkout "$CI_BRANCH"
git reset --hard
rvm use `cat .ruby-version` --install
bin/bundle install
bin/rake db:reset

Build commands:

# bin/rspec
gemnasium --token $GEMNASIUM_TOKEN autoupdate

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

3 participants