Uploaded image for project: 'Project Quay'
  1. Project Quay
  2. PROJQUAY-3701

Quay 3.7.0 API update default quota should not return 500 internal error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • quay-v3.7.1
    • quay-v3.7.0
    • quay
    • False
    • None
    • False

      Description:

      This is an issue found when trying to update Quay 3.7.0 system default Quota with API, now if give PUT method to update default Quota, Quay will response with 500 internal, actually here should use POST method, but once users use PUT method, Quay should not return 500 error, the expected results should be "Quay should give 405 error code indicating that this method is not support". So Quay Customers will check and get to know use POST method, this will improve Quay API user experience. Attached the detailed logs quay370_app_pod2.logs 

      The 405 Method Not Allowed error occurs when the web server is configured in a way that does not allow you to perform a specific action for a particular URL. It's an HTTP response status code that indicates that the request method is known by the server but is not supported by the target resource. 

      Quay Image: quay-operator-bundle-container-v3.7.0-99

      curl --location --request PUT 'https://quay370.apps.quayperf370.perfscale.devcluster.openshift.com/api/v1/superuser/users/testing/quota/' \--header 'Content-Type: application/json' \--header 'Authorization: Bearer WBeDtyhi9H9E1Sq9S59O8e6jD0zU0GSiLSiwHhzz' \--header 'Cookie: _csrf_token=eyJfY3NyZl90b2tlbiI6InkyS3psYVE0OTNrTEg0Mm1lT3p0cHpQLVlPam5VMlliMl9GWno3X2NfUk5TVnBWdXVZb05WVG9pbFZuazlNSjQifQ.YmfFRg.eq98Q2pIvs0yKU_KaoVi0c3BDZc' \--data-raw '{"limit_bytes": 3024000000}' 

      Response:

      <html>
      <head>    <title>Internal Server Error</title></head>
      <body>    <h1>        <p>Internal Server Error</p>    </h1>
      </body>
      </html> 

      Quay APP POD logs:

      gunicorn-web stdout | 2022-04-27 02:18:23,521 [220] [ERROR] [gunicorn.error] Error handling request /api/v1/superuser/users/testing/quota
      gunicorn-web stdout | Traceback (most recent call last):
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1949, in full_dispatch_request
      gunicorn-web stdout |     rv = self.dispatch_request()
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1925, in dispatch_request
      gunicorn-web stdout |     self.raise_routing_exception(req)
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1907, in raise_routing_exception
      gunicorn-web stdout |     raise request.routing_exception
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/flask/ctx.py", line 350, in match_request
      gunicorn-web stdout |     result = self.url_adapter.match(return_rule=True)
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/werkzeug/routing.py", line 1798, in match
      gunicorn-web stdout |     raise MethodNotAllowed(valid_methods=list(have_match_for))
      gunicorn-web stdout | werkzeug.exceptions.MethodNotAllowed: 405 Method Not Allowed: The method is not allowed for the requested URL.
      gunicorn-web stdout | During handling of the above exception, another exception occurred:
      gunicorn-web stdout | Traceback (most recent call last):
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/flask_restful/__init__.py", line 227, in _should_use_fr_error_handler
      gunicorn-web stdout |     adapter.match()
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/werkzeug/routing.py", line 1798, in match
      gunicorn-web stdout |     raise MethodNotAllowed(valid_methods=list(have_match_for))
      gunicorn-web stdout | werkzeug.exceptions.MethodNotAllowed: 405 Method Not Allowed: The method is not allowed for the requested URL.
      gunicorn-web stdout | During handling of the above exception, another exception occurred:
      gunicorn-web stdout | Traceback (most recent call last):
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/werkzeug/routing.py", line 1742, in match
      gunicorn-web stdout |     rv = rule.match(path, method)
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/werkzeug/routing.py", line 834, in match
      gunicorn-web stdout |     raise RequestSlash()
      gunicorn-web stdout | werkzeug.routing.RequestSlash
      gunicorn-web stdout | During handling of the above exception, another exception occurred:
      gunicorn-web stdout | Traceback (most recent call last):
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2446, in wsgi_app
      gunicorn-web stdout |     response = self.full_dispatch_request()
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1951, in full_dispatch_request
      gunicorn-web stdout |     rv = self.handle_user_exception(e)
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/flask_restful/__init__.py", line 264, in error_router
      gunicorn-web stdout |     if self._has_fr_route():
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/flask_restful/__init__.py", line 242, in _has_fr_route
      gunicorn-web stdout |     if self._should_use_fr_error_handler():
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/flask_restful/__init__.py", line 231, in _should_use_fr_error_handler
      gunicorn-web stdout |     rule, _ = adapter.match(method=valid_route_method, return_rule=True)
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/werkzeug/routing.py", line 1744, in match
      gunicorn-web stdout |     raise RequestRedirect(
      gunicorn-web stdout | werkzeug.routing.RequestRedirect: 308 Permanent Redirect: None
      gunicorn-web stdout | During handling of the above exception, another exception occurred:
      gunicorn-web stdout | Traceback (most recent call last):
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/flask_restful/__init__.py", line 227, in _should_use_fr_error_handler
      gunicorn-web stdout |     adapter.match()
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/werkzeug/routing.py", line 1798, in match
      gunicorn-web stdout |     raise MethodNotAllowed(valid_methods=list(have_match_for))
      gunicorn-web stdout | werkzeug.exceptions.MethodNotAllowed: 405 Method Not Allowed: The method is not allowed for the requested URL.
      gunicorn-web stdout | During handling of the above exception, another exception occurred:
      gunicorn-web stdout | Traceback (most recent call last):
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/werkzeug/routing.py", line 1742, in match
      gunicorn-web stdout |     rv = rule.match(path, method)
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/werkzeug/routing.py", line 834, in match
      gunicorn-web stdout |     raise RequestSlash()
      gunicorn-web stdout | werkzeug.routing.RequestSlash
      gunicorn-web stdout | During handling of the above exception, another exception occurred:
      gunicorn-web stdout | Traceback (most recent call last):
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base_async.py", line 55, in handle
      gunicorn-web stdout |     self.handle_request(listener_name, req, client, addr)
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/ggevent.py", line 127, in handle_request
      gunicorn-web stdout |     super().handle_request(listener_name, req, sock, addr)
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base_async.py", line 108, in handle_request
      gunicorn-web stdout |     respiter = self.wsgi(environ, resp.start_response)
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2463, in __call__
      gunicorn-web stdout |     return self.wsgi_app(environ, start_response)
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/werkzeug/middleware/proxy_fix.py", line 232, in __call__
      gunicorn-web stdout |     return self.app(environ, start_response)
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2449, in wsgi_app
      gunicorn-web stdout |     response = self.handle_exception(e)
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/flask_restful/__init__.py", line 264, in error_router
      gunicorn-web stdout |     if self._has_fr_route():
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/flask_restful/__init__.py", line 242, in _has_fr_route
      gunicorn-web stdout |     if self._should_use_fr_error_handler():
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/flask_restful/__init__.py", line 231, in _should_use_fr_error_handler
      gunicorn-web stdout |     rule, _ = adapter.match(method=valid_route_method, return_rule=True)
      gunicorn-web stdout |   File "/usr/local/lib/python3.8/site-packages/werkzeug/routing.py", line 1744, in match
      gunicorn-web stdout |     raise RequestRedirect(
      gunicorn-web stdout | werkzeug.routing.RequestRedirect: 308 Permanent Redirect: None
      gunicorn-web stdout | 2022-04-27 02:18:23,524 [220] [INFO] [gunicorn.access]  - - [27/Apr/2022:02:18:23 +0000] "PUT /api/v1/superuser/users/testing/quota HTTP/1.0" 500 0 "-" "-"

              sdadi@redhat.com Sunanda Dadi
              lzha1981 luffy zhang
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: