singularityhub / sregistry-cli

Singularity Global Client for container management
https://singularityhub.github.io/sregistry-cli/
Mozilla Public License 2.0
14 stars 18 forks source link

Push returning 415 Unsupported Media Type #195

Closed jcstrouth closed 5 years ago

jcstrouth commented 5 years ago

When pushing to local sregistry using registry backend I get this error from the client: [1. Collection return status 415 Unsupported Media Type]

The sregistry server gives this error:

nginx_1   | 2019/05/10 15:19:34 [error] 6#6: *1 Content-Type is not multipart/form-data and resumable uploads are off: application/json, client: 192.168.38.72, server: localhost, request: "POST /upload/chunked_upload HTTP/1.1", host: "192.168.38.72:6701"
nginx_1   | 192.168.38.72 - - [10/May/2019:15:19:34 +0000] "POST /upload/chunked_upload HTTP/1.1" 415 195 "-" "python-requests/2.21.0" "-"

Happens each time I try to push: sregistry push --name x86-64/myservice:latest myservice.img

The expected behavior would be successful upload of image to sregistry server.

Singularity Version: 3.1.1 SRegistry Client Version: 0.1.40

I am able to upload all images successfully using the sregistry web interface, but only encounter issues with the CLI.

vsoch commented 5 years ago

Have you tried a different name?

vsoch commented 5 years ago

Based on the message, the issue I think is with the collection naming.

jcstrouth commented 5 years ago

Tried to push using the command: sregistry push --name test/myservice:latest myservice.img

I still get the same errors.

vsoch commented 5 years ago

Did you install sregistry server after nginx uploads were added, or did you upgrade a previous version (that didn't have it?)

I'll try to reproduce. Can you give me the commands to build your container (or it doesn't work with any container built with Singularity 3+?)

vsoch commented 5 years ago

Another thing to check - have you installed sregistry multiple times? If so, issue this command until it says that it isn't installed:

pip uninstall sregistry

and then install again

pip install sregistry

It could be you are using one of the older installs (this has happened to me before).

vsoch commented 5 years ago

okay great, I just reproduced your issue.

$ SREGISTRY_CLIENT=registry sregistry push --name mycollection/salad:latest salad_latest.sif 
[client|registry] [database|sqlite:////home/vanessa/.singularity/sregistry.db]

[1. Collection return status 415 Unsupported Media Type]

Let me see if I can figure out what is going on.

vsoch commented 5 years ago

It's a bug! I figured it out, will open PR soon.

vsoch commented 5 years ago

@jcstrouth would you care to test? Instructions are in the description there:

https://github.com/singularityhub/sregistry-cli/pull/196

When you've tested and confirmed working, and merge and we will re-release asap.

jcstrouth commented 5 years ago

Awesome, works now. Thanks!

vsoch commented 5 years ago

Great! I'll get it merged and update the PR when it's released on pypi.