-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
401 error when network hiccups #23
Comments
that looks like a memory corruption indeed, can you confirm you're using the latest version of module+library and are you able to produce a coredump+stacktrace? |
I admit that the version is a few months old. Probably Jan/Feb vintage. Do you know offhand how to produce those coredump/stacktarce? I can try to figure it out. I'm running this in a docker image. |
ok, just send me the Dockerfile and I'll figure it out |
I'm going to try to update the versions of your libraries and Apache. but here is the dockerfile I'm running with.
|
172.27.0.1 - - [23/Aug/2021:18:16:15 +0000] "POST /someLocation/resources/x.y/doIt HTTP/1.1" 401 381 I think I upgraded to the lastest version of your libraries. And still got the error. I seem to get it in conjunctions with my Android device having a network blip. FROM httpd:2.4 RUN mkdir -p /tmp COPY libhiredis0.13_0.13.3-2.2_amd64.deb /tmp/libhiredis0.13_0.13.3-2.2_amd64.deb RUN apt-get update && run dpkg -i /tmp/libhiredis0.13_0.13.3-2.2_amd64.deb RUN echo "LoadModule proxy_module modules/mod_proxy.so" >> /usr/local/apache2/conf/httpd.conf RUN mkdir /usr/local/apache2/conf-available |
I'm not able to reproduce: can you set the log level to debug and send me the error_log? |
What is the best way to send you the error log? with a link? Can I email it to you anywhere? |
you can send it to support@zmartzone.eu |
Just checking in. Did you receive my email and logs? |
I did but unfortunately it did not help me to reproduce so I have nothing to work from :-( |
Any chance there are newer versions of these libraries and I'm just out of date? COPY libhiredis0.13_0.13.3-2.2_amd64.deb /tmp/libhiredis0.13_0.13.3-2.2_amd64.deb |
I tried to reproduce with your Dockerfile+versions, but no luck |
Also to be sure. I feel that the issue is with our Android application (using OkHttp), and if the network blips on the Android device, that's when I get the 401. It also seems like for some reason that there is some sort of timing. I'm going to write some other tests to see if I can repeat this easier. |
I've spent some more time trying to re-produce or find out what is going on. Based on your chance to look at the logs, do you have any clues on what is going on? Is it bad or partial data coming in? Is there something in the module that might be a problem? I'm kinda at a loss of where to dig. |
I'm lost too; I would assume that partial data would lead to other, Apache-level errors |
a double free error was solved in liboauth 1.4.4.1 https://github.com/zmartzone/liboauth2/releases/tag/v1.4.4.1; could this fix your issue as well? @GRRedWings please confirm |
I just updated everything and tested (1.4.4.2). This did not fix my problem. I still have not been able to track it down. But I know if I try to make calls from my laptop I don't get the issue. But if I make them from an Android device using appauth for Android I do still get the issues in certain scenarios. |
I'm trying to gather come more information. But here is what I have so far. If I increase logging to trace8, it seems like the problem doesn't happen. At trace6 I got these logs around the failure. [Mon Jul 25 11:21:19.319811 2022] [oauth2:debug] [pid 93:tid 140228215936768] src/jose.c(934): [client 172.26.0.1:41202] _oauth2_jose_jwt_verify_jwk: leave: rc=0 |
it seems that the crash happens only after the token fails to verify and an attempt is made to return a legitimate 401 error; the logs just before would show why the token fails to validate and may provide more insight into what is going on |
Thank you for looking at this. I have sent you an email with the full log. |
In looking at the logs prior, it almost looks like maybe it's an issue with the timeout. If I change my expiry from 5 to 60, in my short test window it has not happened. (expires=1658748075, now=1658748070) It almost seems like my expiry is not long enough. I've set it to 5, and maybe when I have a network blip it's not enough time? |
with multi-treading fix for "OAuth2Verify jwk <key>" see #23 Signed-off-by: Hans Zandbelt <hans.zandbelt@zmartzone.eu>
this should be fixed now in release 1.4.5 of liboauth2: OAuth2TokenVerify jwk <key> and was caused by using non-thread-safe functions |
I've done a bit of testing and I have not had the issue come up again. I think it's safe to say that you found my issue! I appreciate you spending the time to dig into this. |
I'm trying to track down why occasionally I get a 401 error .
Here is the configuration in Apache, it has a
<Location /someLocation>
Require valid-user
AuthType oauth2
OAuth2TokenVerify jwk "..." verify.iat=skip&expiry=5
This is the apache error I get
172.24.0.1 - FLCm7KqMmt-CnMOKmf1EpJYd5wbPUdJ8ILQPO_TT09Q [23/Aug/2021:16:20:40 +0000] "POST /someLocation/resources/vx.y/doIt HTTP/1.1" 200 186
double free or corruption (fasttop)
172.24.0.1 - - [23/Aug/2021:16:20:43 +0000] "POST /someLocation/resources/vx.y/doIt HTTP/1.1" 401 381
[Mon Aug 23 16:20:43.903993 2021] [core:notice] [pid 1:tid 139697330451584] AH00052: child pid 93 exit signal Aborted (6)
Am I reading this right that some sort of partial request is being processed and causing a memory error?
The text was updated successfully, but these errors were encountered: