Skip to content

[CI] TokenServiceTests testTokenExpiry fails #30062

@elasticmachine

Description

@elasticmachine

Original comment by @cbuescher:

LINK REDACTED

Can reproduce locally with:

./gradlew :x-pack-elasticsearch:plugin:security:test   -Dtests.seed=BCB6BA314115498   -Dtests.class=org.elasticsearch.xpack.security.authc.TokenServiceTests   -Dtests.method="testTokenExpiry"   -Dtests.security.manager=true   -Dtests.locale=en-MU   -Dtests.timezone=Australia/Yancowinna

Failure:

TokenServiceTests.testTokenExpiry <<< FAILURES!
   > Throwable LINK REDACTED: java.util.concurrent.ExecutionException: ElasticsearchSecurityException[token expired]
   >    at __randomizedtesting.SeedInfo.seed([BCB6BA314115498:147E3969C3114D3E]:0)
   >    at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.getValue(BaseFuture.java:265)
   >    at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(BaseFuture.java:252)
   >    at org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:94)
   >    at org.elasticsearch.xpack.security.authc.TokenServiceTests.testTokenExpiry(TokenServiceTests.java:484)
   >    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   >    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   >    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   >    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
   >    at java.base/java.lang.Thread.run(Thread.java:844)
   > Caused by: ElasticsearchSecurityException[token expired]
   >    at org.elasticsearch.xpack.security.authc.TokenService.expiredTokenException(TokenService.java:1122)
   >    at org.elasticsearch.xpack.security.authc.TokenService.lambda$decodeAndValidateToken$4(TokenService.java:341)
   >    at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:60)
   >    at org.elasticsearch.xpack.security.authc.TokenService.lambda$decodeToken$5(TokenService.java:403)
   >    at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:60)
   >    at org.elasticsearch.action.support.ContextPreservingActionListener.onResponse(ContextPreservingActionListener.java:43)
   >    at org.elasticsearch.xpack.security.authc.TokenServiceTests.lambda$mockGetTokenFromId$10(TokenServiceTests.java:654)
   >    at org.mockito.internal.stubbing.StubbedInvocationMatcher.answer(StubbedInvocationMatcher.java:34)
   >    at org.mockito.internal.handler.MockHandlerImpl.handle(MockHandlerImpl.java:91)
   >    at org.mockito.internal.handler.NullResultGuardian.handle(NullResultGuardian.java:29)
   >    at org.mockito.internal.handler.InvocationNotifierHandler.handle(InvocationNotifierHandler.java:38)
   >    at org.mockito.internal.creation.MethodInterceptorFilter.intercept(MethodInterceptorFilter.java:51)
   >    at org.elasticsearch.client.Client$$EnhancerByMockitoWithCGLIB$$5daba283.get(<generated>)
   >    at org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin(ClientHelper.java:73)
   >    at org.elasticsearch.xpack.security.authc.TokenService.lambda$decodeToken$7(TokenService.java:389)
   >    at org.elasticsearch.xpack.security.authc.TokenServiceTests.lambda$setupClient$3(TokenServiceTests.java:152)
   >    at org.mockito.internal.stubbing.StubbedInvocationMatcher.answer(StubbedInvocationMatcher.java:34)
   >    at org.mockito.internal.handler.MockHandlerImpl.handle(MockHandlerImpl.java:91)
   >    at org.mockito.internal.handler.NullResultGuardian.handle(NullResultGuardian.java:29)
   >    at org.mockito.internal.handler.InvocationNotifierHandler.handle(InvocationNotifierHandler.java:38)
   >    at org.mockito.internal.creation.MethodInterceptorFilter.intercept(MethodInterceptorFilter.java:51)
   >    at org.elasticsearch.xpack.security.SecurityLifecycleService$$EnhancerByMockitoWithCGLIB$$91dbf54b.prepareIndexIfNeededThenExecute(<generated>)
   >    at org.elasticsearch.xpack.security.authc.TokenService.lambda$decodeToken$8(TokenService.java:385)
   >    at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:60)
   >    at org.elasticsearch.xpack.security.authc.TokenService.decryptTokenId(TokenService.java:469)
   >    at org.elasticsearch.xpack.security.authc.TokenService.lambda$decodeToken$9(TokenService.java:384)
   >    at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:60)
   >    at org.elasticsearch.xpack.security.authc.TokenService.getKeyAsync(TokenService.java:446)
   >    at org.elasticsearch.xpack.security.authc.TokenService.decodeToken(TokenService.java:378)
   >    at org.elasticsearch.xpack.security.authc.TokenService.decodeAndValidateToken(TokenService.java:336)
   >    at org.elasticsearch.xpack.security.authc.TokenService.getAndValidateToken(TokenService.java:297)
   >    at org.elasticsearch.xpack.security.authc.TokenServiceTests.testTokenExpiry(TokenServiceTests.java:483)

Metadata

Metadata

Assignees

Labels

:Security/AuthenticationLogging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc)>test-failureTriaged test failures from CIv6.2.5v6.6.0

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions