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

Bug: internal error when deleting servers with forward rules #8

Open
LeiShi1313 opened this issue Dec 12, 2021 · 0 comments
Open

Bug: internal error when deleting servers with forward rules #8

LeiShi1313 opened this issue Dec 12, 2021 · 0 comments

Comments

@LeiShi1313
Copy link
Contributor

backend_1   | Sending clean.clean_runner task
backend_1   | INFO:     192.168.176.6:50466 - "DELETE /api/v1/servers/15 HTTP/1.0" 200 OK
backend_1   | INFO:     192.168.176.6:50474 - "GET /api/v2/servers?page=0&size=20 HTTP/1.0" 200 OK
backend_1   | INFO:     192.168.176.6:50498 - "GET /api/v2/servers/29/detailed HTTP/1.0" 200 OK
backend_1   | Sending clean.clean_runner task
backend_1   | INFO:     192.168.176.6:50520 - "DELETE /api/v1/servers/29 HTTP/1.0" 500 Internal Server Error
backend_1   | /usr/local/lib/python3.8/site-packages/sqlalchemy/orm/persistence.py:1359: SAWarning: DELETE statement on table 'server_user' expected to delete 3 row(s); 0 were matched.  Please set confirm_deleted_rows=False within the mapper configuration to prevent this warning.
backend_1   |   util.warn(
backend_1   | /usr/local/lib/python3.8/site-packages/sqlalchemy/orm/persistence.py:1359: SAWarning: DELETE statement on table 'port_user' expected to delete 3 row(s); 0 were matched.  Please set confirm_deleted_rows=False within the mapper configuration to prevent this warning.
backend_1   |   util.warn(
backend_1   | ERROR:    Exception in ASGI application
backend_1   | Traceback (most recent call last):
backend_1   |   File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 389, in run_asgi
backend_1   |     result = await app(self.scope, self.receive, self.send)
backend_1   |   File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
backend_1   |     return await self.app(scope, receive, send)
backend_1   |   File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 199, in __call__
backend_1   |     await super().__call__(scope, receive, send)
backend_1   |   File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 111, in __call__
backend_1   |     await self.middleware_stack(scope, receive, send)
backend_1   |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
backend_1   |     raise exc from None
backend_1   |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
backend_1   |     await self.app(scope, receive, _send)
backend_1   |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 25, in __call__
backend_1   |     response = await self.dispatch_func(request, self.call_next)
backend_1   |   File "/app/app/main.py", line 73, in db_session_middleware
backend_1   |     response = await call_next(request)
backend_1   |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 45, in call_next
backend_1   |     task.result()
backend_1   |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
backend_1   |     await self.app(scope, receive, send)
backend_1   |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 25, in __call__
backend_1   |     response = await self.dispatch_func(request, self.call_next)
backend_1   |   File "/app/app/main.py", line 65, in sentry_exception
backend_1   |     raise e
backend_1   |   File "/app/app/main.py", line 57, in sentry_exception
backend_1   |     response = await call_next(request)
backend_1   |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 45, in call_next
backend_1   |     task.result()
backend_1   |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
backend_1   |     await self.app(scope, receive, send)
backend_1   |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/cors.py", line 86, in __call__
backend_1   |     await self.simple_response(scope, receive, send, request_headers=headers)
backend_1   |   File "/usr/local/lib/python3.8/site-packages/starlette/middleware/cors.py", line 142, in simple_response
backend_1   |     await self.app(scope, receive, send)
backend_1   |   File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
backend_1   |     raise exc from None
backend_1   |   File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
backend_1   |     await self.app(scope, receive, sender)
backend_1   |   File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 566, in __call__
backend_1   |     await route.handle(scope, receive, send)
backend_1   |   File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
backend_1   |     await self.app(scope, receive, send)
backend_1   |   File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
backend_1   |     response = await func(request)
backend_1   |   File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 209, in app
backend_1   |     response_data = await serialize_response(
backend_1   |   File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 116, in serialize_response
backend_1   |     value, errors_ = field.validate(response_content, {}, loc=("response",))
backend_1   |   File "pydantic/fields.py", line 723, in pydantic.fields.ModelField.validate
backend_1   |     v, errors = self._validate_singleton(v, values, loc, cls)
backend_1   |   File "pydantic/fields.py", line 906, in pydantic.fields.ModelField._validate_singleton
backend_1   |     return self._apply_validators(v, values, loc, cls, self.validators)
backend_1   |   File "pydantic/fields.py", line 913, in pydantic.fields.ModelField._apply_validators
backend_1   |     v = validator(cls, v, values, self, self.model_config)
backend_1   |   File "pydantic/class_validators.py", line 310, in pydantic.class_validators._generic_validator_basic.lambda12
backend_1   |     return lambda cls, v, values, field, config: validator(v)
backend_1   |   File "pydantic/main.py", line 737, in pydantic.main.BaseModel.validate
backend_1   |     return cls.from_orm(value)
backend_1   |   File "pydantic/main.py", line 629, in pydantic.main.BaseModel.from_orm
backend_1   |     values, fields_set, validation_error = validate_model(cls, obj)
backend_1   |   File "pydantic/main.py", line 1040, in pydantic.main.validate_model
backend_1   |     v_, errors_ = field.validate(value, values, loc=field.alias, cls=cls_)
backend_1   |   File "pydantic/fields.py", line 734, in pydantic.fields.ModelField.validate
backend_1   |     v, errors = self._validate_sequence_like(v, values, loc, cls)
backend_1   |   File "pydantic/fields.py", line 767, in pydantic.fields.ModelField._validate_sequence_like
backend_1   |     r, ee = self._validate_singleton(v_, values, v_loc, cls)
backend_1   |   File "pydantic/fields.py", line 899, in pydantic.fields.ModelField._validate_singleton
backend_1   |     value, error = field.validate(v, values, loc=loc, cls=cls)
backend_1   |   File "pydantic/fields.py", line 723, in pydantic.fields.ModelField.validate
backend_1   |     v, errors = self._validate_singleton(v, values, loc, cls)
backend_1   |   File "pydantic/fields.py", line 906, in pydantic.fields.ModelField._validate_singleton
backend_1   |     return self._apply_validators(v, values, loc, cls, self.validators)
backend_1   |   File "pydantic/fields.py", line 913, in pydantic.fields.ModelField._apply_validators
backend_1   |     v = validator(cls, v, values, self, self.model_config)
backend_1   |   File "pydantic/class_validators.py", line 310, in pydantic.class_validators._generic_validator_basic.lambda12
backend_1   |     return lambda cls, v, values, field, config: validator(v)
backend_1   |   File "pydantic/main.py", line 737, in pydantic.main.BaseModel.validate
backend_1   |     return cls.from_orm(value)
backend_1   |   File "pydantic/main.py", line 629, in pydantic.main.BaseModel.from_orm
backend_1   |     values, fields_set, validation_error = validate_model(cls, obj)
backend_1   |   File "pydantic/main.py", line 1019, in pydantic.main.validate_model
backend_1   |     value = input_data.get(field.alias, _missing)
backend_1   |   File "pydantic/utils.py", line 418, in pydantic.utils.GetterDict.get
backend_1   |     return getattr(self._obj, key, default)
backend_1   |   File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/attributes.py", line 294, in __get__
backend_1   |     return self.impl.get(instance_state(instance), dict_)
backend_1   |   File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/attributes.py", line 730, in get
backend_1   |     value = self.callable_(state, passive)
backend_1   |   File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/strategies.py", line 717, in _load_for_state
backend_1   |     raise orm_exc.DetachedInstanceError(
backend_1   | sqlalchemy.orm.exc.DetachedInstanceError: Parent instance <ServerUser at 0x7f933e44a0a0> is not bound to a Session; lazy load operation of attribute 'user' cannot proceed (Background on this error at: http://sqlalche.me/e/13/bhk3)
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