oXIIIo/marzban-template

clash meta conflict with latest dev updates

jsonjson666 opened this issue · 1 comments

these errors got from recent marzban dev update and using this clash template:

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 84, in call
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/subscription.py", line 82, in user_subscription
marzban-1 | conf = generate_subscription(user=user, config_format="clash-meta", as_base64=False, reverse=False)
marzban-1 | File "/code/app/subscription/share.py", line 112, in generate_subscription
marzban-1 | config = generate_clash_subscription(**kwargs, is_meta=True)
marzban-1 | File "/code/app/subscription/share.py", line 58, in generate_clash_subscription
marzban-1 | return process_inbounds_and_tags(
marzban-1 | File "/code/app/subscription/share.py", line 305, in process_inbounds_and_tags
marzban-1 | conf.add(
marzban-1 | File "/code/app/subscription/clash.py", line 343, in add
marzban-1 | node = self.make_node(
marzban-1 | File "/code/app/subscription/clash.py", line 314, in make_node
marzban-1 | node = super().make_node(
marzban-1 | File "/code/app/subscription/clash.py", line 214, in make_node
marzban-1 | net_opts = self.http_config(
marzban-1 | File "/code/app/subscription/clash.py", line 90, in http_config
marzban-1 | config["header"]["User-Agent"] = choice(self.user_agent_list)
marzban-1 | KeyError: 'header'

Does disabling the random user agent solve your problem?