-
Bug
-
Resolution: Done
-
Major
-
quay-v3.4.0
Description:
This is an issue found when remove a robot account, that robot account was configured to be used in a repository mirror configurations, after click "Delete Robot Account", get quay 500 error page, checked Quay POD logs, get "peewee.IntegrityError: null value in column "internal_robot_id" violates not-null constraint"
Quay Image: quay.io/projectquay/quay:50ba6130
Steps:
- Login Quay Console
- Create new image repositoryA
- Create new robot account and assign write permissions to image repository repositoryA
- Configure image repositoryA as mirror status by using above robot account
- Remove robot account
Expected Results:
Robot account should not be allowed to remove, and pop up appropriate warning message to users.
Actual Results:
Remove Robot account get quay 500 error page.
Quay POD Logs:
gunicorn-web stdout | 2020-08-06 09:19:25,197 [372] [ERROR] [gunicorn.error] Error handling request /api/v1/organization/qateam/robots/busybox gunicorn-web stdout | Traceback (most recent call last): gunicorn-web stdout | File "/usr/local/lib/python3.6/site-packages/peewee.py", line 3057, in execute_sql gunicorn-web stdout | cursor.execute(sql, params or ()) gunicorn-web stdout | psycopg2.errors.NotNullViolation: null value in column "internal_robot_id" violates not-null constraint gunicorn-web stdout | DETAIL: Failing row contains (3, 8, 2020-08-05 09:47:45.443056, t, 1, null, null, null, {"verify_tls": false, "proxy": {"http_proxy": null, "https_proxy..., 600, 2020-08-05 09:50:00, 2020-08-05 14:00:21.668584, 3, 2, 70368c7a-d79b-4a43-ac97-8133880a6faf, 3, docker.io/busybox). 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.6/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.6/site-packages/gunicorn/workers/ggevent.py", line 143, in handle_request gunicorn-web stdout | super().handle_request(listener_name, req, sock, addr) gunicorn-web stdout | File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/base_async.py", line 106, in handle_request gunicorn-web stdout | respiter = self.wsgi(environ, resp.start_response) gunicorn-web stdout | File "/usr/local/lib/python3.6/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.6/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.6/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.6/site-packages/flask_restful/__init__.py", line 269, in error_router gunicorn-web stdout | return original_handler(e) gunicorn-web stdout | File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1866, in handle_exception gunicorn-web stdout | reraise(exc_type, exc_value, tb) gunicorn-web stdout | File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 38, in reraise gunicorn-web stdout | raise value.with_traceback(tb) gunicorn-web stdout | File "/usr/local/lib/python3.6/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.6/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.6/site-packages/flask_restful/__init__.py", line 269, in error_router ...... gunicorn-web stdout | model.user.delete_robot(robot_username) gunicorn-web stdout | File "/quay-registry/data/model/user.py", line 505, in delete_robot gunicorn-web stdout | robot.delete_instance(recursive=True, delete_nullable=True) gunicorn-web stdout | File "/quay-registry/data/database.py", line 643, in delete_instance gunicorn-web stdout | _model.update(**{fk.name: None}).where(query).execute() gunicorn-web stdout | File "/usr/local/lib/python3.6/site-packages/peewee.py", line 1845, in inner gunicorn-web stdout | return method(self, database, *args, **kwargs) gunicorn-web stdout | File "/usr/local/lib/python3.6/site-packages/peewee.py", line 1916, in execute gunicorn-web stdout | return self._execute(database) gunicorn-web stdout | File "/usr/local/lib/python3.6/site-packages/peewee.py", line 2400, in _execute gunicorn-web stdout | cursor = database.execute(self) gunicorn-web stdout | File "/usr/local/lib/python3.6/site-packages/peewee.py", line 3070, in execute gunicorn-web stdout | return self.execute_sql(sql, params, commit=commit) gunicorn-web stdout | File "/quay-registry/data/database.py", line 213, in execute_sql gunicorn-web stdout | cursor = super(RetryOperationalError, self).execute_sql(sql, params, commit) gunicorn-web stdout | File "/usr/local/lib/python3.6/site-packages/peewee.py", line 3064, in execute_sql gunicorn-web stdout | self.commit() gunicorn-web stdout | File "/usr/local/lib/python3.6/site-packages/peewee.py", line 2831, in __exit__ gunicorn-web stdout | reraise(new_type, new_type(exc_value, *exc_args), traceback) gunicorn-web stdout | File "/usr/local/lib/python3.6/site-packages/peewee.py", line 183, in reraise gunicorn-web stdout | raise value.with_traceback(tb) gunicorn-web stdout | File "/usr/local/lib/python3.6/site-packages/peewee.py", line 3057, in execute_sql gunicorn-web stdout | cursor.execute(sql, params or ()) gunicorn-web stdout | peewee.IntegrityError: null value in column "internal_robot_id" violates not-null constraint gunicorn-web stdout | DETAIL: Failing row contains (3, 8, 2020-08-05 09:47:45.443056, t, 1, null, null, null, {"verify_tls": false, "proxy": {"http_proxy": null, "https_proxy..., 600, 2020-08-05 09:50:00, 2020-08-05 14:00:21.668584, 3, 2, 70368c7a-d79b-4a43-ac97-8133880a6faf, 3, docker.io/busybox). gunicorn-web stdout | 2020-08-06 09:19:25,202 [372] [INFO] [gunicorn.access] - - [06/Aug/2020:09:19:25 +0000] "DELETE /api/v1/organization/qateam/robots/busybox HTTP/1.0" 500 0 "-" "-"