Gozargah / Marzban

Unified GUI Censorship Resistant Solution Powered by Xray
https://t.me/gozargah_marzban
GNU Affero General Public License v3.0
3.81k stars 518 forks source link

مشکل در حذف کاربر #1312

Closed AMiR-SPB closed 2 months ago

AMiR-SPB commented 2 months ago

سلام . یک کاربر رو غیرفعال کردم ، بعد از اون تصمیم به حذفش گرفتم - متاسفانه دیگه حذف نمیشه حتی فعال کردم بازم حذف نشد

تمدید و تغییر تاریخ و حجم و نوت و و و و انجام میشه ولی حذف نمیشه لظفا راهنمایی کنید

ممنون

ورژن مرزبان 6 هست

اینم لاگ سرور موقعی که حذف میزنم

marzban-1 | INFO: ...:10904 - "GET /api/user/Mahboubeh_Parsafakhr/usage?start=2024-08-09T10:00:00 HTTP/1.1" 200 OK marzban-1 | INFO: .*.*.:10904 - "DELETE /api/user/Mahboubeh_Parsafakhr HTTP/1.1" 500 Internal Server Error marzban-1 | ERROR: Exception in ASGI application marzban-1 | Traceback (most recent call last): marzban-1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 419, in run_asgi marzban-1 | result = await app( # type: ignore[func-returns-value] marzban-1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call marzban-1 | return await self.app(scope, receive, send) marzban-1 | File "/usr/local/lib/python3.10/site-packages/fastapi/applications.py", line 271, in call marzban-1 | await super().call(scope, receive, send) marzban-1 | File "/usr/local/lib/python3.10/site-packages/starlette/applications.py", line 118, in call marzban-1 | await self.middleware_stack(scope, receive, send) marzban-1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in call marzban-1 | raise exc marzban-1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in call marzban-1 | await self.app(scope, receive, _send) marzban-1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/cors.py", line 92, in call marzban-1 | await self.simple_response(scope, receive, send, request_headers=headers) marzban-1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/cors.py", line 147, in simple_response marzban-1 | await self.app(scope, receive, send) marzban-1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in call marzban-1 | raise exc marzban-1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in call marzban-1 | await self.app(scope, receive, sender) marzban-1 | File "/usr/local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in call marzban-1 | raise e marzban-1 | File "/usr/local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in call marzban-1 | await self.app(scope, receive, send) marzban-1 | File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 706, in call marzban-1 | await route.handle(scope, receive, send) marzban-1 | File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle marzban-1 | await self.app(scope, receive, send) marzban-1 | File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 66, in app marzban-1 | response = await func(request) marzban-1 | File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app marzban-1 | raw_response = await run_endpoint_function( marzban-1 | File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 165, in run_endpoint_function marzban-1 | return await run_in_threadpool(dependant.call, values) marzban-1 | File "/usr/local/lib/python3.10/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool marzban-1 | return await anyio.to_thread.run_sync(func, args) marzban-1 | File "/usr/local/lib/python3.10/site-packages/anyio/to_thread.py", line 31, in run_sync marzban-1 | return await get_asynclib().run_sync_in_worker_thread( marzban-1 | File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread marzban-1 | return await future marzban-1 | File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 867, in run marzban-1 | result = context.run(func, args) marzban-1 | File "/code/app/views/user.py", line 144, in remove_user marzban-1 | crud.remove_user(db, dbuser) marzban-1 | File "/code/app/db/crud.py", line 252, in remove_user marzban-1 | db.commit() marzban-1 | File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 1451, in commit marzban-1 | self._transaction.commit(_to_root=self.future) marzban-1 | File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 829, in commit marzban-1 | self._prepare_impl() marzban-1 | File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 808, in _prepare_impl marzban-1 | self.session.flush() marzban-1 | File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 3444, in flush marzban-1 | self._flush(objects) marzban-1 | File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 3583, in _flush marzban-1 | with util.safereraise(): marzban-1 | File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 70, in exit marzban-1 | compat.raise( marzban-1 | File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 210, in raise_ marzban-1 | raise exception marzban-1 | File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 3544, in _flush marzban-1 | flush_context.execute() marzban-1 | File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/unitofwork.py", line 456, in execute marzban-1 | rec.execute(self) marzban-1 | File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/unitofwork.py", line 577, in execute marzban-1 | self.dependency_processor.process_deletes(uow, states) marzban-1 | File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/dependency.py", line 1110, in process_deletes marzban-1 | self._run_crud( marzban-1 | File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/dependency.py", line 1207, in _run_crud marzban-1 | raise exc.StaleDataError( marzban-1 | sqlalchemy.orm.exc.StaleDataError: DELETE statement on table 'exclude_inbounds_association' expected to delete 9 row(s) ; Only 10 were matched.

AMiR-SPB commented 2 months ago

image

احساس میکنم مشکل از بخش اینباد هاش باشه

چون هرکاری میکنم reality تیک باشه ادیت نمیشه همش خاموش میشه reality اش

دیتابیس هم sqlite هست من تغییری به mysql ندادم

AMiR-SPB commented 2 months ago

الان دیتابیس چک کردم متوجه شدم برای 8 تا یوزر این اتفاق افتاده

اینباد REALITY دوبار در بخش 'exclude_inbounds_association درج شده براشون

راهی هست حل بشه ؟

AMiR-SPB commented 2 months ago

دوستان با نرم افزار DB Browser for SQLite فایل دیتابیس رو باز کردم از تب Browse Data بخش exclude_inbounds_association اون اینباند هایی که میدونستم تکرار شدن دوبار رو حذف و بعد Write Changes رو زدم تا دیتابیس ذخیره بشه

مرزبان رو استاپ کردم و فایل دیتابیس جایگزین کردم و مجدد مزبان رو ران کردم

مشکل حل شد

M03ED commented 2 months ago

خوشحالم که خودتون تونستید مشکل تون رو حل کنید