-
Notifications
You must be signed in to change notification settings - Fork 40
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]: Organization bootstrap fails #8427
Comments
Look if it's possible to inspect the header value |
The status 415 correspond to parsec-cloud/server/parsec/asgi/rpc.py Line 255 in 1cc43a9
|
It's returned by That function is call during:
|
I've take a look about how to customize the access log provided by The issue encode/uvicorn#491 was a great help. I was able to customize diff --git a/server/parsec/asgi/__init__.py b/server/parsec/asgi/__init__.py
index 68ba698d3..66f6a2d42 100644
--- a/server/parsec/asgi/__init__.py
+++ b/server/parsec/asgi/__init__.py
@@ -1,6 +1,7 @@
# Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS
from __future__ import annotations
+import copy
from pathlib import Path
import uvicorn
@@ -8,6 +9,7 @@ from fastapi import FastAPI, Request
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from starlette.types import Receive, Scope, Send
+import uvicorn.config
from parsec._version import __version__ as parsec_version
from parsec.asgi.administration import administration_router
@@ -93,6 +95,12 @@ async def serve_parsec_asgi_app(
v_major, _ = parsec_version.split(".", 1)
# ex: parsec/3
server_header = f"parsec/{v_major}"
+ log_config = copy.deepcopy(uvicorn.config.LOGGING_CONFIG)
+ # Eg: "INFO 127.0.0.1 - "GET /anonymous/foobar HTTP/1.1" 200"
+ log_config["formatters"]["access"]["fmt"] = (
+ 'foobar %(levelprefix)s %(client_addr)s - "%(request_line)s" %(status_code)s'
+ )
+
# Note: Uvicorn comes with default values for incoming data size to
# avoid DoS abuse, so just trust them on that ;-)
config = uvicorn.Config(
@@ -107,6 +115,7 @@ async def serve_parsec_asgi_app(
ssl_certfile=ssl_certfile,
workers=workers,
# TODO: configure access log format:
+ log_config=log_config,
# Timestamp is added by the log processor configured in `parsec.logging`,
# here we configure peer address + req line + rep status + rep body size + time
# (e.g. "GET 88.0.12.52:54160 /foo 1.1 404 823o 12343ms") Sadly, The log formatter don't have access to the request scope ( |
According to @Landeers this is no longer a blocking issue because a workaround was found for the reverse proxy redirects |
Add a new option that configure the list of trusted address to parse the proxy headers from. The parsing is handled by `uvicorn` which currently only support `x-forwarded-{for,proto}` headers. Closes #8626, closes #8427 Co-authored-by: Marcos Medrano <[email protected]>
Add a new option that configure the list of trusted address to parse the proxy headers from. The parsing is handled by `uvicorn` which currently only support `x-forwarded-{for,proto}` headers. Closes #8626, closes #8427 Co-authored-by: Marcos Medrano <[email protected]>
Parsec version tested on:
v3.0.0-rc.8
Platforms tested on:
Windows
Bug description:
On custom server while bootstrap (join organization with bootstrap link), client received an
BootstrapOrganizationErrorInternal
errorRelevant output:
Server capture on debug level
The text was updated successfully, but these errors were encountered: