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

Hog upload fix #897

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ async def catch_exceptions_middleware(request: Request, call_next):
async def home():
return RedirectResponse(url='/docs')

# It is unclear why currently this route is so often accessed. We block it for now
@app.get('/v1/hog/add')
async def hog_block():
pass

# A route to return all of the available entries in our catalog.
@app.get('/v1/notes/{run_id}')
Expand Down Expand Up @@ -674,8 +678,8 @@ async def hog_add(measurements: List[HogMeasurement]):
try:
_ = Measurement(**measurement_data)
except (ValidationError, RequestValidationError) as exc:
print('Caught Exception in Measurement()', exc.__class__.__name__, exc)
print('Hog parsing error. Missing expected, but non critical key', str(exc))
if len(exc.errors()) != 1 or exc.errors()[0]['loc'] != ('disk',):
error_helpers.log_error('Caught Exception in Measurement(), but not critical', exception_class=exc.__class__.__name__, exception=exc)
# Output is extremely verbose. Please only turn on if debugging manually
# print(f"Errors are: {exc.errors()}")

Expand Down
2 changes: 2 additions & 0 deletions docker/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ http {
sendfile on;
#tcp_nopush on;

client_max_body_size 3M;

keepalive_timeout 65;

gzip on;
Expand Down