Support for _multipart upload (change in scs-library-client)
See original GitHub issueThe original bug below describes the result when a version of the scs-library-client is installed that is too new - meaning it requests an endpoint that does not exist.
POST RequestPushImageFileView
Internal Server Error: /v2/imagefile/5/_multipart
It looks like this was added less than a month ago. Singularity Registry server has no understanding of this request, so it goes to the wrong view, and thus the argument is parsed incorrectly (it’s hitting the RequestPushFileView which (before they updated their library client) only expected the id of an image.
url(
r"^v2/imagefile/(?P<container_id>.+?)/?$",
views.RequestPushImageFileView.as_view(),
), # return push url
But instead the client is now providing a string with multipart, hence the error you see above. The fix to this issue would be to add the endpoint. It looks like it we provide a 404 (not found) it will resort to the old functionality. https://github.com/sylabs/scs-library-client/blob/30f9b6086f9764e0132935bcdb363cc872ac639d/client/push.go#L274
Describe the bug When pushing a built SIF, the command returns with a error code 500 (from nginx), howver the sregistry conatiner (sregistry_uwsgi_1) throws a python error.
Tracing the the stack is seems a schema/table issue in django actually. see below To Reproduce singularity push -U --library http://<my_server> trax_centos.sif library://daniel_smith/test/trax_centos:latest
< i also tried it the “remote use” method> - same result [daniel.smith@ip-0AB36F04 ~]$ singularity push -U trax_centos.sif
OUTPUT RECEIVED: 0 B / 1.20 GiB [----------------------------------------------------------------------] 0.00% 0s FATAL: Unable to push image to library: request did not succeed: http status code: 500 [daniel.smith@ip-0AB36F04 ~]$
Running the LOGS on the Docker Container - sregistry_uwsgi_1 - i see this trace - the last line of the trace indicating invalid literal for int() with base 10
Check the DB docker container and no errors thrown there. I am able to create Collections and Teams via the UI.
pid: 43|app: 0|req: 44/172] 10.179.111.4 () {32 vars in 670 bytes} [Sun Mar 8 15:13:18 2020] GET /v1/images/daniel_smith/test/trax_centos:sha256.40246353c0a1585594b5db13eaf33beb038dee7cf83cb4d1ed9c22c6ba9eaced?arch=amd64 => generated 556 bytes in 35 msecs (HTTP/1.1 200) 5 headers in 142 bytes (1 switches on core 2) [pid: 42|app: 0|req: 58/173] 10.179.111.4 () {32 vars in 441 bytes} [Sun Mar 8 15:13:18 2020] GET /version => generated 58 bytes in 1 msecs (HTTP/1.1 200) 5 headers in 141 bytes (1 switches on core 2) POST RequestPushImageFileView Internal Server Error: /v2/imagefile/5/_multipart Traceback (most recent call last): File “/usr/local/lib/python3.5/site-packages/django/core/handlers/exception.py”, line 34, in inner response = get_response(request) File “/usr/local/lib/python3.5/site-packages/django/core/handlers/base.py”, line 115, in _get_response response = self.process_exception_by_middleware(e, request) File “/usr/local/lib/python3.5/site-packages/django/core/handlers/base.py”, line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File “/usr/local/lib/python3.5/site-packages/django/views/decorators/csrf.py”, line 54, in wrapped_view return view_func(*args, **kwargs) File “/usr/local/lib/python3.5/site-packages/django/views/generic/base.py”, line 71, in view return self.dispatch(request, *args, **kwargs) File “/usr/local/lib/python3.5/site-packages/ratelimit/mixins.py”, line 58, in dispatch )(super(RatelimitMixin, self).dispatch)(*args, **kwargs) File “/usr/local/lib/python3.5/site-packages/ratelimit/decorators.py”, line 30, in _wrapped return fn(*args, **kw) File “/usr/local/lib/python3.5/site-packages/rest_framework/views.py”, line 505, in dispatch response = self.handle_exception(exc) File “/usr/local/lib/python3.5/site-packages/rest_framework/views.py”, line 465, in handle_exception self.raise_uncaught_exception(exc) File “/usr/local/lib/python3.5/site-packages/rest_framework/views.py”, line 476, in raise_uncaught_exception raise exc File “/usr/local/lib/python3.5/site-packages/rest_framework/views.py”, line 502, in dispatch response = handler(request, *args, **kwargs) File “./shub/apps/library/views/images.py”, line 96, in post container = Container.objects.get(id=container_id) File “/usr/local/lib/python3.5/site-packages/django/db/models/manager.py”, line 82, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File “/usr/local/lib/python3.5/site-packages/django/db/models/query.py”, line 399, in get clone = self.filter(*args, **kwargs) File “/usr/local/lib/python3.5/site-packages/django/db/models/query.py”, line 892, in filter return self._filter_or_exclude(False, *args, **kwargs) File “/usr/local/lib/python3.5/site-packages/django/db/models/query.py”, line 910, in _filter_or_exclude clone.query.add_q(Q(*args, **kwargs)) File “/usr/local/lib/python3.5/site-packages/django/db/models/sql/query.py”, line 1290, in add_q clause, _ = self._add_q(q_object, self.used_aliases) File “/usr/local/lib/python3.5/site-packages/django/db/models/sql/query.py”, line 1318, in _add_q split_subq=split_subq, simple_col=simple_col, File “/usr/local/lib/python3.5/site-packages/django/db/models/sql/query.py”, line 1251, in build_filter condition = self.build_lookup(lookups, col, value) File “/usr/local/lib/python3.5/site-packages/django/db/models/sql/query.py”, line 1116, in build_lookup lookup = lookup_class(lhs, rhs) File “/usr/local/lib/python3.5/site-packages/django/db/models/lookups.py”, line 20, in init self.rhs = self.get_prep_lookup() File “/usr/local/lib/python3.5/site-packages/django/db/models/lookups.py”, line 70, in get_prep_lookup return self.lhs.output_field.get_prep_value(self.rhs) File “/usr/local/lib/python3.5/site-packages/django/db/models/fields/init.py”, line 972, in get_prep_value return int(value) ValueError: invalid literal for int() with base 10: ‘5/_multipart’ [pid: 42|app: 0|req: 59/174] 10.179.111.4 () {34 vars in 505 byte
Expected behavior Container is pushed up to the Sregistry correctly.
If applicable, add versions and screenshots to help explain your problem.
Issue Analytics
- State:
- Created 4 years ago
- Comments:32 (17 by maintainers)
Please put all of the above that are relevant for this second issue in a new issue, this issue is closed as addressed by #283.
@lmcdasm I think I know a quick fix that would address this - if you would be willing to test a PR, I think you can continue using the version of Singularity that you already have. Give me a few minutes to work on a PR.