Skip to content
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

[BE] token incorrect or expired > 400대 에러로 로깅 하도록 수정 #958

Open
sakjung opened this issue Mar 27, 2023 — with Slack · 2 comments
Open

[BE] token incorrect or expired > 400대 에러로 로깅 하도록 수정 #958

sakjung opened this issue Mar 27, 2023 — with Slack · 2 comments
Labels

Comments

Copy link
Collaborator

sakjung commented Mar 27, 2023

[PROD] [ERROR] [http-nio-8080-exec-42] [a5a5bae69f61] [RequestLoggingFilter:?] - [205ms] [500][HTTP METHOD: GET] [PATH INFO: /api/members/github/login/token] [REQUEST HEADER: x-forwarded-for:118.235.15.54, host:127.0.0.1:8080, connection:close, sec-ch-ua:"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111", accept:application/json, text/plain, /, sec-ch-ua-mobile:?1, user-agent:Mozilla/5.0 (Linux; Android 13; SM-G986N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36, sec-ch-ua-platform:"Android", origin:https://zzimkkong.com, sec-fetch-site:same-site, sec-fetch-mode:cors, sec-fetch-dest:empty, referer:https://zzimkkong.com/, accept-encoding:gzip, deflate, br, accept-language:ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7] [REQUEST PARAMETERS: {code=91b52e93ae061887e486}] [REMOTE ADDRESS: 118.235.15.54] [RESPONSE: {"message":"소셜 로그인에 실패했습니다. 다시 시도해주세요."}]

Slack Message

@sakjung sakjung added the 🕋 backend label Mar 27, 2023 — with Slack
@sakjung
Copy link
Collaborator Author

sakjung commented Mar 27, 2023

LOG

2023-03-24 18:28:47.964 |  INFO | http-nio-8080-exec-42 |  a5a5bae69f61 | [WebClientConfig:26] - REQUEST: POST https://github.com/login/oauth/access_token?code=91b52e93ae061887e486&client_id=378d2c8cdd571f1f8aca&client_secret=63b4773b9a85a9ac66e328e9e28e1f453944140e 
2023-03-24 18:28:48.162 |  INFO | reactor-http-epoll-3 |   | [WebClientConfig:35] - RESPONSE: 200 
2023-03-24 18:28:48.166 |  WARN | http-nio-8080-exec-42 |  a5a5bae69f61 | [ControllerAdvice:109] - 소셜 로그인에 실패했습니다. 다시 시도해주세요. (traceId: a5a5bae69f61) 
com.woowacourse.zzimkkong.exception.infrastructure.oauth.ErrorResponseToGetAccessTokenException: 소셜 로그인에 실패했습니다. 다시 시도해주세요.
	at com.woowacourse.zzimkkong.infrastructure.oauth.GithubRequester.validateResponseBody(GithubRequester.java:68)
	at com.woowacourse.zzimkkong.infrastructure.oauth.GithubRequester.getToken(GithubRequester.java:62)
	at com.woowacourse.zzimkkong.infrastructure.oauth.GithubRequester.getUserInfoByCode(GithubRequester.java:44)
	at com.woowacourse.zzimkkong.infrastructure.oauth.GithubRequester$$FastClassBySpringCGLIB$$d9ba1ba0.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
	at com.woowacourse.zzimkkong.config.logaspect.ExecutionTimeLogAdvice.invoke(ExecutionTimeLogAdvice.java:22)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:692)
	at com.woowacourse.zzimkkong.infrastructure.oauth.GithubRequester$$EnhancerBySpringCGLIB$$f9b01632.getUserInfoByCode(<generated>)
	at com.woowacourse.zzimkkong.infrastructure.oauth.OauthHandler.getUserInfoFromCode(OauthHandler.java:22)
	at com.woowacourse.zzimkkong.infrastructure.oauth.OauthHandler$$FastClassBySpringCGLIB$$c42cd54c.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
	at com.woowacourse.zzimkkong.config.logaspect.ExecutionTimeLogAdvice.invoke(ExecutionTimeLogAdvice.java:22)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:692)
	at com.woowacourse.zzimkkong.infrastructure.oauth.OauthHandler$$EnhancerBySpringCGLIB$$acc6407c.getUserInfoFromCode(<generated>)
	at com.woowacourse.zzimkkong.service.AuthService.loginByOauth(AuthService.java:53)
	at com.woowacourse.zzimkkong.service.AuthService$$FastClassBySpringCGLIB$$82fb9aab.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:692)
	at com.woowacourse.zzimkkong.service.AuthService$$EnhancerBySpringCGLIB$$1d23a239.loginByOauth(<generated>)
	at com.woowacourse.zzimkkong.controller.AuthController.loginByOauth(AuthController.java:37)
	at com.woowacourse.zzimkkong.controller.AuthController$$FastClassBySpringCGLIB$$796fb6d.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
	at com.woowacourse.zzimkkong.config.logaspect.ExecutionTimeLogAdvice.invoke(ExecutionTimeLogAdvice.java:22)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:692)
	at com.woowacourse.zzimkkong.controller.AuthController$$EnhancerBySpringCGLIB$$86990f7f.loginByOauth(<generated>)
	at jdk.internal.reflect.GeneratedMethodAccessor247.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:141)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:894)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1063)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:655)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:228)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163)
	at com.woowacourse.zzimkkong.config.logaspect.RequestLoggingFilter.doFilterInternal(RequestLoggingFilter.java:53)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:121)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:105)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103)
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)
	at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:110)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163)
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1723)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.Throwable: The code passed is incorrect or expired.
	at com.woowacourse.zzimkkong.exception.infrastructure.oauth.ErrorResponseToGetAccessTokenException.<init>(ErrorResponseToGetAccessTokenException.java:10)
	... 133 common frames omitted
2023-03-24 18:28:48.167 | ERROR | http-nio-8080-exec-42 |  a5a5bae69f61 | [RequestLoggingFilter:?] - [205ms] [500][HTTP METHOD: GET] [PATH INFO: /api/members/github/login/token] [REQUEST HEADER: x-forwarded-for:118.235.15.54, host:127.0.0.1:8080, connection:close, sec-ch-ua:"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111", accept:application/json, text/plain, */*, sec-ch-ua-mobile:?1, user-agent:Mozilla/5.0 (Linux; Android 13; SM-G986N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36, sec-ch-ua-platform:"Android", origin:https://zzimkkong.com, sec-fetch-site:same-site, sec-fetch-mode:cors, sec-fetch-dest:empty, referer:https://zzimkkong.com/, accept-encoding:gzip, deflate, br, accept-language:ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7] [REQUEST PARAMETERS: {code=91b52e93ae061887e486}] [REMOTE ADDRESS: 118.235.15.54] [RESPONSE: {"message":"소셜 로그인에 실패했습니다. 다시 시도해주세요."}] 

@sakjung sakjung added the 🎁 optional 주요 기능X label Mar 28, 2023
@xrabcde xrabcde changed the title token incorrect or expired > 400대 에러로 로깅 하도록 수정 [BE] token incorrect or expired > 400대 에러로 로깅 하도록 수정 May 15, 2023
@sakjung
Copy link
Collaborator Author

sakjung commented Mar 21, 2024

#959 와 동일한 유형의 이슈로 추정됨

Service Provider (Github, Google) 측에서 우리가 보내는 code (= 클라측에서 request param 으로 보내주는 code) 를 모종의 이유로 invalid �하다고 인식하는 것으로 보임.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant