[FOLIO-3159] Add edge-caiasoft module to testing env/testing and snapshot VMs Created: 12/May/21 Updated: 03/Mar/23 Resolved: 28/May/21 |
|
| Status: | Closed |
| Project: | FOLIO |
| Components: | None |
| Affects versions: | None |
| Fix versions: | None |
| Type: | Story | Priority: | P2 |
| Reporter: | Viachaslau Khandramai (Inactive) | Assignee: | Wayne Schneider |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||
| Issue links: |
|
||||||||||||||||
| Sprint: | DevOps Sprint 114, DevOps Sprint 115 | ||||||||||||||||
| Development Team: | FOLIO DevOps | ||||||||||||||||
| Description |
|
A new back-end edge module edge-caiasoft should be added to the folio-testing reference environment as well as for the Vagrant VM boxes for folio-testing and folio-snapshot for testing and demo purposes. This module depends on interfaces from mod-remote-storage. Note This module should be deployed in the same way https://folio-org.atlassian.net/browse/FOLIO-3014. |
| Comments |
| Comment by Victoria_Smelova [ 13/May/21 ] |
|
Jakub Skoczen FYI - this module is a new module required for R2, so it would be great if DevOps team can prioritize this task. |
| Comment by Viachaslau Khandramai (Inactive) [ 18/May/21 ] |
|
Hi Jakub Skoczen, may I ask you to prioritize this task - this is blocker for Remote Storage integration.
Thank you! |
| Comment by Victoria_Smelova [ 19/May/21 ] |
|
David Crossley could you help with this task? I guess Jakub is on vacation.... |
| Comment by Wayne Schneider [ 24/May/21 ] |
|
Viachaslau Khandramai do I understand correctly that the institutional user for edge-caiasoft MUST have the username "caiaSoftClient"? If so, why is that required? |
| Comment by Wayne Schneider [ 24/May/21 ] |
|
Viachaslau Khandramai it does look like the user must have the username caiaSoftClient, still rather curious why that should be. How can I validate that the API is working? It looks like an API GET request has the form:
/caiasoftService/ItemBarcodes/{itemBarcode}/accessioned/{remoteStorageConfigurationId}
What is a remoteStorageConfigurationId? Is that something that also needs to be configured? |
| Comment by Viachaslau Khandramai (Inactive) [ 25/May/21 ] |
|
Hi Wayne Schneider, remoteStorageConfigurationId - path parameter for remote storage client (the same like for edge-dematic). We don't need to configure it now. You can use any arbitrary uuid for verification. What we only need - to have confirmation that this endpoint is available whatever what result will be returned. caiaSoftClient is only system user. We use system user to interact with mod-remote-storage from edge-caiasoft. |
| Comment by Wayne Schneider [ 25/May/21 ] |
|
Viachaslau Khandramai thanks. The edge module is installed for testing at https://folio-snapshot-load.dev.folio.org:8000. The GET request:
https://folio-snapshot-load.dev.folio.org:8000/caiasoftService/ItemBarcodes/10101/accessioned/8725e552-2dce-4cd4-b46a-44c6e1a84562
returns a 500 error:
{
"timestamp": "2021-05-25T12:05:17.641+00:00",
"status": 500,
"error": "Internal Server Error",
"message": "",
"path": "/caiasoftService/ItemBarcodes/10101/accessioned/8725e552-2dce-4cd4-b46a-44c6e1a84562"
}
The log shows: 12:05:17 ERROR DirectJDKLog Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is feign.FeignException$BadRequest: [400 Bad Request] during [POST] to [http://10.36.1.198:9130/remote-storage/accessions] [RemoteStorageClient#getAccessionItem(AccessionRequest,String,String)]: [{"errors":[{"message":"No location was found for remote storage id=8725e552-2dce-4cd4-b46a-44c6e1a84562","type":"-1","code":"Accession error"}],"total_records":1}]] with root cause feign.FeignException$BadRequest: [400 Bad Request] during [POST] to [http://10.36.1.198:9130/remote-storage/accessions] [RemoteStorageClient#getAccessionItem(AccessionRequest,String,String)]: [{"errors":[{"message":"No location was found for remote storage id=8725e552-2dce-4cd4-b46a-44c6e1a84562","type":"-1","code":"Accession error"}],"total_records":1}] at feign.FeignException.clientErrorStatus(FeignException.java:195) ~[feign-core-10.10.1.jar!/:?] at feign.FeignException.errorStatus(FeignException.java:177) ~[feign-core-10.10.1.jar!/:?] at feign.FeignException.errorStatus(FeignException.java:169) ~[feign-core-10.10.1.jar!/:?] at feign.codec.ErrorDecoder$Default.decode(ErrorDecoder.java:92) ~[feign-core-10.10.1.jar!/:?] at feign.AsyncResponseHandler.handleResponse(AsyncResponseHandler.java:96) ~[feign-core-10.10.1.jar!/:?] at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:138) ~[feign-core-10.10.1.jar!/:?] at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:89) ~[feign-core-10.10.1.jar!/:?] at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:100) ~[feign-core-10.10.1.jar!/:?] at com.sun.proxy.$Proxy139.getAccessionItem(Unknown Source) ~[?:?] at org.folio.ed.service.RemoteStorageService.getAccessionItem(RemoteStorageService.java:29) ~[classes!/:1.0.0-SNAPSHOT] at org.folio.ed.controller.AccessionController.getAccessionItem(AccessionController.java:34) ~[classes!/:1.0.0-SNAPSHOT] at org.folio.ed.controller.AccessionController$$FastClassBySpringCGLIB$$edcec0e.invoke(<generated>) ~[classes!/:1.0.0-SNAPSHOT] at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771) ~[spring-aop-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) ~[spring-aop-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:119) ~[spring-context-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) ~[spring-aop-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691) ~[spring-aop-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.folio.ed.controller.AccessionController$$EnhancerBySpringCGLIB$$77717a57.getAccessionItem(<generated>) ~[classes!/:1.0.0-SNAPSHOT] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) ~[spring-webmvc-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:878) ~[spring-webmvc-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:792) ~[spring-webmvc-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) ~[spring-webmvc-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:626) ~[tomcat-embed-core-9.0.38.jar!/:4.0.FR] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) ~[tomcat-embed-core-9.0.38.jar!/:4.0.FR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.38.jar!/:9.0.38] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.folio.spring.scope.filter.FolioExecutionScopeFilter.doFilter(FolioExecutionScopeFilter.java:33) ~[folio-spring-base-1.0.1.jar!/:1.0.1] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.folio.edgecommonspring.filter.EdgeSecurityFilter.doFilter(EdgeSecurityFilter.java:60) ~[edge-common-spring-1.0.0-SNAPSHOT.jar!/:1.0.0-SNAPSHOT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:93) ~[spring-boot-actuator-2.3.4.RELEASE.jar!/:2.3.4.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.9.RELEASE.jar!/:5.2.9.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) [tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) [tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) [tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374) [tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590) [tomcat-embed-core-9.0.38.jar!/:9.0.38] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.38.jar!/:9.0.38] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.38.jar!/:9.0.38] at java.lang.Thread.run(Thread.java:834) [?:?] Though dumping a generic 500 error doesn't seem ideal to me, apparently that's all you need for this issue. I will add this to the regular folio-snapshot and folio-testing builds, and the module will be in place there tomorrow.
I do understand that. What I don't understand is why the system user's username is not configurable as it is for all other edge modules. |
| Comment by Viachaslau Khandramai (Inactive) [ 25/May/21 ] |
|
Wayne Schneider, thank you for deploying module! Aliaksei Harbuz, could you please clarify the question with system-user? Thanks, Slava |
| Comment by Aliaksei Harbuz [ 26/May/21 ] |
|
Hi, Viachaslau Khandramai, Wayne Schneider we need system user just to organize connection with remote storage module from edge-caiasoft module. At this moment it is not configurable. But in case it is better to use configurable approach it could be implemented as improvement. |
| Comment by Aliaksei Harbuz [ 27/May/21 ] |
|
Hi Wayne Schneider, the deployed edge caiasoft module was checked at snapshot and snapshot-load environments. POST /caiasoftService/Requests/54f65a75-f35b-4f56-86a6-fa4a3d957e57/route/de17bad7-2a30-4f1c-bee5-f653ded15629?apikey=eyJzIjoiY2FpYVNvZnRDbGllbnQiLCJ0IjoiZGlrdSIsInUiOiJjYWlhU29mdENsaWVudCJ9 HTTP/1.1 Host: folio-snapshot.dev.folio.org:8000 Content-Type: application/json Accept: */* When there is no any data for proper execution of such endpoint the service provides the 500 error that is expected. But when there were added some testing data for which the service should provide 200 http status the above endpoint starts provide 502 Bad Gateway error. The logs from mod-remote-storage and edge-caiasoft modules do not have any errors for execution with testing data, only successful action. Logs from mod-remote-storage: 07:29:15 [] [] [] [] INFO CheckInItemService Start check-in process for item with associated request with id=54f65a75-f35b-4f56-86a6-fa4a3d957e57 07:29:15 [] [] [] [] INFO CheckInItemService Start check-in process for item with barcode A0A0A 07:29:15 [] [] [] [] INFO KafkaMessageListener Processing resource events from kafka [eventsCount: 1] 07:29:15 [] [] [] [] INFO ccessionQueueService Starting processing events... 07:29:15 [] [] [] [] INFO ccessionQueueService isEffectiveLocationChanged: false 07:29:15 [] [] [] [] INFO CheckInItemService Check-in success for item with barcode A0A0A Logs from edge-caiasoft: 06:59:20 INFO curityManagerService Using cached token 07:26:41 INFO curityManagerService Using cached token 07:28:23 INFO curityManagerService Using cached token 07:29:15 INFO curityManagerService Using cached token The behavior is the same for snapshot and snapshot-load environments. The module was not checked at testing environment as there is Jenkins issues for deployed module:
TASK [edge-module : fail] ******************************************************
fatal: [10.36.1.19]: FAILED! => {"changed": false, "msg": "edge-caiasoft not initialized for diku"}
|
| Comment by Wayne Schneider [ 27/May/21 ] |
|
The nginx proxy is returning the 502 error for the POST request. In the nginx log I see: 2021/05/27 20:07:40 [error] 62474#62474: *4572 upstream sent invalid chunked response while reading upstream, client: 10.36.1.64, server: 10.36.1.199, request: "POST /caiasoftService/Requests/54f65a75-f35b-4f56-86a6-fa4a3d957e57/route/de17bad7-2a30-4f1c-bee5-f653ded15629 HTTP/1.1", upstream: "http://127.0.0.1:9706/caiasoftService/Requests/54f65a75-f35b-4f56-86a6-fa4a3d957e57/route/de17bad7-2a30-4f1c-bee5-f653ded15629", host: "folio-snapshot.dev.folio.org:8000" When I connect directly to the edge-caiasoft container, the response looks reasonable: curl -w '\n' -D - -X POST -H "Authorization: eyJzIjoiV1lNeUxSRUl2UnYxSnQ5QXM4WlYiLCJ0IjoiZGlrdSIsInUiOiJjYWlhU29mdENsaWVudCJ9" http://localhost:9706/caiasoftService/Requests/54f65a75-f35b-4f56-86a6-fa4a3d957e57/route/de17bad7-2a30-4f1c-bee5-f653ded15629 HTTP/1.1 200 connection: keep-alive date: Thu, 27 May 2021 20:17:05 GMT keep-alive: timeout=60 transfer-encoding: chunked vary: origin x-okapi-trace: POST mod-remote-storage-1.1.0-SNAPSHOT.105 http://10.36.1.199:9175/remote-storage/retrieve/de17bad7-2a30-4f1c-bee5-f653ded15629/checkInItemByHoldId : 200 78991us Content-Type: text/plain;charset=UTF-8 Transfer-Encoding: chunked Check-in was done for item with holdId54f65a75-f35b-4f56-86a6-fa4a3d957e57 Apparently the nginx proxy http version by default is HTTP 1.0, not 1.1. This is the first edge module we've proxied that attempts to do HTTP 1.1. |
| Comment by Wayne Schneider [ 27/May/21 ] |
|
In my testing, setting up nginx to proxy HTTP 1.1 for edge-caiasoft resolves the issue. I now get a good response to my POST to https://folio-snapshot-edge.dev.folio.org:8000/caiasoftService/Requests/54f65a75-f35b-4f56-86a6-fa4a3d957e57/route/de17bad7-2a30-4f1c-bee5-f653ded15629:
Check-in was done for item with holdId54f65a75-f35b-4f56-86a6-fa4a3d957e57
This has been fixed for folio-snapshot and folio-snapshot-load. There is some other problem with folio-testing, still under investigation. |
| Comment by Wayne Schneider [ 28/May/21 ] |
|
The problem with folio-testing should also have been resolved. Aliaksei Harbuz can you please test and confirm in both folio-snapshot and folio-testing? Thanks! |
| Comment by Aliaksei Harbuz [ 28/May/21 ] |
|
Wayne Schneider , the edge caiasoft module successfully responses at folio-snapshot, folio-snapshot-load, folio-testing environments. |
| Comment by Wayne Schneider [ 28/May/21 ] |
|
Thanks for testing! Closing this issue now. |