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

Bad validation leads to sqlite3 exception #65

Open
cmd-ntrf opened this issue Mar 4, 2022 · 0 comments
Open

Bad validation leads to sqlite3 exception #65

cmd-ntrf opened this issue Mar 4, 2022 · 0 comments
Assignees

Comments

@cmd-ntrf
Copy link
Member

cmd-ntrf commented Mar 4, 2022

mc-hub-api-1      | ERROR:root:An error occurred while planning changes. hostname: living-molly.calculquebec.cloud
mc-hub-api-1      | [2022-03-04 16:22:19,448] ERROR in app: Exception on /api/magic-castles [POST]
mc-hub-api-1      | Traceback (most recent call last):
mc-hub-api-1      |   File "/home/mcu/venv/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
mc-hub-api-1      |     response = self.full_dispatch_request()
mc-hub-api-1      |   File "/home/mcu/venv/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
mc-hub-api-1      |     rv = self.handle_user_exception(e)
mc-hub-api-1      |   File "/home/mcu/venv/lib/python3.9/site-packages/flask_cors/extension.py", line 165, in wrapped_function
mc-hub-api-1      |     return cors_after_request(app.make_response(f(*args, **kwargs)))
mc-hub-api-1      |   File "/home/mcu/venv/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request
mc-hub-api-1      |     rv = self.dispatch_request()
mc-hub-api-1      |   File "/home/mcu/venv/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
mc-hub-api-1      |     return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
mc-hub-api-1      |   File "/home/mcu/mchub/resources/api_view.py", line 32, in decorator
mc-hub-api-1      |     response = route_handler(*args, **kwargs)
mc-hub-api-1      |   File "/home/mcu/mchub/resources/api_view.py", line 53, in decorator
mc-hub-api-1      |     return route_handler(*args, **kwargs)
mc-hub-api-1      |   File "/home/mcu/mchub/resources/api_view.py", line 96, in decorator
mc-hub-api-1      |     return route_handler(user, *args, **kwargs)
mc-hub-api-1      |   File "/home/mcu/venv/lib/python3.9/site-packages/flask/views.py", line 84, in view
mc-hub-api-1      |     return current_app.ensure_sync(self.dispatch_request)(*args, **kwargs)
mc-hub-api-1      |   File "/home/mcu/venv/lib/python3.9/site-packages/flask/views.py", line 158, in dispatch_request
mc-hub-api-1      |     return current_app.ensure_sync(meth)(*args, **kwargs)
mc-hub-api-1      |   File "/home/mcu/mchub/resources/magic_castle_api.py", line 24, in post
mc-hub-api-1      |     magic_castle.plan_creation(json_data)
mc-hub-api-1      |   File "/home/mcu/mchub/models/magic_castle/magic_castle.py", line 339, in plan_creation
mc-hub-api-1      |     database_connection.execute(
mc-hub-api-1      | sqlite3.IntegrityError: UNIQUE constraint failed: magic_castles.hostname

If an error occurs during the first planning phase of a cluster that does not exist, the user is taken back to the create-cluster page instead of the cluster modification page. Therefore, when the user fixes its issue, and try again to create the cluster, the record in the magic_castles database already exists.

@cmd-ntrf cmd-ntrf self-assigned this Mar 4, 2022
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

1 participant