Preflight checklist
Ory Network Project
No response
Describe the bug
I am maintaining the oathkeeper package in NixOS/nixpkgs. I noticed the test suite was not running as part of CI and decided to add it as part of the build process, but I notice these tests appear to be flaky across builds and platforms:
Runs:
x86_64-linux
[1] TestAuthenticatorOAuth2Introspection/method=authenticate-with-cache/case=with_none_scope_strategy/case=second_request_does_use_cache_because_no_scope_was_requested_and_strategy_is_nil
x86_64-darwin
[0,1] TestAuthenticatorOAuth2Introspection/method=authenticate-with-cache/case=with_a_scope_scope_strategy/case=request_succeeds_and_uses_the_cache
[1,2] TestClientCredentialsCache/method=tokenToCache/case=cache_value
[1,2] TestClientCredentialsCache/method=tokenToCache/case=cached_invalid_json_value_should_not_working
[2] TestAuthenticatorOAuth2Introspection/method=authenticate-with-cache/case=with_none_scope_strategy/case=second_request_does_use_cache_because_no_scope_was_requested_and_strategy_is_nil
aarch64-darwin
[0,1,2] TestAuthenticatorOAuth2Introspection/method=authenticate-with-cache/case=with_none_scope_strategy/case=second_request_does_use_cache_because_no_scope_was_requested_and_strategy_is_nil
[0,1] TestAuthenticatorOAuth2Introspection/method=authenticate-with-cache/case=with_a_scope_scope_strategy/case=request_succeeds_and_uses_the_cache
[0] TestClientCredentialsCache/method=tokenToCache/case=cache_value
[0,2] TestClientCredentialsCache/method=tokenToCache/case=cached_invalid_json_value_should_not_working
Reproducing the bug
nixpkgs-review pr 502030
Relevant log output
oathkeeper> ERROR: Access credentials are invalid
oathkeeper> Request: &{POST /oauth2/token HTTP/1.1 1 1 map[Accept-Encoding:[gzip] Authorization:[Basic Zm9vOmJhcg==] Content-Length:[29] Content-Type:[application/x-www-form-urlencoded] User-Agent:[Go-http-client/1.1]] 0x6e5877fce840 <nil> 29 [] false 127.0.0.1:49421 map[] map[] <nil> map[] 127.0.0.1:49422 /oauth2/token <nil> <nil> <nil> 0x6e5877ecd810 <nil> [] map[]}
oathkeeper> Response Code: 401
oathkeeper> Further Info: [An error occurred while handling a request]
oathkeeper> ERROR: The upstream service is not available
oathkeeper> Request: &{POST /oauth2/token HTTP/1.1 1 1 map[Accept-Encoding:[gzip] Authorization:[Basic Y2xpZW50OnNlY3JldA==] Content-Length:[29] Content-Type:[application/x-www-form-urlencoded] User-Agent:[Go-http-client/1.1]] 0x6e5878db1680 <nil> 29 [] false 127.0.0.1:49466 map[] map[] <nil> map[] 127.0.0.1:49467 /oauth2/token <nil> <nil> <nil> 0x6e5878fe4280 <nil> [] map[]}
oathkeeper> Response Code: 503
oathkeeper> Further Info: [An error occurred while handling a request]
oathkeeper> ERROR: The upstream service is timing out
oathkeeper> Request: &{POST /oauth2/token HTTP/1.1 1 1 map[Accept-Encoding:[gzip] Authorization:[Basic Y2xpZW50OnNlY3JldA==] Content-Length:[29] Content-Type:[application/x-www-form-urlencoded] User-Agent:[Go-http-client/1.1]] 0x6e5878279c40 <nil> 29 [] false 127.0.0.1:49468 map[] map[] <nil> map[] 127.0.0.1:49469 /oauth2/token <nil> <nil> <nil> 0x6e587817fbd0 <nil> [] map[]}
oathkeeper> Response Code: 504
oathkeeper> Further Info: [An error occurred while handling a request]
oathkeeper> ERROR: The upstream service encountered an unexpected error
oathkeeper> Request: &{POST /oauth2/token HTTP/1.1 1 1 map[Accept-Encoding:[gzip] Authorization:[Basic Y2xpZW50OnNlY3JldA==] Content-Length:[29] Content-Type:[application/x-www-form-urlencoded] User-Agent:[Go-http-client/1.1]] 0x6e58791a2040 <nil> 29 [] false 127.0.0.1:49470 map[] map[] <nil> map[] 127.0.0.1:49471 /oauth2/token <nil> <nil> <nil> 0x6e5878fe4820 <nil> [] map[]}
oathkeeper> Response Code: 500
oathkeeper> Further Info: [An error occurred while handling a request]
oathkeeper> ERROR: Access credentials are not sufficient to access this resource
oathkeeper> Request: &{POST /oauth2/token HTTP/1.1 1 1 map[Accept-Encoding:[gzip] Authorization:[Basic Y2xpZW50OnNlY3JldA==] Content-Length:[29] Content-Type:[application/x-www-form-urlencoded] User-Agent:[Go-http-client/1.1]] 0x6e58790c0980 <nil> 29 [] false 127.0.0.1:49474 map[] map[] <nil> map[] 127.0.0.1:49475 /oauth2/token <nil> <nil> <nil> 0x6e587922a410 <nil> [] map[]}
oathkeeper> Response Code: 403
oathkeeper> Further Info: [An error occurred while handling a request]
Relevant configuration
Version
v26.2.0
On which operating system are you observing this issue?
Other
In which environment are you deploying?
Binary
Additional Context
NixOS/nixpkgs#502030
Preflight checklist
Ory Network Project
No response
Describe the bug
I am maintaining the
oathkeeperpackage in NixOS/nixpkgs. I noticed the test suite was not running as part of CI and decided to add it as part of the build process, but I notice these tests appear to be flaky across builds and platforms:Runs:
x86_64-linuxx86_64-darwinaarch64-darwinReproducing the bug
nixpkgs-review pr 502030Relevant log output
Relevant configuration
Version
v26.2.0
On which operating system are you observing this issue?
Other
In which environment are you deploying?
Binary
Additional Context
NixOS/nixpkgs#502030