我使用的是JFrog Artifactory OSS 7.46.8 (Self - hosted - docker版本)
使用"Set Me Up"选项或编辑任何用户从Admin视图,基本上任何操作调用"/ui/api/v1/ui/userApiKey/"端点401失败
我打开了调试日志,下面是我能找到的与此相关的日志。
用户登录时产生错误:
User-Changed authentication cache accessed
2022-12-14T08:18:28.679Z [jfrt ] [DEBUG] [ ] [o.a.o.ArtifactoryTracer:78 ] [http-nio-8081-exec-5] - Found existing Tracing Span. A new child Server Tracing Span will be associated with it
2022-12-14T08:18:28.680Z [jfrt ] [DEBUG] [2f4d3b87c15ab8be] [.AuthenticationFilterUtils:146] [http-nio-8081-exec-5] - Entering ArtifactorySsoAuthenticationFilter.getRemoteUserName
2022-12-14T08:18:28.680Z [jfrt ] [DEBUG] [2f4d3b87c15ab8be] [o.a.w.s.AccessFilter:434 ] [http-nio-8081-exec-5] - Cached key has been found for request: '/artifactory/api/onboarding/initStatus' with method: 'GET'
2022-12-14T08:18:28.680Z [jfrt ] [DEBUG] [2f4d3b87c15ab8be] [o.a.w.s.AccessFilter:232 ] [http-nio-8081-exec-5] - Non-UI authentication cache accessed
2022-12-14T08:18:28.680Z [jfrt ] [DEBUG] [2f4d3b87c15ab8be] [o.a.w.s.AccessFilter:227 ] [http-nio-8081-exec-5] - UI authentication cache accessed
2022-12-14T08:18:28.680Z [jfrt ] [DEBUG] [2f4d3b87c15ab8be] [o.a.w.s.AccessFilter:237 ] [http-nio-8081-exec-5] - User-Changed authentication cache accessed
2022-12-14T08:18:28.680Z [jfrt ] [DEBUG] [2f4d3b87c15ab8be] [o.a.w.s.AccessFilter:440 ] [http-nio-8081-exec-5] - Header authentication AccessTokenAuthentication [Principal=admin, Credentials=[PROTECTED], Authenticated=true, Details=null, Granted Authorities=[]] found in cache.
2022-12-14T08:18:28.681Z [jfrt ] [DEBUG] [2f4d3b87c15ab8be] [o.a.w.s.RepoFilter:113 ] [http-nio-8081-exec-5] - Entering request GET ("IP-REMOVED") /api/onboarding/initStatus.
2022-12-14T08:18:28.681Z [jfrt ] [DEBUG] [2f4d3b87c15ab8be] [o.j.a.c.h.AccessHttpClient:128] [http-nio-8081-exec-5] - Executing : POST http://localhost:8046/access/api/v1/auth/authenticate
2022-12-14T08:18:28.692Z [jfrt ] [DEBUG] [2f4d3b87c15ab8be] [rtifactoryInitStatusService:91] [http-nio-8081-exec-5] - Unable to authenticate user: 'admin'
org.jfrog.access.client.AccessClientHttpException: HTTP response status 401:Failed on executing request. Response: {
"errors" : [ {
"code" : "UNAUTHORIZED",
"message" : "Invalid credentials"
} ]
}
at org.jfrog.access.client.http.AccessHttpClient.createRestResponse(AccessHttpClient.java:184)
at org.jfrog.access.client.http.AccessHttpClient.restCall(AccessHttpClient.java:131)
at org.jfrog.access.client.auth.AuthClientImpl.authenticate(AuthClientImpl.java:93)
at org.artifactory.ui.rest.service.onboarding.GetArtifactoryInitStatusService.execute(GetArtifactoryInitStatusService.java:86)
at org.artifactory.rest.common.service.ServiceExecutor.process(ServiceExecutor.java:39)
at org.artifactory.rest.common.resource.BaseResource.runService(BaseResource.java:141)
at org.artifactory.ui.rest.resource.onboarding.ArtifactoryOnboardingResource.getInitStatus(ArtifactoryOnboardingResource.java:62)
at jdk.internal.reflect.GeneratedMethodAccessor957.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:475)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:397)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
调用userApiKey时产生的错误。
User-Changed authentication cache accessed
2022-12-14T08:22:13.600Z [jfrt ] [DEBUG] [61b44ab36079c799] [o.a.w.s.AccessFilter:237 ] [http-nio-8081-exec-3] - User-Changed authentication cache accessed
2022-12-14T08:22:13.601Z [jfrt ] [DEBUG] [3e9a4f8ab10ac74 ] [o.j.a.c.h.AccessHttpClient:128] [http-nio-8081-exec-2] - Executing : POST http://localhost:8046/access/api/v1/auth/authenticate
2022-12-14T08:22:13.602Z [jfrt ] [DEBUG] [333a63a9b7c7563c] [nRepositoryResponseWrapper:230] [http-nio-8081-exec-8] - Skip invoking on
2022-12-14T08:22:13.602Z [jfrt ] [DEBUG] [333a63a9b7c7563c] [o.a.w.s.RepoFilter:208 ] [http-nio-8081-exec-8] - Exiting request GET (127.0.0.1) /api/securityconfig
2022-12-14T08:22:13.602Z [jfrt ] [DEBUG] [333a63a9b7c7563c] [o.a.w.s.AccessFilter:237 ] [http-nio-8081-exec-8] - User-Changed authentication cache accessed
2022-12-14T08:22:13.602Z [jfrt ] [DEBUG] [333a63a9b7c7563c] [o.a.w.s.AccessFilter:237 ] [http-nio-8081-exec-8] - User-Changed authentication cache accessed
2022-12-14T08:22:13.604Z [jfrt ] [DEBUG] [3e9a4f8ab10ac74 ] [PassAuthenticationProvider:126] [http-nio-8081-exec-2] - 401, Access didn't authenticate user: 'admin'
2022-12-14T08:22:13.605Z [jfrt ] [DEBUG] [3e9a4f8ab10ac74 ] [priseAuthenticationProvider:87] [http-nio-8081-exec-2] - Non docker request. Github provider supports only docker requests.
2022-12-14T08:22:13.605Z [jfrt ] [DEBUG] [3e9a4f8ab10ac74 ] [o.j.a.c.h.AccessHttpClient:128] [http-nio-8081-exec-2] - Executing : GET http://localhost:8046/access/api/v1/users/admin?expand=groups
2022-12-14T08:22:13.608Z [jfrt ] [DEBUG] [3e9a4f8ab10ac74 ] [nRepositoryResponseWrapper:230] [http-nio-8081-exec-2] - Skip invoking on
2022-12-14T08:22:13.608Z [jfrt ] [DEBUG] [3e9a4f8ab10ac74 ] [o.a.w.s.RepoFilter:208 ] [http-nio-8081-exec-2] - Exiting request GET ("IP-REMOVED") /api/userApiKey/admin
2022-12-14T08:22:13.608Z [jfrt ] [DEBUG] [3e9a4f8ab10ac74 ] [o.a.w.s.AccessFilter:237 ] [http-nio-8081-exec-2] - User-Changed authentication cache accessed
2022-12-14T08:22:13.608Z [jfrt ] [DEBUG] [3e9a4f8ab10ac74 ] [o.a.w.s.AccessFilter:237 ] [http-nio-8081-exec-2] - User-Changed authentication cache accessed
2022-12-14T08:22:13.610Z [jffe ] [ERROR] [03e9a4f8ab10ac74] [frontend-service.log] [main ] - Error: Request failed with status code 401
at createError (/opt/jfrog/artifactory/app/frontend/bin/server/dist/node_modules/axios/lib/core/createError.js:16:15)
at settle (/opt/jfrog/artifactory/app/frontend/bin/server/dist/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/opt/jfrog/artifactory/app/frontend/bin/server/dist/node_modules/axios/lib/adapters/http.js:322:11)
at IncomingMessage.emit (node:events:539:35)
at endReadableNT (node:internal/streams/readable:1345:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
这个的解是什么?
这可能是您的负载均衡器/反向代理的问题。检查它是否允许"OPTIONS"方法。至少我也遇到过类似的情况。