Hey all! Do y'all have any advice for how to chec...
# talk-oathkeeper
m
Hey all! Do y'all have any advice for how to check auth against a request which has a large file in the body? For more detail, we have a POST endpoint where we upload large files (videos, audio, etc) and its auth uses Oathkeeper; however if we get large files (>600MB or so) nginx throws a 502 with no real information. The closest thing to actual feedback we get is an error like this out of oathkeeper:
Copy code
time=2022-07-12T20:26:45Z level=warning msg=Access request denied because roundtrip failed audience=application error=map[message:context canceled] granted=false http_host=api:3000 http_method=POST http_url=<http://api:3000/api/v1/media> http_user_agent=PostmanRuntime/7.28.1 service_name=ORY Oathkeeper service_version=v0.39.0 subject=624f943dabbacaa96c3dea9a
time=2022-07-12T20:26:45Z level=error msg=http: proxy error: context canceled audience=application error=map[message:context canceled] service_name=ORY Oathkeeper service_version=v0.39.0
It seems like it times out on the request, and I can confirm two things: • "small" files are fine (~550MB or less) and work as expected • It doesn't appear to be nginx - I've double and triple checked its annotations, it has long timeouts and big limits for file sizes it'll accept I've been hitting my head against this one for a few weeks and really can't get a pulse on it, any help would be appreciated!!!
p
@mammoth-computer-48312 hmm yeah i think there is a default timeout setting in Oathkeeper which cancels the request. You might be able to set this somewhere (maybe through environment variables). Do you maybe know how long it takes for the request to timeout?
m
Hi! It seems relatively random - I've seen timeouts occur anywhere from ~25s to ~50s. And hm, I didn't see that EnvVar when looking through docs; but it's very possible I'd just missed it
p
Hmm 🤔 We have these configuration keys https://github.com/ory/oathkeeper/blob/master/driver/configuration/provider_viper.go#L41-L56 Not sure if it would have an impact on your problem, but it might be worth a shot?
m
This totally worked! Thank you, we had totally missed this configuration in the docs ❤️ Is there anywhere recommended I should post this "fix" in case others run into the same problem?
p
Hi @mammoth-computer-48312 Glad it got resolved 🙂 It would be awesome if you could post a discussion about it ❤️ https://github.com/ory/oathkeeper/discussions