From 3c20e2abfd4f224b99ebe93a17f1154307c476ee Mon Sep 17 00:00:00 2001 From: FedericoRuzzier <49512050+FedericoRuzzier@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:27:25 +0200 Subject: [PATCH 01/20] PAGOPA-2221 changing logs to debug level --- .../wispconverter/controller/RPTTimerController.java | 8 ++++---- .../wispconverter/controller/ReceiptController.java | 12 ++++++------ .../controller/ReceiptTimerController.java | 8 ++++---- .../wispconverter/controller/RecoveryController.java | 10 +++++----- .../wispconverter/controller/RedirectController.java | 4 ++-- .../wispconverter/service/ConfigCacheService.java | 2 +- .../wispconverter/service/RPTTimerService.java | 4 ++-- .../wispconverter/service/RecoveryService.java | 4 ++-- 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/RPTTimerController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/RPTTimerController.java index 86a26c25..c9c72462 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/RPTTimerController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/RPTTimerController.java @@ -51,9 +51,9 @@ public class RPTTimerController { @Trace(businessProcess = RPT_BP_TIMER_SET, reEnabled = true) public void createTimer(@RequestBody RPTTimerRequest request) { try { - log.info("Invoking API operation createRPTTimer - args: {}", sanitizeInput(request.toString())); + log.debug("Invoking API operation createRPTTimer - args: {}", sanitizeInput(request.toString())); rptTimerService.sendMessage(request); - log.info("Successful API operation createRPTTimer"); + log.debug("Successful API operation createRPTTimer"); } catch (Exception ex) { if(!(ex instanceof AppException)) { String operationId = MDC.get(Constants.MDC_OPERATION_ID); @@ -77,9 +77,9 @@ public void createTimer(@RequestBody RPTTimerRequest request) { @Trace(businessProcess = RPT_BP_TIMER_DELETE, reEnabled = true) public void deleteTimer(@RequestParam() String sessionId) { try { - log.info("Invoking API operation deleteRPTTimer - args: {}", sanitizeInput(sessionId)); + log.debug("Invoking API operation deleteRPTTimer - args: {}", sanitizeInput(sessionId)); rptTimerService.cancelScheduledMessage(sessionId); - log.info("Successful API operation deleteRPTTimer"); + log.debug("Successful API operation deleteRPTTimer"); } catch (Exception ex) { String operationId = MDC.get(Constants.MDC_OPERATION_ID); log.error(String.format("GenericException: operation-id=[%s]", operationId != null ? operationId : "n/a"), ex); diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java index b1817c88..e96f7caa 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java @@ -74,7 +74,7 @@ public class ReceiptController { @Trace(businessProcess = BP_RECEIPT_RETRIEVE, reEnabled = true) public ResponseEntity receiptRetrieve(@QueryParam("ci") String ci, @QueryParam("ccp") String ccp, @QueryParam("iuv") String iuv) { try { - log.info("Invoking API operation receiptRetrieve - args: {}", ci, ccp, iuv); + log.debug("Invoking API operation receiptRetrieve - args: {}", ci, ccp, iuv); if(rtReceiptCosmosService.receiptRtExist(ci, iuv, ccp)) return ResponseEntity.ok(""); else return ResponseEntity.notFound().build(); @@ -87,7 +87,7 @@ public ResponseEntity receiptRetrieve(@QueryParam("ci") String ci, @Quer log.error("Failed API operation receiptRetrieve - error: {}", errorResponse); throw ex; } finally { - log.info("Successful API operation receiptRetrieve"); + log.debug("Successful API operation receiptRetrieve"); } } @@ -104,9 +104,9 @@ public ResponseEntity receiptRetrieve(@QueryParam("ci") String ci, @Quer public void receiptKo(@RequestBody String request) throws Exception { try { - log.info("Invoking API operation receiptKo - args: {}", request); + log.debug("Invoking API operation receiptKo - args: {}", request); receiptService.sendKoPaaInviaRtToCreditorInstitution(List.of(mapper.readValue(request, ReceiptDto.class)).toString()); - log.info("Successful API operation receiptKo"); + log.debug("Successful API operation receiptKo"); } catch (Exception ex) { String operationId = MDC.get(Constants.MDC_OPERATION_ID); log.error(String.format("GenericException: operation-id=[%s]", operationId != null ? operationId : "n/a"), ex); @@ -131,9 +131,9 @@ public void receiptKo(@RequestBody String request) throws Exception { public void receiptOk(@RequestBody ReceiptRequest request) throws IOException { try { - log.info("Invoking API operation receiptOk - args: {}", this.getReceiptRequestInfoToLog(request.getContent())); + log.debug("Invoking API operation receiptOk - args: {}", this.getReceiptRequestInfoToLog(request.getContent())); receiptService.sendOkPaaInviaRtToCreditorInstitution(request.getContent()); - log.info("Successful API operation receiptOk"); + log.debug("Successful API operation receiptOk"); } catch (Exception ex) { String operationId = MDC.get(Constants.MDC_OPERATION_ID); log.error(String.format("GenericException: operation-id=[%s]", operationId != null ? operationId : "n/a"), ex); diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java index 55ad6289..b6e16780 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java @@ -52,9 +52,9 @@ public class ReceiptTimerController { @Trace(businessProcess = BP_TIMER_SET, reEnabled = true) public void createTimer(@RequestBody ReceiptTimerRequest request) { try { - log.info("Invoking API operation createTimer - args: {}", request.toString()); + log.debug("Invoking API operation createTimer - args: {}", request.toString()); receiptTimerService.sendMessage(request); - log.info("Successful API operation createTimer"); + log.debug("Successful API operation createTimer"); } catch (Exception ex) { String operationId = MDC.get(Constants.MDC_OPERATION_ID); log.error(String.format("GenericException: operation-id=[%s]", operationId != null ? operationId : "n/a"), ex); @@ -77,10 +77,10 @@ public void createTimer(@RequestBody ReceiptTimerRequest request) { @Trace(businessProcess = BP_TIMER_DELETE, reEnabled = true) public void deleteTimer(@RequestParam() String paymentTokens) { try { - log.info("Invoking API operation deleteTimer - args: {}", paymentTokens); + log.debug("Invoking API operation deleteTimer - args: {}", paymentTokens); List tokens = Arrays.asList(paymentTokens.split(",")); receiptTimerService.cancelScheduledMessage(tokens); - log.info("Successful API operation deleteTimer"); + log.debug("Successful API operation deleteTimer"); } catch (Exception ex) { String operationId = MDC.get(Constants.MDC_OPERATION_ID); log.error(String.format("GenericException: operation-id=[%s]", operationId != null ? operationId : "n/a"), ex); diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java index 40708670..7a175957 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java @@ -42,7 +42,7 @@ public class RecoveryController { @PostMapping(value = "/{creditor_institution}/receipt-ko") public ResponseEntity recoverReceiptKOForCreditorInstitution(@PathVariable("creditor_institution") String ci, @QueryParam("date_from") String dateFrom, @QueryParam("date_to") String dateTo) { try { - log.info("Invoking API operation recoverReceiptKOForCreditorInstitution - args: {} {} {}", ci, dateFrom, dateTo); + log.debug("Invoking API operation recoverReceiptKOForCreditorInstitution - args: {} {} {}", ci, dateFrom, dateTo); RecoveryReceiptResponse response = recoveryService.recoverReceiptKOForCreditorInstitution(ci, dateFrom, dateTo); return ResponseEntity.ok(response); } catch (Exception ex) { @@ -53,7 +53,7 @@ public ResponseEntity recoverReceiptKOForCreditorInstit log.error("Failed API operation recoverReceiptKOForCreditorInstitution - error: {}", errorResponse); throw ex; } finally { - log.info("Successful API operation recoverReceiptKOForCreditorInstitution"); + log.debug("Successful API operation recoverReceiptKOForCreditorInstitution"); } } @@ -68,7 +68,7 @@ public ResponseEntity recoverReceiptKOForCreditorInstitutionAndIUV(@Patt @Pattern(regexp = "[a-zA-Z0-9_-]{1,10}") @QueryParam("date_from") String dateFrom, @Pattern(regexp = "[a-zA-Z0-9_-]{1,10}") @QueryParam("date_to") String dateTo) { try { - log.info("Invoking API operation recoverReceiptKOForCreditorInstitution - args: {} {} {} {}", ci, iuv, dateFrom, dateTo); + log.debug("Invoking API operation recoverReceiptKOForCreditorInstitution - args: {} {} {} {}", ci, iuv, dateFrom, dateTo); boolean recovered = recoveryService.recoverReceiptKO(ci, iuv, dateFrom, dateTo); if(recovered) @@ -82,7 +82,7 @@ public ResponseEntity recoverReceiptKOForCreditorInstitutionAndIUV(@Patt log.error("Failed API operation recoverReceiptKOForCreditorInstitution - error: {}", errorResponse); throw ex; } finally { - log.info("Successful API operation recoverReceiptKOForCreditorInstitution"); + log.debug("Successful API operation recoverReceiptKOForCreditorInstitution"); } } @@ -93,7 +93,7 @@ public ResponseEntity recoverReceiptKOForCreditorInstitutionAndIUV(@Patt @PostMapping(value = "/proxy") public ResponseEntity recoverReceiptToBeSentByProxy(@RequestBody RecoveryProxyReceiptRequest request) { try { - log.info("Invoking API operation recoverReceiptToBeSentByProxy - args: {}", request); + log.debug("Invoking API operation recoverReceiptToBeSentByProxy - args: {}", request); return ResponseEntity.ok(recoveryService.recoverReceiptToBeSentByProxy(request)); } catch (Exception ex) { String operationId = MDC.get(Constants.MDC_OPERATION_ID); diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/RedirectController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/RedirectController.java index 7b1dcc1c..0b4c5194 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/RedirectController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/RedirectController.java @@ -53,9 +53,9 @@ public String redirect(@Parameter(description = "", example = "identificativoInt @RequestParam("idSession") String idSession, HttpServletResponse response) { try { - log.info("Invoking API operation redirect - args: {}", idSession.matches("[\\w\\-]*") ? idSession : "..."); + log.debug("Invoking API operation redirect - args: {}", idSession.matches("[\\w\\-]*") ? idSession : "..."); String redirectURI = converterService.convert(idSession); - log.info("Successful API operation redirect - result: {}", redirectURI); + log.debug("Successful API operation redirect - result: {}", redirectURI); return "redirect:" + redirectURI; } catch (AppException appException) { ErrorResponse errorResponse = errorUtil.forAppException(appException); diff --git a/src/main/java/it/gov/pagopa/wispconverter/service/ConfigCacheService.java b/src/main/java/it/gov/pagopa/wispconverter/service/ConfigCacheService.java index b847f662..6dcf8e0b 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/service/ConfigCacheService.java +++ b/src/main/java/it/gov/pagopa/wispconverter/service/ConfigCacheService.java @@ -29,7 +29,7 @@ public class ConfigCacheService { private List cacheKeys; public void refreshCache() { - log.info("loadCache from cache api"); + log.debug("loadCache from cache api"); try { it.gov.pagopa.gen.wispconverter.client.cache.api.CacheApi apiInstance = new it.gov.pagopa.gen.wispconverter.client.cache.api.CacheApi(configCacheClient); diff --git a/src/main/java/it/gov/pagopa/wispconverter/service/RPTTimerService.java b/src/main/java/it/gov/pagopa/wispconverter/service/RPTTimerService.java index 25e0c3ac..4687edea 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/service/RPTTimerService.java +++ b/src/main/java/it/gov/pagopa/wispconverter/service/RPTTimerService.java @@ -98,7 +98,7 @@ public void sendMessage(RPTTimerRequest message) { Long sequenceNumber = serviceBusSenderClient.scheduleMessage(serviceBusMessage, scheduledExpirationTime); // log event - log.info("Sent scheduled message_base64 {} to the queue: {}", LogUtils.encodeToBase64(sanitizeInput(message.toString())), queueName); + log.debug("Sent scheduled message_base64 {} to the queue: {}", LogUtils.encodeToBase64(sanitizeInput(message.toString())), queueName); generateRE(InternalStepStatus.RPT_TIMER_CREATED, "Scheduled RPTTimerService: [" + message + "]"); // insert in Redis cache sequenceNumber of the message @@ -123,7 +123,7 @@ public void cancelScheduledMessage(String sessionId) { // cancel scheduled message in the service bus queue callCancelScheduledMessage(sequenceNumber); - log.info("Canceled scheduled message for rpt_timer_base64 {}", LogUtils.encodeToBase64(sanitizeInput(sessionId))); + log.debug("Canceled scheduled message for rpt_timer_base64 {}", LogUtils.encodeToBase64(sanitizeInput(sessionId))); // delete the sequenceNumber from the Redis cache cacheRepository.delete(key); diff --git a/src/main/java/it/gov/pagopa/wispconverter/service/RecoveryService.java b/src/main/java/it/gov/pagopa/wispconverter/service/RecoveryService.java index 979baaa8..70fd83c1 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/service/RecoveryService.java +++ b/src/main/java/it/gov/pagopa/wispconverter/service/RecoveryService.java @@ -117,10 +117,10 @@ public RecoveryReceiptResponse recoverReceiptKOForCreditorInstitution(String cre if (LocalDate.now().isEqual(parse)) { ZonedDateTime nowMinusMinutes = ZonedDateTime.now(ZoneOffset.UTC).minusMinutes(receiptGenerationWaitTime); dateToRefactored = nowMinusMinutes.format(DateTimeFormatter.ofPattern(DATE_FORMAT)); - log.info("Upper bound forced to {}", dateToRefactored); + log.debug("Upper bound forced to {}", dateToRefactored); } else { dateToRefactored = dateTo + " 23:59:59"; - log.info("Upper bound set to {}", dateToRefactored); + log.debug("Upper bound set to {}", dateToRefactored); } List receiptRTs = rtRepository.findByOrganizationId(creditorInstitution, dateFrom, dateToRefactored); From b506b7d7658cbc2aebce7cda19e8d4e63dc0f9c4 Mon Sep 17 00:00:00 2001 From: FedericoRuzzier <49512050+FedericoRuzzier@users.noreply.github.com> Date: Wed, 2 Oct 2024 16:27:43 +0200 Subject: [PATCH 02/20] PAGOPA-2221 adding logs config --- docker/applicationinsights.json | 19 +++ docker/run_docker.sh | 7 +- pom.xml | 4 + .../wispconverter/config/LoggingAspect.java | 152 ++++++++++++++++++ src/main/resources/logback-spring.xml | 27 ++-- 5 files changed, 196 insertions(+), 13 deletions(-) create mode 100644 docker/applicationinsights.json create mode 100644 src/main/java/it/gov/pagopa/wispconverter/config/LoggingAspect.java diff --git a/docker/applicationinsights.json b/docker/applicationinsights.json new file mode 100644 index 00000000..312fe75f --- /dev/null +++ b/docker/applicationinsights.json @@ -0,0 +1,19 @@ +{ + "selfDiagnostics": { + "destination": "console", + "level": "INFO" + }, + "sampling": { + "requestsPerSecond": 5 + }, + "preview": { + "sampling": { + "overrides": [ + { + "telemetryKind": "exception", + "percentage": 100 + } + ] + } + } +} \ No newline at end of file diff --git a/docker/run_docker.sh b/docker/run_docker.sh index 5d98b043..9584c741 100755 --- a/docker/run_docker.sh +++ b/docker/run_docker.sh @@ -33,10 +33,13 @@ done keyvault=$(yq -r '."microservice-chart".keyvault.name' ../helm/values-$ENV.yaml) secret=$(yq -r '."microservice-chart".envSecret' ../helm/values-$ENV.yaml) -for line in $(echo "$secret" | jq -r '. | to_entries[] | select(.key) | "\(.key)=\(.value)"'); do +for line in $(echo "$secret" | yq -r '. | to_entries[] | select(.key) | "\(.key)=\(.value)"'); do IFS='=' read -r -a array <<< "$line" response=$(az keyvault secret show --vault-name $keyvault --name "${array[1]}") - value=$(echo "$response" | jq -r '.value') + response=$(echo "$response" | tr -d '\n') + value=$(echo "$response" | yq -r '.value') + value=$(echo "$value" | sed 's/\$/\$\$/g') + value=$(echo "$value" | tr -d '\n') echo "${array[0]}=$value" >> .env done diff --git a/pom.xml b/pom.xml index 183c931b..07164cae 100644 --- a/pom.xml +++ b/pom.xml @@ -75,6 +75,10 @@ spring-boot-starter-cache + + org.springframework + spring-aspects + diff --git a/src/main/java/it/gov/pagopa/wispconverter/config/LoggingAspect.java b/src/main/java/it/gov/pagopa/wispconverter/config/LoggingAspect.java new file mode 100644 index 00000000..2814d765 --- /dev/null +++ b/src/main/java/it/gov/pagopa/wispconverter/config/LoggingAspect.java @@ -0,0 +1,152 @@ +package it.gov.pagopa.wispconverter.config; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import javax.annotation.PostConstruct; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.xml.bind.JAXBElement; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.slf4j.MDC; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import static it.gov.pagopa.wispconverter.util.CommonUtility.deNull; + +@Aspect +@Component +@Slf4j +public class LoggingAspect { + + public static final String START_TIME = "startTime"; + public static final String METHOD = "method"; + public static final String STATUS = "status"; + public static final String CODE = "httpCode"; + public static final String RESPONSE_TIME = "responseTime"; + public static final String FAULT_CODE = "faultCode"; + public static final String FAULT_DETAIL = "faultDetail"; + public static final String REQUEST_ID = "requestId"; + public static final String OPERATION_ID = "operationId"; + public static final String ARGS = "args"; + + final HttpServletRequest httRequest; + + final HttpServletResponse httpResponse; + + @Value("${info.application.name}") + private String name; + + @Value("${info.application.version}") + private String version; + + @Value("${info.properties.environment}") + private String environment; + + public LoggingAspect(HttpServletRequest httRequest, HttpServletResponse httpResponse) { + this.httRequest = httRequest; + this.httpResponse = httpResponse; + } + + public static String getExecutionTime() { + String startTime = MDC.get(START_TIME); + if (startTime != null) { + long endTime = System.currentTimeMillis(); + long executionTime = endTime - Long.parseLong(startTime); + return String.valueOf(executionTime); + } + return "-"; + } + + private static Map getParams(ProceedingJoinPoint joinPoint) { + MethodSignature signature = (MethodSignature) joinPoint.getSignature(); + Method method = signature.getMethod(); + Map params = new HashMap<>(); + int i = 0; + for (var parameter : method.getParameters()) { + var paramName = parameter.getName(); + var arg = joinPoint.getArgs()[i++]; + if (arg instanceof JAXBElement) { + try { + arg = new ObjectMapper().writer().writeValueAsString(arg); + } catch (JsonProcessingException e) { + arg = "unreadable!"; + } + } + params.put(paramName, deNull(arg)); + } + return params; + } + + @Pointcut("@within(org.springframework.web.bind.annotation.RestController)") + public void restController() { + // all rest controllers + } + + @Pointcut("@within(org.springframework.ws.server.endpoint.annotation.Endpoint)") + public void endpointClass() { + // all rest controllers + } + + @Pointcut("@within(org.springframework.stereotype.Repository)") + public void repository() { + // all repository methods + } + + @Pointcut("@within(org.springframework.stereotype.Service)") + public void service() { + // all service methods + } + + /** Log essential info of application during the startup. */ + @PostConstruct + public void logStartup() { + log.info("-> Starting {} version {} - environment {}", name, version, environment); + } + + @Around(value = "restController() || endpointClass()") + public Object logApiInvocation(ProceedingJoinPoint joinPoint) throws Throwable { + MDC.put(METHOD, joinPoint.getSignature().getName()); + MDC.put(START_TIME, String.valueOf(System.currentTimeMillis())); + MDC.put(OPERATION_ID, UUID.randomUUID().toString()); + if (MDC.get(REQUEST_ID) == null) { + var requestId = UUID.randomUUID().toString(); + MDC.put(REQUEST_ID, requestId); + } + Map params = getParams(joinPoint); + MDC.put(ARGS, params.toString()); + + log.info("Invoking API operation {} - args: {}", joinPoint.getSignature().getName(), params); + + Object result = joinPoint.proceed(); + + MDC.put(STATUS, "OK"); + MDC.put(CODE, String.valueOf(httpResponse.getStatus())); + MDC.put(RESPONSE_TIME, getExecutionTime()); + log.info( + "Successful API operation {} - result: {}", joinPoint.getSignature().getName(), result); + MDC.remove(STATUS); + MDC.remove(CODE); + MDC.remove(RESPONSE_TIME); + MDC.remove(START_TIME); + return result; + } + + @Around(value = "repository() || service()") + public Object logTrace(ProceedingJoinPoint joinPoint) throws Throwable { + Map params = getParams(joinPoint); + log.debug("Call method {} - args: {}", joinPoint.getSignature().toShortString(), params); + Object result = joinPoint.proceed(); + log.debug("Return method {} - result: {}", joinPoint.getSignature().toShortString(), result); + return result; + } +} \ No newline at end of file diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index a61c8853..287d76b5 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -1,24 +1,29 @@ - + + + + - - + + + + %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m %clr(%mdc){magenta}%n%wEx + + + - + - - - - - + + ${OTEL_SERVICE_NAME} - ${SERVICE_VERSION} + ${ECS_SERVICE_VERSION} ${ENV} @@ -28,4 +33,4 @@ - + \ No newline at end of file From e83cc43e474b62381e85d777c7480a36da7addf2 Mon Sep 17 00:00:00 2001 From: FedericoRuzzier <49512050+FedericoRuzzier@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:04:31 +0200 Subject: [PATCH 03/20] PAGOPA-2221 sanitize input --- .../wispconverter/controller/ReceiptController.java | 6 ++++-- .../controller/ReceiptTimerController.java | 6 ++++-- .../wispconverter/controller/RecoveryController.java | 12 ++++++++---- .../gov/pagopa/wispconverter/util/CommonUtility.java | 6 +----- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java index e96f7caa..5332203d 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java @@ -40,6 +40,8 @@ import java.io.StringReader; import java.util.List; +import static it.gov.pagopa.wispconverter.util.CommonUtility.sanitizeInput; + @RestController @RequestMapping("/receipt") @Validated @@ -74,7 +76,7 @@ public class ReceiptController { @Trace(businessProcess = BP_RECEIPT_RETRIEVE, reEnabled = true) public ResponseEntity receiptRetrieve(@QueryParam("ci") String ci, @QueryParam("ccp") String ccp, @QueryParam("iuv") String iuv) { try { - log.debug("Invoking API operation receiptRetrieve - args: {}", ci, ccp, iuv); + log.debug("Invoking API operation receiptRetrieve - ci: {}, ccp: {}, iuv: {}", sanitizeInput(ci), sanitizeInput(ccp), sanitizeInput(iuv)); if(rtReceiptCosmosService.receiptRtExist(ci, iuv, ccp)) return ResponseEntity.ok(""); else return ResponseEntity.notFound().build(); @@ -104,7 +106,7 @@ public ResponseEntity receiptRetrieve(@QueryParam("ci") String ci, @Quer public void receiptKo(@RequestBody String request) throws Exception { try { - log.debug("Invoking API operation receiptKo - args: {}", request); + log.debug("Invoking API operation receiptKo - args: {}", sanitizeInput(request)); receiptService.sendKoPaaInviaRtToCreditorInstitution(List.of(mapper.readValue(request, ReceiptDto.class)).toString()); log.debug("Successful API operation receiptKo"); } catch (Exception ex) { diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java index b6e16780..c919c921 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java @@ -25,6 +25,8 @@ import java.util.Arrays; import java.util.List; +import static it.gov.pagopa.wispconverter.util.CommonUtility.sanitizeInput; + @RestController @RequestMapping("/receipt") @Validated @@ -52,7 +54,7 @@ public class ReceiptTimerController { @Trace(businessProcess = BP_TIMER_SET, reEnabled = true) public void createTimer(@RequestBody ReceiptTimerRequest request) { try { - log.debug("Invoking API operation createTimer - args: {}", request.toString()); + log.debug("Invoking API operation createTimer - args: {}", sanitizeInput(request.toString())); receiptTimerService.sendMessage(request); log.debug("Successful API operation createTimer"); } catch (Exception ex) { @@ -77,7 +79,7 @@ public void createTimer(@RequestBody ReceiptTimerRequest request) { @Trace(businessProcess = BP_TIMER_DELETE, reEnabled = true) public void deleteTimer(@RequestParam() String paymentTokens) { try { - log.debug("Invoking API operation deleteTimer - args: {}", paymentTokens); + log.debug("Invoking API operation deleteTimer - args: {}", sanitizeInput(paymentTokens)); List tokens = Arrays.asList(paymentTokens.split(",")); receiptTimerService.cancelScheduledMessage(tokens); log.debug("Successful API operation deleteTimer"); diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java index fa517f0a..d0384f8e 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java @@ -23,6 +23,8 @@ import org.springframework.web.ErrorResponse; import org.springframework.web.bind.annotation.*; +import static it.gov.pagopa.wispconverter.util.CommonUtility.sanitizeInput; + @RestController @RequestMapping("/recovery") @Validated @@ -42,8 +44,9 @@ public class RecoveryController { @PostMapping(value = "/{creditor_institution}/receipt-ko") public ResponseEntity recoverReceiptKOForCreditorInstitution(@PathVariable("creditor_institution") String ci, @QueryParam("date_from") String dateFrom, @QueryParam("date_to") String dateTo) { try { - log.debug("Invoking API operation recoverReceiptKOForCreditorInstitution - args: {} {} {}", ci, dateFrom, dateTo); - RecoveryReceiptResponse response = recoveryService.recoverReceiptKOForCreditorInstitution(ci, dateFrom, dateTo); + log.debug("Invoking API operation recoverReceiptKOForCreditorInstitution - args: {} {} {}", + sanitizeInput(ci), sanitizeInput(dateFrom), sanitizeInput(dateTo)); + RecoveryReceiptResponse response = recoveryService.recoverReceiptKOByCI(ci, dateFrom, dateTo); return ResponseEntity.ok(response); } catch (Exception ex) { String operationId = MDC.get(Constants.MDC_OPERATION_ID); @@ -69,7 +72,8 @@ public ResponseEntity recoverReceiptKOForCreditorInstit @Pattern(regexp = "[a-zA-Z0-9_-]{1,10}") @QueryParam("date_from") String dateFrom, @Pattern(regexp = "[a-zA-Z0-9_-]{1,10}") @QueryParam("date_to") String dateTo) { try { - log.debug("Invoking API operation recoverReceiptKOForCreditorInstitution - args: {} {} {} {}", ci, iuv, dateFrom, dateTo); + log.debug("Invoking API operation recoverReceiptKOForCreditorInstitution - args: {} {} {} {}", + sanitizeInput(ci), sanitizeInput(iuv), sanitizeInput(dateFrom), sanitizeInput(dateTo)); RecoveryReceiptResponse recoveryReceiptResponse = recoveryService.recoverReceiptKOByIUV(ci, iuv, dateFrom, dateTo); if(recoveryReceiptResponse != null) { @@ -97,7 +101,7 @@ public ResponseEntity recoverReceiptKOForCreditorInstit @PostMapping(value = "/proxy") public ResponseEntity recoverReceiptToBeSentByProxy(@RequestBody RecoveryProxyReceiptRequest request) { try { - log.debug("Invoking API operation recoverReceiptToBeSentByProxy - args: {}", request); + log.debug("Invoking API operation recoverReceiptToBeSentByProxy - args: {}", sanitizeInput(request.toString())); return ResponseEntity.ok(recoveryService.recoverReceiptToBeSentByProxy(request)); } catch (Exception ex) { String operationId = MDC.get(Constants.MDC_OPERATION_ID); diff --git a/src/main/java/it/gov/pagopa/wispconverter/util/CommonUtility.java b/src/main/java/it/gov/pagopa/wispconverter/util/CommonUtility.java index f3d1495b..55d5c83b 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/util/CommonUtility.java +++ b/src/main/java/it/gov/pagopa/wispconverter/util/CommonUtility.java @@ -230,10 +230,6 @@ private static boolean checkStation(ConfigCacheService configCacheService, Sessi } public static String sanitizeInput(String input) { - if (input.matches("\\w*")) { - return input; - } else { - return "suspicious input"; - } + return input != null ? input.replace("\n", "").replaceAll("[^a-zA-Z0-9_\\-+/]", "") : ""; } } From ad51483a95de78368486b122cd6fbc80923d9ea5 Mon Sep 17 00:00:00 2001 From: FedericoRuzzier <49512050+FedericoRuzzier@users.noreply.github.com> Date: Thu, 3 Oct 2024 09:48:14 +0200 Subject: [PATCH 04/20] PAGOPA-2221 update dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 5fd0c4ad..70c02124 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,7 @@ FROM ghcr.io/pagopa/docker-base-springboot-openjdk17:v2.0.0@sha256:629fc410b11f8 COPY --chown=spring:spring --from=builder dependencies/ ./ COPY --chown=spring:spring --from=builder snapshot-dependencies/ ./ +COPY --chown=spring:spring docker/applicationinsights.json ./applicationinsights.json # https://github.com/moby/moby/issues/37965#issuecomment-426853382 RUN true COPY --chown=spring:spring --from=builder spring-boot-loader/ ./ From 3613ef63d602bf9187a5c0160e74ab8f0c16089d Mon Sep 17 00:00:00 2001 From: aacitelli Date: Tue, 15 Oct 2024 17:55:23 +0200 Subject: [PATCH 05/20] [PAGOPA-2221] service bus opt log --- .../exception/AppErrorCodeMessageEnum.java | 3 ++- .../ECommerceHangTimeoutConsumer.java | 7 ++++-- .../servicebus/PaymentTimeoutConsumer.java | 8 +++--- .../servicebus/RPTTimeoutConsumer.java | 25 ++++++------------- .../wispconverter/servicebus/RTConsumer.java | 18 +++++++++++-- 5 files changed, 36 insertions(+), 25 deletions(-) diff --git a/src/main/java/it/gov/pagopa/wispconverter/exception/AppErrorCodeMessageEnum.java b/src/main/java/it/gov/pagopa/wispconverter/exception/AppErrorCodeMessageEnum.java index 81049072..f03ddcf7 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/exception/AppErrorCodeMessageEnum.java +++ b/src/main/java/it/gov/pagopa/wispconverter/exception/AppErrorCodeMessageEnum.java @@ -62,7 +62,8 @@ public enum AppErrorCodeMessageEnum { CLIENT_CHECKOUT(3004, "Checkout error", "Error while communicating with Checkout service. {0}", HttpStatus.INTERNAL_SERVER_ERROR, "An error occurred while communicating with Checkout backend internal service in order to send a request about the cart creation. It can be related to any client problem, so the best way to handle this is to use the Technical Support's APIs in order to find the cause."), CLIENT_PAAINVIART(3005, "PaaInviaRT error", "Error while communicating with Station for paaInviaRT service. {0}", HttpStatus.INTERNAL_SERVER_ERROR, "An error occurred while communicating with the creditor institution's station (external service) in order to sending of a paaInviaRT request. It can be related to any client problem, so the best way to handle this is to use the Technical Support's APIs in order to find the cause."), CLIENT_CARTSESSION_CACHING(3006, "Cart caching client error", "Error while communicating with cart caching API. {0}", HttpStatus.INTERNAL_SERVER_ERROR, "An error occurred while communicating with an internal service endpoint dedicated to storing internal cache for handle unique session on cart. It can be related to any client problem, so the best way to handle this is to use the Technical Support's APIs in order to find the cause."), - ; + + UNKNOWN (null, null, null, null, null); private final Integer code; private final String title; diff --git a/src/main/java/it/gov/pagopa/wispconverter/servicebus/ECommerceHangTimeoutConsumer.java b/src/main/java/it/gov/pagopa/wispconverter/servicebus/ECommerceHangTimeoutConsumer.java index d1d9d34b..07f4e189 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/servicebus/ECommerceHangTimeoutConsumer.java +++ b/src/main/java/it/gov/pagopa/wispconverter/servicebus/ECommerceHangTimeoutConsumer.java @@ -24,6 +24,8 @@ import java.time.ZonedDateTime; import java.util.List; +import static it.gov.pagopa.wispconverter.util.SchedulerUtils.*; + /** * This class is the consumer of the queue 'ecommerce-hang-timeout' of the service bus. * When a schedule message trigger this class we'll expire the payment, @@ -56,7 +58,7 @@ public void post() { @EventListener(ApplicationReadyEvent.class) public void initializeClient() { if (receiverClient != null) { - log.info("[Scheduled] Starting ECommerceHangTimeoutConsumer {}", ZonedDateTime.now()); + updateMDCForStartExecution("initializeClient", "[Scheduled] Starting ECommerceHangTimeoutConsumer "+ ZonedDateTime.now()); receiverClient.start(); } } @@ -81,8 +83,9 @@ public void processMessage(ServiceBusReceivedMessageContext context) { .build()); receiptService.sendKoPaaInviaRtToCreditorInstitution(inputPaaInviaRTKo); } catch (IOException e) { - log.error("Error when read ECommerceHangTimeoutDto value from message: '{}'. Body: '{}'", message.getMessageId(), message.getBody()); + updateMDCError(e, "Error when read ECommerceHangTimeoutDto value from message: '"+message.getMessageId()+"'. Body: '"+message.getBody()+"'"); } + updateMDCForEndExecution(); MDC.clear(); } diff --git a/src/main/java/it/gov/pagopa/wispconverter/servicebus/PaymentTimeoutConsumer.java b/src/main/java/it/gov/pagopa/wispconverter/servicebus/PaymentTimeoutConsumer.java index 8dca304b..44d554d1 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/servicebus/PaymentTimeoutConsumer.java +++ b/src/main/java/it/gov/pagopa/wispconverter/servicebus/PaymentTimeoutConsumer.java @@ -23,6 +23,8 @@ import java.time.ZonedDateTime; import java.util.List; +import static it.gov.pagopa.wispconverter.util.SchedulerUtils.*; + @Slf4j @Component public class PaymentTimeoutConsumer extends SBConsumer { @@ -38,7 +40,7 @@ public class PaymentTimeoutConsumer extends SBConsumer { @EventListener(ApplicationReadyEvent.class) public void initializeClient() { if (receiverClient != null) { - log.info("[Scheduled] Starting PaymentTimeoutConsumer {}", ZonedDateTime.now()); + updateMDCForStartExecution("initializeClient", "[Scheduled] Starting PaymentTimeoutConsumer " + ZonedDateTime.now()); receiverClient.start(); } } @@ -63,9 +65,9 @@ public void processMessage(ServiceBusReceivedMessageContext context) { String inputPaaInviaRTKo = List.of(receiptDto).toString(); receiptService.sendKoPaaInviaRtToCreditorInstitution(inputPaaInviaRTKo); } catch (IOException e) { - log.error("Error when read ReceiptDto value from message: '{}'. Body: '{}'", - message.getMessageId(), message.getBody()); + updateMDCError(e, "Error when read ReceiptDto value from message: '"+message.getMessageId()+"'. Body: '"+message.getBody()+"'"); } + updateMDCForEndExecution(); MDC.clear(); } diff --git a/src/main/java/it/gov/pagopa/wispconverter/servicebus/RPTTimeoutConsumer.java b/src/main/java/it/gov/pagopa/wispconverter/servicebus/RPTTimeoutConsumer.java index 2b37ca76..5bdb9c52 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/servicebus/RPTTimeoutConsumer.java +++ b/src/main/java/it/gov/pagopa/wispconverter/servicebus/RPTTimeoutConsumer.java @@ -5,9 +5,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import it.gov.pagopa.wispconverter.controller.model.RPTTimerRequest; import it.gov.pagopa.wispconverter.repository.model.enumz.InternalStepStatus; -import it.gov.pagopa.wispconverter.service.ConfigCacheService; -import it.gov.pagopa.wispconverter.service.IdempotencyService; -import it.gov.pagopa.wispconverter.service.PaaInviaRTSenderService; import it.gov.pagopa.wispconverter.service.ReceiptService; import it.gov.pagopa.wispconverter.util.CommonUtility; import it.gov.pagopa.wispconverter.util.MDCUtil; @@ -21,6 +18,11 @@ import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; + +import static it.gov.pagopa.wispconverter.util.SchedulerUtils.updateMDCError; +import static it.gov.pagopa.wispconverter.util.SchedulerUtils.updateMDCForEndExecution; +import static it.gov.pagopa.wispconverter.util.SchedulerUtils.updateMDCForStartExecution; + import java.io.IOException; import java.time.ZonedDateTime; @@ -50,18 +52,6 @@ public class RPTTimeoutConsumer extends SBConsumer { @Autowired private ReceiptService receiptService; - @Autowired - private PaaInviaRTSenderService paaInviaRTSenderService; - - @Autowired - private ConfigCacheService configCacheService; - - @Autowired - private IdempotencyService idempotencyService; - - @Autowired - private it.gov.pagopa.gen.wispconverter.client.decouplercaching.invoker.ApiClient decouplerCachingClient; - @PostConstruct public void post() { @@ -74,7 +64,7 @@ public void post() { @EventListener(ApplicationReadyEvent.class) public void initializeClient() { if (receiverClient != null) { - log.info("[Scheduled] Starting RPTTimeoutConsumer {}", ZonedDateTime.now()); + updateMDCForStartExecution("initializeClient", "[Scheduled] Starting RPTTimeoutConsumer " + ZonedDateTime.now()); receiverClient.start(); } } @@ -90,8 +80,9 @@ public void processMessage(ServiceBusReceivedMessageContext context) { // sending rt- from session id receiptService.sendRTKoFromSessionId(timeoutMessage.getSessionId(), InternalStepStatus.RPT_TIMER_TRIGGER); } catch (IOException e) { - log.error("Error when read rpt timer request value from message: '{}'. Body: '{}'", message.getMessageId(), message.getBody()); + updateMDCError(e, "Error when read rpt timer request value from message: '"+message.getMessageId()+"'. Body: '"+message.getBody()+"'"); } + updateMDCForEndExecution(); MDC.clear(); } } \ No newline at end of file diff --git a/src/main/java/it/gov/pagopa/wispconverter/servicebus/RTConsumer.java b/src/main/java/it/gov/pagopa/wispconverter/servicebus/RTConsumer.java index 5108b514..bc892f31 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/servicebus/RTConsumer.java +++ b/src/main/java/it/gov/pagopa/wispconverter/servicebus/RTConsumer.java @@ -15,6 +15,7 @@ import jakarta.xml.soap.SOAPMessage; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.event.ApplicationReadyEvent; @@ -23,6 +24,11 @@ import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; + +import static it.gov.pagopa.wispconverter.util.SchedulerUtils.updateMDCError; +import static it.gov.pagopa.wispconverter.util.SchedulerUtils.updateMDCForEndExecution; +import static it.gov.pagopa.wispconverter.util.SchedulerUtils.updateMDCForStartExecution; + import java.io.IOException; import java.net.InetSocketAddress; import java.net.URI; @@ -66,7 +72,7 @@ public class RTConsumer extends SBConsumer { @EventListener(ApplicationReadyEvent.class) public void initializeClient() { if (receiverClient != null) { - log.info("[Scheduled] Starting RTConsumer {}", ZonedDateTime.now()); + updateMDCForStartExecution("initializeClient", "[Scheduled] Starting RTConsumer " + ZonedDateTime.now()); receiverClient.start(); } } @@ -126,6 +132,7 @@ public void processMessage(ServiceBusReceivedMessageContext context) { } catch (Exception e) { + updateMDCError(e, "RTConsumer error: Re-scheduled send operation"); // Generate a new event in RE for store the unsuccessful re-sending of the receipt generateREForNotSentRT(e); @@ -139,6 +146,9 @@ public void processMessage(ServiceBusReceivedMessageContext context) { log.error("AppException: ", e); } } + + updateMDCForEndExecution(); + MDC.clear(); } private boolean resendRTToCreditorInstitution(String receiptId, RTRequestEntity receipt, String compositedIdForReceipt, String idempotencyKey) { @@ -185,6 +195,8 @@ private boolean resendRTToCreditorInstitution(String receiptId, RTRequestEntity isSend = true; } catch (AppException e) { + + updateMDCError(e, e.getError().getTitle()); // generate a new event in RE for store the unsuccessful re-sending of the receipt generateREForNotSentRT(e); @@ -193,6 +205,8 @@ private boolean resendRTToCreditorInstitution(String receiptId, RTRequestEntity reScheduleReceiptSend(receipt, receiptId, compositedIdForReceipt); } catch (IOException e) { + + updateMDCError(e, "RTConsumer error"); rtReceiptCosmosService.updateReceiptStatus(ci, iuv, ccp, ReceiptStatusEnum.NOT_SENT); @@ -235,7 +249,7 @@ private void reScheduleReceiptSend(RTRequestEntity receipt, String receiptId, St rtReceiptCosmosService.updateReceiptStatus(ci, iuv, ccp, ReceiptStatusEnum.SCHEDULED); } catch (Exception e) { - + updateMDCError(e, "RTConsumer error"); // generate a new event in RE for store the unsuccessful scheduling of the RT send generateREForFailedReschedulingSentRT(e); rtReceiptCosmosService.updateReceiptStatus(ci, iuv, ccp, ReceiptStatusEnum.NOT_SENT); From b7744395af10d3a765f65952a444180d2e59039b Mon Sep 17 00:00:00 2001 From: aacitelli Date: Tue, 15 Oct 2024 17:55:23 +0200 Subject: [PATCH 06/20] [PAGOPA-2221] logging aspect --- .../wispconverter/config/LoggingAspect.java | 315 +++++++++++------- .../config/ScheduledJobsConfig.java | 20 +- .../exception/AppErrorCodeMessageEnum.java | 3 +- .../scheduler/RecoveryScheduler.java | 31 +- .../ECommerceHangTimeoutConsumer.java | 7 +- .../servicebus/PaymentTimeoutConsumer.java | 8 +- .../servicebus/RPTTimeoutConsumer.java | 25 +- .../wispconverter/servicebus/RTConsumer.java | 18 +- .../wispconverter/util/SchedulerUtils.java | 39 +++ 9 files changed, 302 insertions(+), 164 deletions(-) create mode 100644 src/main/java/it/gov/pagopa/wispconverter/util/SchedulerUtils.java diff --git a/src/main/java/it/gov/pagopa/wispconverter/config/LoggingAspect.java b/src/main/java/it/gov/pagopa/wispconverter/config/LoggingAspect.java index 2814d765..b6922912 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/config/LoggingAspect.java +++ b/src/main/java/it/gov/pagopa/wispconverter/config/LoggingAspect.java @@ -1,152 +1,215 @@ package it.gov.pagopa.wispconverter.config; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; +import static it.gov.pagopa.wispconverter.util.CommonUtility.deNull; + import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; import java.util.UUID; + import javax.annotation.PostConstruct; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.xml.bind.JAXBElement; -import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.JoinPoint; import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.reflect.MethodSignature; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.ProblemDetail; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; +import org.springframework.web.ErrorResponse; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +import it.gov.pagopa.wispconverter.exception.AppErrorCodeMessageEnum; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.xml.bind.JAXBElement; +import lombok.extern.slf4j.Slf4j; -import static it.gov.pagopa.wispconverter.util.CommonUtility.deNull; @Aspect @Component @Slf4j public class LoggingAspect { - public static final String START_TIME = "startTime"; - public static final String METHOD = "method"; - public static final String STATUS = "status"; - public static final String CODE = "httpCode"; - public static final String RESPONSE_TIME = "responseTime"; - public static final String FAULT_CODE = "faultCode"; - public static final String FAULT_DETAIL = "faultDetail"; - public static final String REQUEST_ID = "requestId"; - public static final String OPERATION_ID = "operationId"; - public static final String ARGS = "args"; - - final HttpServletRequest httRequest; - - final HttpServletResponse httpResponse; - - @Value("${info.application.name}") - private String name; - - @Value("${info.application.version}") - private String version; - - @Value("${info.properties.environment}") - private String environment; - - public LoggingAspect(HttpServletRequest httRequest, HttpServletResponse httpResponse) { - this.httRequest = httRequest; - this.httpResponse = httpResponse; - } - - public static String getExecutionTime() { - String startTime = MDC.get(START_TIME); - if (startTime != null) { - long endTime = System.currentTimeMillis(); - long executionTime = endTime - Long.parseLong(startTime); - return String.valueOf(executionTime); - } - return "-"; - } - - private static Map getParams(ProceedingJoinPoint joinPoint) { - MethodSignature signature = (MethodSignature) joinPoint.getSignature(); - Method method = signature.getMethod(); - Map params = new HashMap<>(); - int i = 0; - for (var parameter : method.getParameters()) { - var paramName = parameter.getName(); - var arg = joinPoint.getArgs()[i++]; - if (arg instanceof JAXBElement) { - try { - arg = new ObjectMapper().writer().writeValueAsString(arg); - } catch (JsonProcessingException e) { - arg = "unreadable!"; - } - } - params.put(paramName, deNull(arg)); - } - return params; - } - - @Pointcut("@within(org.springframework.web.bind.annotation.RestController)") - public void restController() { - // all rest controllers + public static final String START_TIME = "startTime"; + public static final String METHOD = "method"; + public static final String STATUS = "status"; + public static final String CODE = "httpCode"; + public static final String RESPONSE_TIME = "responseTime"; + public static final String FAULT_CODE = "faultCode"; + public static final String FAULT_DETAIL = "faultDetail"; + public static final String REQUEST_ID = "requestId"; + public static final String OPERATION_ID = "operationId"; + public static final String ARGS = "args"; + + final HttpServletRequest httRequest; + + final HttpServletResponse httpResponse; + + @Value("${info.application.name}") + private String name; + + @Value("${info.application.version}") + private String version; + + @Value("${info.properties.environment}") + private String environment; + + public LoggingAspect(HttpServletRequest httRequest, HttpServletResponse httpResponse) { + this.httRequest = httRequest; + this.httpResponse = httpResponse; + } + + private static String getDetail(ResponseEntity result) { + if (result != null && result.getBody() != null && result.getBody() instanceof ProblemDetail problemDetail + && problemDetail.getDetail() != null) { + return problemDetail.getDetail(); + } else return AppErrorCodeMessageEnum.UNKNOWN.getDetail(); + } + + private static String getTitle(ResponseEntity result) { + if (result != null && result.getBody() != null && result.getBody() instanceof ProblemDetail problemDetail + && problemDetail.getTitle() != null) { + return problemDetail.getTitle(); + } else return AppErrorCodeMessageEnum.UNKNOWN.getTitle(); + } + + public static String getExecutionTime() { + String startTime = MDC.get(START_TIME); + if (startTime != null) { + long endTime = System.currentTimeMillis(); + long executionTime = endTime - Long.parseLong(startTime); + return String.valueOf(executionTime); } - - @Pointcut("@within(org.springframework.ws.server.endpoint.annotation.Endpoint)") - public void endpointClass() { - // all rest controllers - } - - @Pointcut("@within(org.springframework.stereotype.Repository)") - public void repository() { - // all repository methods - } - - @Pointcut("@within(org.springframework.stereotype.Service)") - public void service() { - // all service methods + return "-"; + } + + private static Map getParams(ProceedingJoinPoint joinPoint) { + MethodSignature signature = (MethodSignature) joinPoint.getSignature(); + Method method = signature.getMethod(); + Map params = new HashMap<>(); + int i = 0; + for (var parameter : method.getParameters()) { + var paramName = parameter.getName(); + var arg = joinPoint.getArgs()[i++]; + if (arg instanceof JAXBElement) { + try { + arg = new ObjectMapper().writer().writeValueAsString(arg); + } catch (JsonProcessingException e) { + arg = "unreadable!"; + } + } + params.put(paramName, deNull(arg)); } - - /** Log essential info of application during the startup. */ - @PostConstruct - public void logStartup() { - log.info("-> Starting {} version {} - environment {}", name, version, environment); - } - - @Around(value = "restController() || endpointClass()") - public Object logApiInvocation(ProceedingJoinPoint joinPoint) throws Throwable { - MDC.put(METHOD, joinPoint.getSignature().getName()); - MDC.put(START_TIME, String.valueOf(System.currentTimeMillis())); - MDC.put(OPERATION_ID, UUID.randomUUID().toString()); - if (MDC.get(REQUEST_ID) == null) { - var requestId = UUID.randomUUID().toString(); - MDC.put(REQUEST_ID, requestId); - } - Map params = getParams(joinPoint); - MDC.put(ARGS, params.toString()); - - log.info("Invoking API operation {} - args: {}", joinPoint.getSignature().getName(), params); - - Object result = joinPoint.proceed(); - - MDC.put(STATUS, "OK"); - MDC.put(CODE, String.valueOf(httpResponse.getStatus())); - MDC.put(RESPONSE_TIME, getExecutionTime()); - log.info( - "Successful API operation {} - result: {}", joinPoint.getSignature().getName(), result); - MDC.remove(STATUS); - MDC.remove(CODE); - MDC.remove(RESPONSE_TIME); - MDC.remove(START_TIME); - return result; - } - - @Around(value = "repository() || service()") - public Object logTrace(ProceedingJoinPoint joinPoint) throws Throwable { - Map params = getParams(joinPoint); - log.debug("Call method {} - args: {}", joinPoint.getSignature().toShortString(), params); - Object result = joinPoint.proceed(); - log.debug("Return method {} - result: {}", joinPoint.getSignature().toShortString(), result); - return result; + return params; + } + + @Pointcut("@within(org.springframework.web.bind.annotation.RestController)") + public void restController() { + // all rest controllers + } + + @Pointcut("@within(org.springframework.stereotype.Repository)") + public void repository() { + // all repository methods + } + + @Pointcut("@within(org.springframework.stereotype.Service)") + public void service() { + // all service methods + } + + /** Log essential info of application during the startup. */ + @PostConstruct + public void logStartup() { + log.info("-> Starting {} version {} - environment {}", name, version, environment); + } + + @Around(value = "restController()") + public Object logApiInvocation(ProceedingJoinPoint joinPoint) throws Throwable { + MDC.put(METHOD, joinPoint.getSignature().getName()); + MDC.put(START_TIME, String.valueOf(System.currentTimeMillis())); + MDC.put(OPERATION_ID, UUID.randomUUID().toString()); + if (MDC.get(REQUEST_ID) == null) { + var requestId = UUID.randomUUID().toString(); + MDC.put(REQUEST_ID, requestId); } -} \ No newline at end of file + Map params = getParams(joinPoint); + MDC.put(ARGS, params.toString()); + + log.debug("Invoking API operation {} - args: {}", joinPoint.getSignature().getName(), params); + + Object result = joinPoint.proceed(); + + MDC.put(STATUS, "OK"); + MDC.put(CODE, String.valueOf(httpResponse.getStatus())); + MDC.put(RESPONSE_TIME, getExecutionTime()); + log.info("Successful API operation {} - result: {}", joinPoint.getSignature().getName(), result); + MDC.remove(STATUS); + MDC.remove(CODE); + MDC.remove(RESPONSE_TIME); + MDC.remove(START_TIME); + return result; + } + + /* + @AfterReturning(value = "execution(ErrorResponse *..advice.GlobalExceptionHandler.*(..))", returning = "result") + public void trowingApiInvocation(JoinPoint joinPoint, ErrorResponse result) { + MDC.put(STATUS, "KO"); + MDC.put(CODE, String.valueOf(result.getStatusCode().value())); + MDC.put(RESPONSE_TIME, getExecutionTime()); + MDC.put(FAULT_CODE, result.getTitleMessageCode()); + MDC.put(FAULT_DETAIL, result.getDetailMessageCode()); + log.info("Failed API operation {} - error: {}", MDC.get(METHOD), result); + MDC.clear(); + } + + @AfterReturning(value = "execution(ResponseEntity *..advice.GlobalExceptionHandler.*(..))", returning = "result") + public void trowingApiInvocation(JoinPoint joinPoint, ResponseEntity result) { + MDC.put(STATUS, "KO"); + MDC.put(CODE, String.valueOf(result.getStatusCode().value())); + MDC.put(RESPONSE_TIME, getExecutionTime()); + MDC.put(FAULT_CODE, getTitle(result)); + MDC.put(FAULT_DETAIL, getDetail(result)); + log.info("Failed API operation {} - error: {}", MDC.get(METHOD), result); + MDC.clear(); + }*/ + + @AfterReturning(value = "execution(* *..advice.GlobalExceptionHandler.handleAppException(..)) || execution(* *..advice.GlobalExceptionHandler.handleGenericException(..))", returning = "result") + public void trowingApiInvocation(JoinPoint joinPoint, ErrorResponse result) { + MDC.put(STATUS, "KO"); + MDC.put(CODE, String.valueOf(result.getStatusCode().value())); + MDC.put(RESPONSE_TIME, getExecutionTime()); + MDC.put(FAULT_CODE, result.getTitleMessageCode()); + MDC.put(FAULT_DETAIL, result.getDetailMessageCode()); + log.info("Failed API operation {} - error: {}", MDC.get(METHOD), result); + MDC.clear(); + } + + @AfterReturning(value = "execution(* *..advice.GlobalExceptionHandler.handleExceptionInternal(..))", returning = "result") + public void trowingApiInvocation(JoinPoint joinPoint, ResponseEntity result) { + MDC.put(STATUS, "KO"); + MDC.put(CODE, String.valueOf(result.getStatusCode().value())); + MDC.put(RESPONSE_TIME, getExecutionTime()); + MDC.put(FAULT_CODE, getTitle(result)); + MDC.put(FAULT_DETAIL, getDetail(result)); + log.info("Failed API operation {} - error: {}", MDC.get(METHOD), result); + MDC.clear(); + } + + @Around(value = "repository() || service()") + public Object logTrace(ProceedingJoinPoint joinPoint) throws Throwable { + Map params = getParams(joinPoint); + log.debug("Call method {} - args: {}", joinPoint.getSignature().toShortString(), params); + Object result = joinPoint.proceed(); + log.debug("Return method {} - result: {}", joinPoint.getSignature().toShortString(), result); + return result; + } +} diff --git a/src/main/java/it/gov/pagopa/wispconverter/config/ScheduledJobsConfig.java b/src/main/java/it/gov/pagopa/wispconverter/config/ScheduledJobsConfig.java index 0a1a77c5..0ff79d0a 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/config/ScheduledJobsConfig.java +++ b/src/main/java/it/gov/pagopa/wispconverter/config/ScheduledJobsConfig.java @@ -1,7 +1,8 @@ package it.gov.pagopa.wispconverter.config; import it.gov.pagopa.wispconverter.service.ConfigCacheService; -import lombok.extern.slf4j.Slf4j; + +import org.slf4j.MDC; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.context.annotation.Configuration; @@ -11,8 +12,9 @@ import java.time.ZonedDateTime; +import static it.gov.pagopa.wispconverter.util.SchedulerUtils.*; + @Configuration -@Slf4j @EnableScheduling @ConditionalOnExpression("'${info.properties.environment}'!='test'") public class ScheduledJobsConfig { @@ -26,8 +28,16 @@ public ScheduledJobsConfig(ConfigCacheService configCacheService) { @Scheduled(cron = "${wisp-converter.refresh.cache.cron:-}") @EventListener(ApplicationReadyEvent.class) public void refreshCache() { - log.info("[Scheduled] Starting configuration cache refresh {}", ZonedDateTime.now()); - configCacheService.refreshCache(); + updateMDCForStartExecution("refreshCache", "[Scheduled] Starting configuration cache refresh " + ZonedDateTime.now()); + try { + configCacheService.refreshCache(); + updateMDCForEndExecution(); + } catch (Exception e) { + updateMDCError(e, "refreshCache error"); + throw e; + } + finally { + MDC.clear(); + } } - } diff --git a/src/main/java/it/gov/pagopa/wispconverter/exception/AppErrorCodeMessageEnum.java b/src/main/java/it/gov/pagopa/wispconverter/exception/AppErrorCodeMessageEnum.java index 81049072..f03ddcf7 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/exception/AppErrorCodeMessageEnum.java +++ b/src/main/java/it/gov/pagopa/wispconverter/exception/AppErrorCodeMessageEnum.java @@ -62,7 +62,8 @@ public enum AppErrorCodeMessageEnum { CLIENT_CHECKOUT(3004, "Checkout error", "Error while communicating with Checkout service. {0}", HttpStatus.INTERNAL_SERVER_ERROR, "An error occurred while communicating with Checkout backend internal service in order to send a request about the cart creation. It can be related to any client problem, so the best way to handle this is to use the Technical Support's APIs in order to find the cause."), CLIENT_PAAINVIART(3005, "PaaInviaRT error", "Error while communicating with Station for paaInviaRT service. {0}", HttpStatus.INTERNAL_SERVER_ERROR, "An error occurred while communicating with the creditor institution's station (external service) in order to sending of a paaInviaRT request. It can be related to any client problem, so the best way to handle this is to use the Technical Support's APIs in order to find the cause."), CLIENT_CARTSESSION_CACHING(3006, "Cart caching client error", "Error while communicating with cart caching API. {0}", HttpStatus.INTERNAL_SERVER_ERROR, "An error occurred while communicating with an internal service endpoint dedicated to storing internal cache for handle unique session on cart. It can be related to any client problem, so the best way to handle this is to use the Technical Support's APIs in order to find the cause."), - ; + + UNKNOWN (null, null, null, null, null); private final Integer code; private final String title; diff --git a/src/main/java/it/gov/pagopa/wispconverter/scheduler/RecoveryScheduler.java b/src/main/java/it/gov/pagopa/wispconverter/scheduler/RecoveryScheduler.java index 549f2fce..0cf4553e 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/scheduler/RecoveryScheduler.java +++ b/src/main/java/it/gov/pagopa/wispconverter/scheduler/RecoveryScheduler.java @@ -3,6 +3,8 @@ import it.gov.pagopa.wispconverter.service.RecoveryService; import lombok.Getter; import lombok.extern.slf4j.Slf4j; + +import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; @@ -15,6 +17,8 @@ import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; +import static it.gov.pagopa.wispconverter.util.SchedulerUtils.*; + @Component @Slf4j @ConditionalOnProperty(name = "cron.job.schedule.recovery.enabled", matchIfMissing = false) @@ -40,15 +44,26 @@ public RecoveryScheduler(RecoveryService recoveryService) { @Scheduled(cron = "${cron.job.schedule.recovery.receipt-ko.trigger}") @Async public void recoverReceiptKOCronJob() { - ZonedDateTime dateFrom = ZonedDateTime.now(ZoneOffset.UTC).minusHours(fromHoursAgo); - ZonedDateTime dateTo = ZonedDateTime.now(ZoneOffset.UTC).minusHours(untilHoursAgo); - log.info("[WISP-Recovery][Scheduled] Reconciliation Cron: recoverReceiptKOCronJob running at {}, for recover stale RPT from {} to {}", - DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").format(LocalDateTime.now()), dateFrom, dateTo); + updateMDCForStartExecution("recoverReceiptKOCronJob", "fromHoursAgo="+fromHoursAgo+"; untilHoursAgo="+untilHoursAgo); + try { + ZonedDateTime dateFrom = ZonedDateTime.now(ZoneOffset.UTC).minusHours(fromHoursAgo); + ZonedDateTime dateTo = ZonedDateTime.now(ZoneOffset.UTC).minusHours(untilHoursAgo); + log.debug("[WISP-Recovery][Scheduled] Reconciliation Cron: recoverReceiptKOCronJob running at {}, for recover stale RPT from {} to {}", + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").format(LocalDateTime.now()), dateFrom, dateTo); - int missingRTRecovered = this.recoveryService.recoverReceiptKOByDate(dateFrom, dateTo).getPayments().size(); - int missingRedirectRecovered = this.recoveryService.recoverMissingRedirect(dateFrom, dateTo); + int missingRTRecovered = this.recoveryService.recoverReceiptKOByDate(dateFrom, dateTo).getPayments().size(); + int missingRedirectRecovered = this.recoveryService.recoverMissingRedirect(dateFrom, dateTo); - log.info("[WISP-Recovery][Scheduled] Reconciliation Cron: recoverReceiptKOCronJob {} receipt-ko sent", missingRedirectRecovered + missingRTRecovered); - this.threadOfExecution = Thread.currentThread(); + log.debug("[WISP-Recovery][Scheduled] Reconciliation Cron: recoverReceiptKOCronJob {} receipt-ko sent", missingRedirectRecovered + missingRTRecovered); + this.threadOfExecution = Thread.currentThread(); + updateMDCForEndExecution(); + } + catch (Exception e) { + updateMDCError(e, "recoverReceiptKOCronJob error"); + throw e; + } + finally { + MDC.clear(); + } } } diff --git a/src/main/java/it/gov/pagopa/wispconverter/servicebus/ECommerceHangTimeoutConsumer.java b/src/main/java/it/gov/pagopa/wispconverter/servicebus/ECommerceHangTimeoutConsumer.java index d1d9d34b..07f4e189 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/servicebus/ECommerceHangTimeoutConsumer.java +++ b/src/main/java/it/gov/pagopa/wispconverter/servicebus/ECommerceHangTimeoutConsumer.java @@ -24,6 +24,8 @@ import java.time.ZonedDateTime; import java.util.List; +import static it.gov.pagopa.wispconverter.util.SchedulerUtils.*; + /** * This class is the consumer of the queue 'ecommerce-hang-timeout' of the service bus. * When a schedule message trigger this class we'll expire the payment, @@ -56,7 +58,7 @@ public void post() { @EventListener(ApplicationReadyEvent.class) public void initializeClient() { if (receiverClient != null) { - log.info("[Scheduled] Starting ECommerceHangTimeoutConsumer {}", ZonedDateTime.now()); + updateMDCForStartExecution("initializeClient", "[Scheduled] Starting ECommerceHangTimeoutConsumer "+ ZonedDateTime.now()); receiverClient.start(); } } @@ -81,8 +83,9 @@ public void processMessage(ServiceBusReceivedMessageContext context) { .build()); receiptService.sendKoPaaInviaRtToCreditorInstitution(inputPaaInviaRTKo); } catch (IOException e) { - log.error("Error when read ECommerceHangTimeoutDto value from message: '{}'. Body: '{}'", message.getMessageId(), message.getBody()); + updateMDCError(e, "Error when read ECommerceHangTimeoutDto value from message: '"+message.getMessageId()+"'. Body: '"+message.getBody()+"'"); } + updateMDCForEndExecution(); MDC.clear(); } diff --git a/src/main/java/it/gov/pagopa/wispconverter/servicebus/PaymentTimeoutConsumer.java b/src/main/java/it/gov/pagopa/wispconverter/servicebus/PaymentTimeoutConsumer.java index 8dca304b..44d554d1 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/servicebus/PaymentTimeoutConsumer.java +++ b/src/main/java/it/gov/pagopa/wispconverter/servicebus/PaymentTimeoutConsumer.java @@ -23,6 +23,8 @@ import java.time.ZonedDateTime; import java.util.List; +import static it.gov.pagopa.wispconverter.util.SchedulerUtils.*; + @Slf4j @Component public class PaymentTimeoutConsumer extends SBConsumer { @@ -38,7 +40,7 @@ public class PaymentTimeoutConsumer extends SBConsumer { @EventListener(ApplicationReadyEvent.class) public void initializeClient() { if (receiverClient != null) { - log.info("[Scheduled] Starting PaymentTimeoutConsumer {}", ZonedDateTime.now()); + updateMDCForStartExecution("initializeClient", "[Scheduled] Starting PaymentTimeoutConsumer " + ZonedDateTime.now()); receiverClient.start(); } } @@ -63,9 +65,9 @@ public void processMessage(ServiceBusReceivedMessageContext context) { String inputPaaInviaRTKo = List.of(receiptDto).toString(); receiptService.sendKoPaaInviaRtToCreditorInstitution(inputPaaInviaRTKo); } catch (IOException e) { - log.error("Error when read ReceiptDto value from message: '{}'. Body: '{}'", - message.getMessageId(), message.getBody()); + updateMDCError(e, "Error when read ReceiptDto value from message: '"+message.getMessageId()+"'. Body: '"+message.getBody()+"'"); } + updateMDCForEndExecution(); MDC.clear(); } diff --git a/src/main/java/it/gov/pagopa/wispconverter/servicebus/RPTTimeoutConsumer.java b/src/main/java/it/gov/pagopa/wispconverter/servicebus/RPTTimeoutConsumer.java index 2b37ca76..5bdb9c52 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/servicebus/RPTTimeoutConsumer.java +++ b/src/main/java/it/gov/pagopa/wispconverter/servicebus/RPTTimeoutConsumer.java @@ -5,9 +5,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import it.gov.pagopa.wispconverter.controller.model.RPTTimerRequest; import it.gov.pagopa.wispconverter.repository.model.enumz.InternalStepStatus; -import it.gov.pagopa.wispconverter.service.ConfigCacheService; -import it.gov.pagopa.wispconverter.service.IdempotencyService; -import it.gov.pagopa.wispconverter.service.PaaInviaRTSenderService; import it.gov.pagopa.wispconverter.service.ReceiptService; import it.gov.pagopa.wispconverter.util.CommonUtility; import it.gov.pagopa.wispconverter.util.MDCUtil; @@ -21,6 +18,11 @@ import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; + +import static it.gov.pagopa.wispconverter.util.SchedulerUtils.updateMDCError; +import static it.gov.pagopa.wispconverter.util.SchedulerUtils.updateMDCForEndExecution; +import static it.gov.pagopa.wispconverter.util.SchedulerUtils.updateMDCForStartExecution; + import java.io.IOException; import java.time.ZonedDateTime; @@ -50,18 +52,6 @@ public class RPTTimeoutConsumer extends SBConsumer { @Autowired private ReceiptService receiptService; - @Autowired - private PaaInviaRTSenderService paaInviaRTSenderService; - - @Autowired - private ConfigCacheService configCacheService; - - @Autowired - private IdempotencyService idempotencyService; - - @Autowired - private it.gov.pagopa.gen.wispconverter.client.decouplercaching.invoker.ApiClient decouplerCachingClient; - @PostConstruct public void post() { @@ -74,7 +64,7 @@ public void post() { @EventListener(ApplicationReadyEvent.class) public void initializeClient() { if (receiverClient != null) { - log.info("[Scheduled] Starting RPTTimeoutConsumer {}", ZonedDateTime.now()); + updateMDCForStartExecution("initializeClient", "[Scheduled] Starting RPTTimeoutConsumer " + ZonedDateTime.now()); receiverClient.start(); } } @@ -90,8 +80,9 @@ public void processMessage(ServiceBusReceivedMessageContext context) { // sending rt- from session id receiptService.sendRTKoFromSessionId(timeoutMessage.getSessionId(), InternalStepStatus.RPT_TIMER_TRIGGER); } catch (IOException e) { - log.error("Error when read rpt timer request value from message: '{}'. Body: '{}'", message.getMessageId(), message.getBody()); + updateMDCError(e, "Error when read rpt timer request value from message: '"+message.getMessageId()+"'. Body: '"+message.getBody()+"'"); } + updateMDCForEndExecution(); MDC.clear(); } } \ No newline at end of file diff --git a/src/main/java/it/gov/pagopa/wispconverter/servicebus/RTConsumer.java b/src/main/java/it/gov/pagopa/wispconverter/servicebus/RTConsumer.java index 5108b514..bc892f31 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/servicebus/RTConsumer.java +++ b/src/main/java/it/gov/pagopa/wispconverter/servicebus/RTConsumer.java @@ -15,6 +15,7 @@ import jakarta.xml.soap.SOAPMessage; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.event.ApplicationReadyEvent; @@ -23,6 +24,11 @@ import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; + +import static it.gov.pagopa.wispconverter.util.SchedulerUtils.updateMDCError; +import static it.gov.pagopa.wispconverter.util.SchedulerUtils.updateMDCForEndExecution; +import static it.gov.pagopa.wispconverter.util.SchedulerUtils.updateMDCForStartExecution; + import java.io.IOException; import java.net.InetSocketAddress; import java.net.URI; @@ -66,7 +72,7 @@ public class RTConsumer extends SBConsumer { @EventListener(ApplicationReadyEvent.class) public void initializeClient() { if (receiverClient != null) { - log.info("[Scheduled] Starting RTConsumer {}", ZonedDateTime.now()); + updateMDCForStartExecution("initializeClient", "[Scheduled] Starting RTConsumer " + ZonedDateTime.now()); receiverClient.start(); } } @@ -126,6 +132,7 @@ public void processMessage(ServiceBusReceivedMessageContext context) { } catch (Exception e) { + updateMDCError(e, "RTConsumer error: Re-scheduled send operation"); // Generate a new event in RE for store the unsuccessful re-sending of the receipt generateREForNotSentRT(e); @@ -139,6 +146,9 @@ public void processMessage(ServiceBusReceivedMessageContext context) { log.error("AppException: ", e); } } + + updateMDCForEndExecution(); + MDC.clear(); } private boolean resendRTToCreditorInstitution(String receiptId, RTRequestEntity receipt, String compositedIdForReceipt, String idempotencyKey) { @@ -185,6 +195,8 @@ private boolean resendRTToCreditorInstitution(String receiptId, RTRequestEntity isSend = true; } catch (AppException e) { + + updateMDCError(e, e.getError().getTitle()); // generate a new event in RE for store the unsuccessful re-sending of the receipt generateREForNotSentRT(e); @@ -193,6 +205,8 @@ private boolean resendRTToCreditorInstitution(String receiptId, RTRequestEntity reScheduleReceiptSend(receipt, receiptId, compositedIdForReceipt); } catch (IOException e) { + + updateMDCError(e, "RTConsumer error"); rtReceiptCosmosService.updateReceiptStatus(ci, iuv, ccp, ReceiptStatusEnum.NOT_SENT); @@ -235,7 +249,7 @@ private void reScheduleReceiptSend(RTRequestEntity receipt, String receiptId, St rtReceiptCosmosService.updateReceiptStatus(ci, iuv, ccp, ReceiptStatusEnum.SCHEDULED); } catch (Exception e) { - + updateMDCError(e, "RTConsumer error"); // generate a new event in RE for store the unsuccessful scheduling of the RT send generateREForFailedReschedulingSentRT(e); rtReceiptCosmosService.updateReceiptStatus(ci, iuv, ccp, ReceiptStatusEnum.NOT_SENT); diff --git a/src/main/java/it/gov/pagopa/wispconverter/util/SchedulerUtils.java b/src/main/java/it/gov/pagopa/wispconverter/util/SchedulerUtils.java new file mode 100644 index 00000000..e798bcb6 --- /dev/null +++ b/src/main/java/it/gov/pagopa/wispconverter/util/SchedulerUtils.java @@ -0,0 +1,39 @@ +package it.gov.pagopa.wispconverter.util; + +import lombok.experimental.UtilityClass; +import lombok.extern.slf4j.Slf4j; +import org.slf4j.MDC; + +import java.util.Calendar; +import java.util.UUID; + +import static it.gov.pagopa.wispconverter.config.LoggingAspect.*; + +@Slf4j +@UtilityClass +public class SchedulerUtils { + + public static void updateMDCForStartExecution(String method, String args) { + MDC.put(METHOD, method); + MDC.put(START_TIME, String.valueOf(Calendar.getInstance().getTimeInMillis())); + MDC.put(REQUEST_ID, UUID.randomUUID().toString()); + MDC.put(OPERATION_ID, UUID.randomUUID().toString()); + MDC.put(ARGS, args); + } + + public static void updateMDCForEndExecution() { + MDC.put(STATUS, "OK"); + MDC.put(CODE, "201"); + MDC.put(RESPONSE_TIME, getExecutionTime()); + log.info("Scheduled job finished successfully"); + } + + public static void updateMDCError(Exception e, String error) { + MDC.put(STATUS, "KO"); + MDC.put(CODE, "500"); + MDC.put(RESPONSE_TIME, getExecutionTime()); + MDC.put(FAULT_CODE, error); + MDC.put(FAULT_DETAIL, e.getMessage()); + log.info("An error occurring during a scheduled job"); + } +} From 0655e059af8c7fc494e472b5409af1efb060a79f Mon Sep 17 00:00:00 2001 From: Jacopo Carlini Date: Wed, 16 Oct 2024 12:43:51 +0200 Subject: [PATCH 07/20] Delete .classpath --- .classpath | 57 ------------------------------------------------------ 1 file changed, 57 deletions(-) delete mode 100644 .classpath diff --git a/.classpath b/.classpath deleted file mode 100644 index 845a620f..00000000 --- a/.classpath +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 3e09e5885f4e13e9789bbfece31791d7ae6eb432 Mon Sep 17 00:00:00 2001 From: aacitelli Date: Wed, 16 Oct 2024 16:26:46 +0200 Subject: [PATCH 08/20] [PAGOPA-2221] removed useless property --- src/main/resources/application.properties | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 8fb073a8..8d2d825c 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -37,8 +37,6 @@ logging.level.com.azure.core.amqp=${APP_LOGGING_TRACING_LEVEL:ERROR} logging.level.com.azure.spring=${APP_LOGGING_TRACING_LEVEL:ERROR} logging.level.com.azure.messaging.servicebus=${APP_LOGGING_TRACING_LEVEL:ERROR} -otel.service.name=${OTEL_SERVICE_NAME:pagopa-wisp-converter} - # CORS configuration cors.configuration=${CORS_CONFIGURATION:{"origins": ["*"], "methods": ["*"]}} From b7d6cb0619b2a515759be4ee8b72c6300f1aa332 Mon Sep 17 00:00:00 2001 From: aacitelli Date: Wed, 16 Oct 2024 16:26:46 +0200 Subject: [PATCH 09/20] [PAGOPA-2221] removed sanitization from some data --- .../wispconverter/controller/RPTTimerController.java | 2 +- .../wispconverter/controller/ReceiptController.java | 2 +- .../wispconverter/controller/ReceiptTimerController.java | 2 +- .../wispconverter/controller/RecoveryController.java | 8 ++++---- .../gov/pagopa/wispconverter/service/RPTTimerService.java | 4 ++-- src/main/resources/application.properties | 2 -- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/RPTTimerController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/RPTTimerController.java index c9c72462..12f48816 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/RPTTimerController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/RPTTimerController.java @@ -51,7 +51,7 @@ public class RPTTimerController { @Trace(businessProcess = RPT_BP_TIMER_SET, reEnabled = true) public void createTimer(@RequestBody RPTTimerRequest request) { try { - log.debug("Invoking API operation createRPTTimer - args: {}", sanitizeInput(request.toString())); + log.debug("Invoking API operation createRPTTimer - args: {}", request.toString()); rptTimerService.sendMessage(request); log.debug("Successful API operation createRPTTimer"); } catch (Exception ex) { diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java index d74cd8f1..670bfa3d 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java @@ -106,7 +106,7 @@ public ResponseEntity receiptRetrieve(@QueryParam("ci") String ci, @Quer public void receiptKo(@RequestBody String request) throws Exception { try { - log.debug("Invoking API operation receiptKo - args: {}", sanitizeInput(request)); + log.debug("Invoking API operation receiptKo - args: {}", request); receiptService.sendKoPaaInviaRtToCreditorInstitution(List.of(mapper.readValue(request, ReceiptDto.class)).toString()); log.debug("Successful API operation receiptKo"); } catch (Exception ex) { diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java index c919c921..e953f447 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java @@ -54,7 +54,7 @@ public class ReceiptTimerController { @Trace(businessProcess = BP_TIMER_SET, reEnabled = true) public void createTimer(@RequestBody ReceiptTimerRequest request) { try { - log.debug("Invoking API operation createTimer - args: {}", sanitizeInput(request.toString())); + log.debug("Invoking API operation createTimer - args: {}", request.toString()); receiptTimerService.sendMessage(request); log.debug("Successful API operation createTimer"); } catch (Exception ex) { diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java index e6e3dc9c..7eed6c60 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java @@ -46,7 +46,7 @@ public class RecoveryController { public ResponseEntity recoverReceiptKOForCreditorInstitution(@PathVariable("creditor_institution") String ci, @QueryParam("date_from") String dateFrom, @QueryParam("date_to") String dateTo) { try { log.debug("Invoking API operation recoverReceiptKOForCreditorInstitution - args: {} {} {}", - sanitizeInput(ci), sanitizeInput(dateFrom), sanitizeInput(dateTo)); + sanitizeInput(ci), dateFrom, dateTo); RecoveryReceiptResponse response = recoveryService.recoverReceiptKOByCI(ci, dateFrom, dateTo); return ResponseEntity.ok(response); } catch (Exception ex) { @@ -74,7 +74,7 @@ public ResponseEntity recoverReceiptKOForCreditorInstit @Pattern(regexp = "[a-zA-Z0-9_-]{1,10}") @QueryParam("date_to") String dateTo) { try { log.debug("Invoking API operation recoverReceiptKOForCreditorInstitution - args: {} {} {} {}", - sanitizeInput(ci), sanitizeInput(iuv), sanitizeInput(dateFrom), sanitizeInput(dateTo)); + sanitizeInput(ci), sanitizeInput(iuv), dateFrom, dateTo); RecoveryReceiptResponse recoveryReceiptResponse = recoveryService.recoverReceiptKOByIUV(ci, iuv, dateFrom, dateTo); if(recoveryReceiptResponse != null) { @@ -102,7 +102,7 @@ public ResponseEntity recoverReceiptKOForCreditorInstit @PostMapping(value = "/receipts") public ResponseEntity recoverReceiptToBeReSent(@RequestBody RecoveryReceiptRequest request) { try { - log.debug("Invoking API operation recoverReceiptToBeReSent - args: {}", sanitizeInput(request.toString())); + log.debug("Invoking API operation recoverReceiptToBeReSent - args: {}", request.toString()); return ResponseEntity.ok(recoveryService.recoverReceiptToBeReSent(request)); } catch (Exception ex) { String operationId = MDC.get(Constants.MDC_OPERATION_ID); @@ -121,7 +121,7 @@ public ResponseEntity recoverReceiptToBeReSent(@R @PostMapping(value = "/partitions") public ResponseEntity recoverReceiptToBeReSentByPartition(@RequestBody RecoveryReceiptByPartitionRequest request) { try { - log.info("Invoking API operation recoverReceiptToBeReSentByPartition - args: {}", sanitizeInput(request.toString())); + log.info("Invoking API operation recoverReceiptToBeReSentByPartition - args: {}", request.toString()); return ResponseEntity.ok(recoveryService.recoverReceiptToBeReSentByPartition(request)); } catch (Exception ex) { String operationId = MDC.get(Constants.MDC_OPERATION_ID); diff --git a/src/main/java/it/gov/pagopa/wispconverter/service/RPTTimerService.java b/src/main/java/it/gov/pagopa/wispconverter/service/RPTTimerService.java index 4687edea..1eaaf521 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/service/RPTTimerService.java +++ b/src/main/java/it/gov/pagopa/wispconverter/service/RPTTimerService.java @@ -91,14 +91,14 @@ public void sendMessage(RPTTimerRequest message) { // build the service bus message ServiceBusMessage serviceBusMessage = new ServiceBusMessage(message.toString()); - log.debug("Sending scheduled message {} to the queue: {}", sanitizeInput(message.toString()), queueName); + log.debug("Sending scheduled message {} to the queue: {}", message.toString(), queueName); // compute time and schedule message for consumer trigger OffsetDateTime scheduledExpirationTime = OffsetDateTime.now().plusSeconds(expirationTime); Long sequenceNumber = serviceBusSenderClient.scheduleMessage(serviceBusMessage, scheduledExpirationTime); // log event - log.debug("Sent scheduled message_base64 {} to the queue: {}", LogUtils.encodeToBase64(sanitizeInput(message.toString())), queueName); + log.debug("Sent scheduled message_base64 {} to the queue: {}", LogUtils.encodeToBase64(message.toString()), queueName); generateRE(InternalStepStatus.RPT_TIMER_CREATED, "Scheduled RPTTimerService: [" + message + "]"); // insert in Redis cache sequenceNumber of the message diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 8fb073a8..8d2d825c 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -37,8 +37,6 @@ logging.level.com.azure.core.amqp=${APP_LOGGING_TRACING_LEVEL:ERROR} logging.level.com.azure.spring=${APP_LOGGING_TRACING_LEVEL:ERROR} logging.level.com.azure.messaging.servicebus=${APP_LOGGING_TRACING_LEVEL:ERROR} -otel.service.name=${OTEL_SERVICE_NAME:pagopa-wisp-converter} - # CORS configuration cors.configuration=${CORS_CONFIGURATION:{"origins": ["*"], "methods": ["*"]}} From 34b88a5eac72d3da7dec414701dbe73337c50377 Mon Sep 17 00:00:00 2001 From: Jacopo Carlini Date: Thu, 17 Oct 2024 16:35:43 +0200 Subject: [PATCH 10/20] [PAGOPA-2221] chore(sampling): custom sampling --- .classpath | 57 ------------------- docker/applicationinsights.json | 45 +++++++++++++++ docker/docker-compose.yml | 2 +- docker/run_docker.sh | 44 +++++++------- pom.xml | 7 +++ .../wispconverter/config/LoggingAspect.java | 2 +- .../controller/RPTTimerController.java | 8 +-- .../controller/ReceiptController.java | 6 +- .../controller/ReceiptTimerController.java | 4 +- .../controller/RecoveryController.java | 6 +- .../controller/RedirectController.java | 2 +- 11 files changed, 89 insertions(+), 94 deletions(-) delete mode 100644 .classpath create mode 100644 docker/applicationinsights.json diff --git a/.classpath b/.classpath deleted file mode 100644 index 845a620f..00000000 --- a/.classpath +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docker/applicationinsights.json b/docker/applicationinsights.json new file mode 100644 index 00000000..d4c30dc1 --- /dev/null +++ b/docker/applicationinsights.json @@ -0,0 +1,45 @@ +{ + "selfDiagnostics": { + "destination": "console", + "level": "INFO" + }, + "sampling": { + "percentage": 5, + "overrides": [ + { + "telemetryType": "dependency", + "percentage": 5 + }, + { + "telemetryType": "trace", + "attributes": [ + { + "key": "message", + "value": "Invoking API operation.*", + "matchType": "regexp" + } + ], + "percentage": 100 + }, + { + "telemetryType": "trace", + "attributes": [ + { + "key": "message", + "value": "^(?!Invoking API operation).*", + "matchType": "regexp" + } + ], + "percentage": 5 + }, + { + "telemetryType": "exception", + "percentage": 100 + }, + { + "telemetryType": "request", + "percentage": 100 + } + ] + } +} \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index d119b755..77669381 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.8' services: app: - container_name: 'service' # TODO + container_name: 'wisp-converter' image: ${image} platform: linux/amd64 build: diff --git a/docker/run_docker.sh b/docker/run_docker.sh index 8ecfd9ac..27db20b5 100755 --- a/docker/run_docker.sh +++ b/docker/run_docker.sh @@ -20,28 +20,28 @@ else image="${repository}:latest" fi export image=${image} - -FILE=.env -if test -f "$FILE"; then - rm .env -fi -config=$(yq -r '."microservice-chart".envConfig' ../helm/values-$ENV.yaml) -IFS=$'\n' -for line in $(echo "$config" | yq -r '. | to_entries[] | select(.key) | "\(.key)=\(.value)"'); do - echo "$line" >> .env -done - -keyvault=$(yq -r '."microservice-chart".keyvault.name' ../helm/values-$ENV.yaml) -secret=$(yq -r '."microservice-chart".envSecret' ../helm/values-$ENV.yaml) -for line in $(echo "$secret" | yq -r '. | to_entries[] | select(.key) | "\(.key)=\(.value)"'); do - IFS='=' read -r -a array <<< "$line" - response=$(az keyvault secret show --vault-name $keyvault --name "${array[1]}") - response=$(echo "$response" | tr -d '\n') - value=$(echo "$response" | yq -r '.value') - value=$(echo "$value" | sed 's/\$/\$\$/g') - value=$(echo "$value" | tr -d '\n') - echo "${array[0]}=$value" >> .env -done +# +#FILE=.env +#if test -f "$FILE"; then +# rm .env +#fi +#config=$(yq -r '."microservice-chart".envConfig' ../helm/values-$ENV.yaml) +#IFS=$'\n' +#for line in $(echo "$config" | yq -r '. | to_entries[] | select(.key) | "\(.key)=\(.value)"'); do +# echo "$line" >> .env +#done +# +#keyvault=$(yq -r '."microservice-chart".keyvault.name' ../helm/values-$ENV.yaml) +#secret=$(yq -r '."microservice-chart".envSecret' ../helm/values-$ENV.yaml) +#for line in $(echo "$secret" | yq -r '. | to_entries[] | select(.key) | "\(.key)=\(.value)"'); do +# IFS='=' read -r -a array <<< "$line" +# response=$(az keyvault secret show --vault-name $keyvault --name "${array[1]}") +# response=$(echo "$response" | tr -d '\n') +# value=$(echo "$response" | yq -r '.value') +# value=$(echo "$value" | sed 's/\$/\$\$/g') +# value=$(echo "$value" | tr -d '\n') +# echo "${array[0]}=$value" >> .env +#done stack_name=$(cd .. && basename "$PWD") diff --git a/pom.xml b/pom.xml index eb62f32d..72e2131b 100644 --- a/pom.xml +++ b/pom.xml @@ -80,6 +80,13 @@ spring-aspects + + com.microsoft.azure + applicationinsights-core + 3.6.1 + + + org.springframework.boot diff --git a/src/main/java/it/gov/pagopa/wispconverter/config/LoggingAspect.java b/src/main/java/it/gov/pagopa/wispconverter/config/LoggingAspect.java index afcda673..726ea29f 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/config/LoggingAspect.java +++ b/src/main/java/it/gov/pagopa/wispconverter/config/LoggingAspect.java @@ -144,7 +144,7 @@ public Object logApiInvocation(ProceedingJoinPoint joinPoint) throws Throwable { Map params = getParams(joinPoint); MDC.put(ARGS, params.toString()); - log.debug("Invoking API operation {} - args: {}", joinPoint.getSignature().getName(), params); + log.info("Invoking API operation {} - args: {}", joinPoint.getSignature().getName(), params); Object result = joinPoint.proceed(); diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/RPTTimerController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/RPTTimerController.java index 12f48816..1b9cbad4 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/RPTTimerController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/RPTTimerController.java @@ -1,5 +1,7 @@ package it.gov.pagopa.wispconverter.controller; +import static it.gov.pagopa.wispconverter.util.CommonUtility.sanitizeInput; + import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; @@ -22,8 +24,6 @@ import org.springframework.web.ErrorResponse; import org.springframework.web.bind.annotation.*; -import static it.gov.pagopa.wispconverter.util.CommonUtility.sanitizeInput; - @RestController @RequestMapping("/rpt") @Validated @@ -51,7 +51,7 @@ public class RPTTimerController { @Trace(businessProcess = RPT_BP_TIMER_SET, reEnabled = true) public void createTimer(@RequestBody RPTTimerRequest request) { try { - log.debug("Invoking API operation createRPTTimer - args: {}", request.toString()); + log.info("Invoking API operation createRPTTimer - args: {}", request.toString()); rptTimerService.sendMessage(request); log.debug("Successful API operation createRPTTimer"); } catch (Exception ex) { @@ -77,7 +77,7 @@ public void createTimer(@RequestBody RPTTimerRequest request) { @Trace(businessProcess = RPT_BP_TIMER_DELETE, reEnabled = true) public void deleteTimer(@RequestParam() String sessionId) { try { - log.debug("Invoking API operation deleteRPTTimer - args: {}", sanitizeInput(sessionId)); + log.info("Invoking API operation deleteRPTTimer - args: {}", sanitizeInput(sessionId)); rptTimerService.cancelScheduledMessage(sessionId); log.debug("Successful API operation deleteRPTTimer"); } catch (Exception ex) { diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java index 670bfa3d..2c123ce6 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java @@ -76,7 +76,7 @@ public class ReceiptController { @Trace(businessProcess = BP_RECEIPT_RETRIEVE, reEnabled = true) public ResponseEntity receiptRetrieve(@QueryParam("ci") String ci, @QueryParam("ccp") String ccp, @QueryParam("iuv") String iuv) { try { - log.debug("Invoking API operation receiptRetrieve - ci: {}, ccp: {}, iuv: {}", sanitizeInput(ci), sanitizeInput(ccp), sanitizeInput(iuv)); + log.info("Invoking API operation receiptRetrieve - ci: {}, ccp: {}, iuv: {}", sanitizeInput(ci), sanitizeInput(ccp), sanitizeInput(iuv)); if(rtReceiptCosmosService.receiptRtExist(ci, iuv, ccp)) return ResponseEntity.ok(""); else return ResponseEntity.notFound().build(); @@ -106,7 +106,7 @@ public ResponseEntity receiptRetrieve(@QueryParam("ci") String ci, @Quer public void receiptKo(@RequestBody String request) throws Exception { try { - log.debug("Invoking API operation receiptKo - args: {}", request); + log.info("Invoking API operation receiptKo - args: {}", request); receiptService.sendKoPaaInviaRtToCreditorInstitution(List.of(mapper.readValue(request, ReceiptDto.class)).toString()); log.debug("Successful API operation receiptKo"); } catch (Exception ex) { @@ -133,7 +133,7 @@ public void receiptKo(@RequestBody String request) throws Exception { public void receiptOk(@RequestBody ReceiptRequest request) throws IOException { try { - log.debug("Invoking API operation receiptOk - args: {}", this.getReceiptRequestInfoToLog(request.getContent())); + log.info("Invoking API operation receiptOk - args: {}", this.getReceiptRequestInfoToLog(request.getContent())); receiptService.sendOkPaaInviaRtToCreditorInstitution(request.getContent()); log.debug("Successful API operation receiptOk"); } catch (Exception ex) { diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java index e953f447..b0e3f29c 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java @@ -54,7 +54,7 @@ public class ReceiptTimerController { @Trace(businessProcess = BP_TIMER_SET, reEnabled = true) public void createTimer(@RequestBody ReceiptTimerRequest request) { try { - log.debug("Invoking API operation createTimer - args: {}", request.toString()); + log.info("Invoking API operation createTimer - args: {}", request.toString()); receiptTimerService.sendMessage(request); log.debug("Successful API operation createTimer"); } catch (Exception ex) { @@ -79,7 +79,7 @@ public void createTimer(@RequestBody ReceiptTimerRequest request) { @Trace(businessProcess = BP_TIMER_DELETE, reEnabled = true) public void deleteTimer(@RequestParam() String paymentTokens) { try { - log.debug("Invoking API operation deleteTimer - args: {}", sanitizeInput(paymentTokens)); + log.info("Invoking API operation deleteTimer - args: {}", sanitizeInput(paymentTokens)); List tokens = Arrays.asList(paymentTokens.split(",")); receiptTimerService.cancelScheduledMessage(tokens); log.debug("Successful API operation deleteTimer"); diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java index 7eed6c60..4240812b 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java @@ -45,7 +45,7 @@ public class RecoveryController { @PostMapping(value = "/{creditor_institution}/receipt-ko") public ResponseEntity recoverReceiptKOForCreditorInstitution(@PathVariable("creditor_institution") String ci, @QueryParam("date_from") String dateFrom, @QueryParam("date_to") String dateTo) { try { - log.debug("Invoking API operation recoverReceiptKOForCreditorInstitution - args: {} {} {}", + log.info("Invoking API operation recoverReceiptKOForCreditorInstitution - args: {} {} {}", sanitizeInput(ci), dateFrom, dateTo); RecoveryReceiptResponse response = recoveryService.recoverReceiptKOByCI(ci, dateFrom, dateTo); return ResponseEntity.ok(response); @@ -73,7 +73,7 @@ public ResponseEntity recoverReceiptKOForCreditorInstit @Pattern(regexp = "[a-zA-Z0-9_-]{1,10}") @QueryParam("date_from") String dateFrom, @Pattern(regexp = "[a-zA-Z0-9_-]{1,10}") @QueryParam("date_to") String dateTo) { try { - log.debug("Invoking API operation recoverReceiptKOForCreditorInstitution - args: {} {} {} {}", + log.info("Invoking API operation recoverReceiptKOForCreditorInstitution - args: {} {} {} {}", sanitizeInput(ci), sanitizeInput(iuv), dateFrom, dateTo); RecoveryReceiptResponse recoveryReceiptResponse = recoveryService.recoverReceiptKOByIUV(ci, iuv, dateFrom, dateTo); @@ -102,7 +102,7 @@ public ResponseEntity recoverReceiptKOForCreditorInstit @PostMapping(value = "/receipts") public ResponseEntity recoverReceiptToBeReSent(@RequestBody RecoveryReceiptRequest request) { try { - log.debug("Invoking API operation recoverReceiptToBeReSent - args: {}", request.toString()); + log.info("Invoking API operation recoverReceiptToBeReSent - args: {}", request.toString()); return ResponseEntity.ok(recoveryService.recoverReceiptToBeReSent(request)); } catch (Exception ex) { String operationId = MDC.get(Constants.MDC_OPERATION_ID); diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/RedirectController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/RedirectController.java index 0b4c5194..3a4ab679 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/RedirectController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/RedirectController.java @@ -53,7 +53,7 @@ public String redirect(@Parameter(description = "", example = "identificativoInt @RequestParam("idSession") String idSession, HttpServletResponse response) { try { - log.debug("Invoking API operation redirect - args: {}", idSession.matches("[\\w\\-]*") ? idSession : "..."); + log.info("Invoking API operation redirect - args: {}", idSession.matches("[\\w\\-]*") ? idSession : "..."); String redirectURI = converterService.convert(idSession); log.debug("Successful API operation redirect - result: {}", redirectURI); return "redirect:" + redirectURI; From 061749c4b565cf605a6aef1e89b2a35f03e9c755 Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Thu, 17 Oct 2024 14:38:28 +0000 Subject: [PATCH 11/20] Bump to version 0.4.11-1-PAGOPA-2221 [skip ci] --- helm/Chart.yaml | 4 ++-- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- openapi/openapi.json | 2 +- openapi/openapi_redirect.json | 2 +- pom.xml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 51753b79..3adfe0f4 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-wisp-converter description: A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, interfacing them with GPD system type: application -version: 0.240.0 -appVersion: 0.4.11 +version: 0.241.0 +appVersion: 0.4.11-1-PAGOPA-2221 dependencies: - name: microservice-chart version: 3.0.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 391775e6..295e6b14 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "0.4.11" + tag: "0.4.11-1-PAGOPA-2221" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index d072b5b3..710c5a4c 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "0.4.11" + tag: "0.4.11-1-PAGOPA-2221" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 030bc536..c3120d9b 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "0.4.11" + tag: "0.4.11-1-PAGOPA-2221" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi/openapi.json b/openapi/openapi.json index 2d4604c3..42dc7c21 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "description": "A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, converting them in NMU payments.\n\n# OPERATIVE INFO\n\n\n## EVENT MAPPING IN RE\n\n
Details\nFIELD | SCOPE | DESCRIPTION\n- | - | -\n**requestId** | BOTH | The identifier, set by X-Request-ID, from which the events can be grouped.\n**operationId** | BOTH | The identifier associated to a request identifier\n**clientOperationId** | BOTH | The identifier that associate a client to an operation identifier.\n**component** | BOTH | The applicative component from which the event is generated.
In NDP it is mapped with field 'componente'.
Values:
_WISP_SOAP_CONVERTER_
_WISP_CONVERTER_\n**insertedTimestamp** | BOTH | The time on which the event is inserted in RE storage\n**eventCategory** | BOTH | The category on which the event can be grouped.
In NDP it is mapped with field 'categoriaEvento'.
Values:
_INTERFACE_
_INTERNAL_\n**eventSubcategory** | BOTH | The subcategory related to the specific nature of the event.
In NDP it is mapped with field 'sottoTipoEvento'.
Values:
_REQ_
_RESP_
_INTERN_\n**callType** | INTERFACE | The type of role that the application has in the communication with the remote endpoint.
Values:
_SERVER_
_CLIENT_\n**outcome** | INTERFACE | The outcome of the operation described by the event.
In NDP it is mapped with field 'esito'.
Values:
_SEND_: Correctly sent request to HTTP endpoint. In NDP it is mapped with value 'INVIATA'.
_SEND_FAILURE_: Failed to send request to HTTP endpoint. In NDP it is mapped with value 'INVIATA_KO'
_RECEIVED_: Received an OK response from HTTP endpoint. In NDP it is mapped with value 'RICEVUTA_KO'
_RECEIVED_FAILURE_: Received a failure response from endpoint. In NDP it is mapped with value 'RICEVUTA_KO'
_NEVER_RECEIVED_: Failed to receive response at all from endpoint. In NDP it is mapped with value 'NO_RICEVUTA'
_EXECUTED_INTERNAL_STEP_: Executed internal step on execution. In NDP it is mapped with value 'CAMBIO_STATO'\n**httpMethod** | INTERFACE | The HTTP method of the endpoint related to the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpUri** | INTERFACE | The URI related to the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpHeaders** | INTERFACE | The list of HTTP headers extracted from the request/response analyzed by the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpCallRemoteAddress** | INTERFACE | The remote IP address extracted from the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpStatusCode** | INTERFACE | The status code extracted from the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**executionTimeMs** | INTERFACE | The duration time of the invocation of the endpoint related to the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**compressedPayload** | INTERFACE | The payload of the request/response analyzed by the event.
This value is zipped using GZip compression algorithm.\n**compressedPayloadLength** | INTERFACE | The length (in number of characters) of the compressed payload.\n**businessProcess** | INTERFACE | The descriptive label associated to the endpoint called by user and related to the whole process.\n**operationStatus** | INTERFACE | The final status of the whole operation.
This is set only in the events that describe the response in output to user.\n**operationErrorTitle** | INTERFACE | The error title extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**operationErrorDetail** | INTERFACE | The error detail message extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**operationErrorCode** | INTERFACE | The error code extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**primitive** | INTERNAL | The typology of primitive analyzed and tracked by the event.
In NDP it is mapped with field 'eventType'.\n**sessionId** | INTERNAL | The session identifier generated by WISP SOAP Converter and used in the request.\n**cartId** | INTERNAL | The cart identifier used in the request.\n**iuv** | INTERNAL | The 'identificativo univoco pagamento' used in the request.\n**noticeNumber** | INTERNAL | The notice number (aka NAV code) used in the request.\n**domainId** | INTERNAL | The creditor institution identifier used in the request.\n**ccp** | INTERNAL | The 'codice contesto pagamento' used in the request.\n**psp** | INTERNAL | The payment service provider used in the request.\n**station** | INTERNAL | The station used in the request.\n**channel** | INTERNAL | The channel used in the request.\n**status** | INTERNAL | The state of the internal step executed.
Values:
_FOUND_RPT_IN_STORAGE_
_FOUND_RT_IN_STORAGE_
_EXTRACTED_DATA_FROM_RPT_
_CREATED_NEW_PAYMENT_POSITION_IN_GPD_
_GENERATED_NAV_FOR_NEW_PAYMENT_POSITION_
_UPDATED_EXISTING_PAYMENT_POSITION_IN_GPD_
_GENERATING_RT_FOR_INVALID_PAYMENT_POSITION_IN_GPD_
_GENERATING_RT_FOR_REDIRECT_ERROR_
_GENERATED_CACHE_ABOUT_RPT_FOR_DECOUPLER_
_GENERATED_CACHE_ABOUT_RPT_FOR_CARTSESSION_CACHING_
_GENERATED_CACHE_ABOUT_RPT_FOR_RT_GENERATION_
_SAVED_RPT_IN_CART_RECEIVED_REDIRECT_URL_FROM_CHECKOUT_
_RT_NOT_GENERABLE_FOR_GPD_STATION_
_RT_NOT_GENERABLE_FOR_NOT_EXISTING_PAYMENT_POSITION_
_NEGATIVE_RT_TRY_TO_SEND_TO_CREDITOR_INSTITUTION_
_POSITIVE_RT_TRY_TO_SEND_TO_CREDITOR_INSTITUTION_
_RT_SEND_SUCCESS_
_RT_SEND_FAILURE_
_RT_ALREADY_SENT_
_RT_SEND_SCHEDULING_SUCCESS_
_RT_SEND_SCHEDULING_FAILURE_
_RT_SCHEDULED_SEND_SUCCESS_
_RT_SCHEDULED_SEND_FAILURE_
_RT_SEND_RESCHEDULING_FAILURE_
_RT_SEND_RESCHEDULING_REACHED_MAX_RETRIES_
_RT_SEND_RESCHEDULING_SUCCESS_
_RT_START_RECONCILIATION_PROCESS_
_RT_END_RECONCILIATION_PROCESS_
_RT_DEAD_LETTER_SAVED_
_RT_DEAD_LETTER_FAILED_
_RECEIPT_TIMER_GENERATION_CREATED_SCHEDULED_SEND_
_RECEIPT_TIMER_GENERATION_CACHED_SEQUENCE_NUMBER_
_RECEIPT_TIMER_GENERATION_DELETED_SCHEDULED_SEND_
_RECEIPT_TIMER_GENERATION_SKIP_DELETE_SCHEDULED_SEND_
_RECEIPT_TIMER_PAYMENT_TOKEN_TIMEOUT_TRIGGER_
_ECOMMERCE_HANG_TIMER_TRIGGER_
_ECOMMERCE_HANG_TIMER_CREATED_
_ECOMMERCE_HANG_TIMER_DELETED_
_RPT_TIMER_TRIGGER_
_RPT_TIMER_CREATED_
_RPT_TIMER_DELETED_
_RPT_TIMER_NOT_SET_
_COMMUNICATING_WITH_GPD_REQUEST_
_COMMUNICATING_WITH_GPD_RESPONSE_
_COMMUNICATING_WITH_IUV_GENERATOR_REQUEST_
_COMMUNICATING_WITH_IUV_GENERATOR_RESPONSE_
_COMMUNICATING_WITH_CHECKOUT_REQUEST_
_COMMUNICATING_WITH_CHECKOUT_RESPONSE_
_COMMUNICATING_WITH_DECOUPLER_CACHING_REQUEST_
_COMMUNICATING_WITH_DECOUPLER_CACHING_RESPONSE_
_COMMUNICATING_WITH_CREDITOR_INSTITUTION_REQUEST_
_COMMUNICATING_WITH_CREDITOR_INSTITUTION_RESPONSE_\n**info** | INTERNAL | The other information that can be inserted for the tracing.\n**paymentToken** | INTERNAL | The payment token.\n\n
\n\n\n## OPERATIONAL ERROR CODES\n\n
Details\nNAME | CODE | DESCRIPTION\n- | - | -\n**WIC-500** | *ERROR* | A not documented generic error occurred while execution. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1000** | *GENERIC_ERROR* | A generic error occurred while executing conversion flow. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1001** | *PARSING_GENERIC_ERROR* | A generic error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1002** | *PARSING_INVALID_HEADER* | An error occurred while parsing of the content header, associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT.\n**WIC-1003** | *PARSING_INVALID_BODY* | An error occurred while parsing of the content payload, associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT.\n**WIC-1004** | *PARSING_INVALID_XML_NODES* | An error occurred while parsing of the of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The XML content extracted, either from payload or from header, is invalid because it is not possible to extract tag nodes from document. So, the document is probably empty.\n**WIC-1005** | *PARSING_INVALID_ZIPPED_PAYLOAD* | An error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The SOAP request analyzed and stored in dedicated storage is not usable for convert the debt positions in GPD system. This is probably due to an invalid conversion of the SOAP request via GZip algorithm executed before the same is stored in its storage.\n**WIC-1006** | *PARSING_RPT_PRIMITIVE_NOT_VALID* | An error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The primitive (the content related to header 'soapaction') cannot be handled by WISP Converter application in redirect process: only one of nodoInviaRPT and nodoInviaCarrelloRPT can be accepted.\n**WIC-1100** | *VALIDATION_INVALID_MULTIBENEFICIARY_CART* | An error occurred while analyzing the RPTs extracted from SOAP request. In particular, the request is arrived as nodoInviaCarrelloRPT as multi-beneficiary cart, but the number of RPTs in the request is lower than two, so it cannot be correctly handled as multi-beneficiary.\n**WIC-1101** | *VALIDATION_INVALID_IBANS* | An error occurred while analyzing the RPTs extracted from SOAP request. An IBAN must always be set in RPT transfers if they aren't related to digital stamps (which don't require an IBAN, because they will be reported to specific subject). In this case, in one or more RPT transfers not related to digital stamp, the IBAN is not correctly set.\n**WIC-1102** | *VALIDATION_INVALID_DEBTOR* | An error occurred while analyzing the RPTs extracted from SOAP request. In particular, in a cart there are different debtor subjects and this is not permitted for this flow. So, the whole cart is discarded.\n**WIC-1200** | *CONFIGURATION_INVALID_CACHE* | An error occurred while trying to access data from cached configuration. It is possible that the cache is not retrieved yet by this service or a corrupted configuration was returned from APIConfig Cache internal service. If this problem still occurs, please check the connectivity with APIConfig Cache.\n**WIC-1201** | *CONFIGURATION_INVALID_STATION* | An error occurred while retrieving data from local cached configuration. In particular, it is not possible to retrieve the configuration about the station because it does not exists in cache, and maybe also in general configuration. So, a change in whole configuration and/or a refresh on cache is required.\n**WIC-1202** | *CONFIGURATION_INVALID_CREDITOR_INSTITUTION_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the required station does not exists in cached configuration. So, a change in whole configuration and/or a refresh on cache is required.\n**WIC-1203** | *CONFIGURATION_INVALID_STATION_REDIRECT_URL* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration about redirection in error cases is not correctly set to points towards some creditor institution's endpoint. So, a change in configuration is required.\n**WIC-1204** | *CONFIGURATION_INVALID_STATION_SERVICE_URL* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is not correctly set to points towards GPD service endpoint for RT generator. So, a change in configuration is required.\n**WIC-1205** | *CONFIGURATION_NOT_GPD_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is not correctly set to points towards GPD service endpoint. So, a change in configuration is required.\n**WIC-1206** | *CONFIGURATION_INVALID_GPD_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is correctly set to points towards GPD service endpoint but uses the 'v1' primitive version (and it must use the 'v2' version). So, a change in configuration is required.\n**WIC-1207** | *CONFIGURATION_INVALID_STATION_PROXY* | An error occurred while checking the station that will be used for the receipt send process. In particular, analyzing the station it turns out that the configuration is not correctly set to configure proxy structure for RT generator. So, a change in configuration is required.\n**WIC-1300** | *PAYMENT_POSITION_NOT_IN_PAYABLE_STATE* | An error occurred while checking an existing payment position. One or more RPTs extracted from the request refers to existing payment positions in GPD that have a state from which it is impossible to execute a payment flow. If the execution of this flow is related to a RPT cart, all the payments that can be retrieved or generated ex novo from those RPTs are declared as atomically invalid (if one RPT in cart is bad, all RPTs in cart are bad) and not payable with this flow.\n**WIC-1301** | *PAYMENT_POSITION_IN_INCONSISTENT_STATE* | An error occurred while checking an existing payment position in GPD system. The retrieved payment position, previously inserted in GPD by this same flow or by other procedures, is in an invalid state, not mappable to an existing value. This can be related to a wrong setting in GPD or a corruption of the retrieved data.\n**WIC-1302** | *PAYMENT_POSITION_NOT_VALID* | An error occurred while generating a payment position. In particular, something during the generation of a new payment position or the analysis of an existing payment position went wrong and the operation cannot be completed. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1303** | *PAYMENT_OPTION_NOT_EXTRACTABLE* | An error occurred while extracting a payment option from a payment position. This can be caused by a malformed payment position that does not have a payment option. Remember that a payment position in this flow must have one and only one payment option.\n**WIC-1400** | *RECEIPT_GENERATION_GENERIC_ERROR* | An error occurred while generating an RT (aka a receipt). An unhandled error occurred and it is impossible to complete the process. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1401** | *RECEIPT_GENERATION_WRONG_RESPONSE_FROM_CREDITOR_INSTITUTION* | An error occurred while generating an RT (aka a receipt). Specifically, the RT request is sent to creditor institution but this one responded with an invalid response from which is impossible to continue the analysis. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1402** | *RECEIPT_GENERATION_ERROR_RESPONSE_FROM_CREDITOR_INSTITUTION* | An error occurred while generating an RT (aka a receipt). Specifically, the RT request is sent to creditor institution but this one responded with an error response that explicit the occurred problem. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1403** | *RECEIPT_KO_NOT_SENT* | An error occurred while sending a negative RT (aka a KO receipt). So, no receipt can be sent lately to creditor institution and probably the process must be executed manually. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1404** | *RECEIPT_OK_NOT_SENT* | An error occurred while sending a positive RT (aka a OK receipt). So, no receipt can be sent lately to creditor institution and probably the process must be executed manually. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1405** | *RECEIPT_GENERATION_IDEMPOTENCY_LOCKED_BY_ANOTHER_PROCESS* | An error occurred while generating an RT (aka a receipt). Two or more generation processes are concurrently trying to execute the same operation on the same receipt but only one of them is currently 'authorized' to do so.\n**WIC-1406** | *RECEIPT_GENERATION_NOT_PROCESSABLE* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be started correctly because it is trying to lock the idempotency key that is already in a locked state. Probably the process is in execution by another thread.\n**WIC-1407** | *RECEIPT_GENERATION_ALREADY_PROCESSED* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be completed correctly because it is trying to unlock the idempotency key that is not in a locked state. Probably the process was already completed.\n**WIC-1408** | *RECEIPT_GENERATION_ANOMALY_ON_PROCESSING* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be completed correctly because there is a mismatch between the type of the cached receipt and the kind of request made for generate the same receipt. For example, the cached receipt is defined as negative paaInviaRT but the request was made to 'receipt/ok' endpoint. This is an anomaly that should never happens in a correct NMU flow execution but must be traced in case of error.\n**WIC-1409** | *RECEIPT_KO_NOT_GENERATED_BUT_MAYBE_RESCHEDULED* | An error occurred while generating a negative RT (aka a KO receipt). The receipt could be sent lately to creditor institution but for better understanding the cause, please use the Technical Support's APIs.\n**WIC-1410** | *RECEIPT_OK_NOT_GENERATED_BUT_MAYBE_RESCHEDULED* | An error occurred while generating a positive RT (aka a OK receipt). The receipt could be sent lately to creditor institution but for better understanding the cause, please use the Technical Support's APIs.\n**WIC-1411** | *RECEIPT_GENERATION_ERROR_DEAD_LETTER* | An error occurred while generating an RT (aka a receipt). Specifically, the creditor institution response status has not been recognized, for this reason the RT has been placed in the dead letter container.\n**WIC-2000** | *PERSISTENCE_SAVING_RE_ERROR* | An error occurred wile trying to store a new event in the Registro Eventi storage. The error is somewhat related to a persistence problem of the used storage and in the majority of the cases is temporary (maybe a 429 HTTP code). This error currently blocks the entire flow because that can lead to untraceable requests. For better understanding the cause, please execute a search in the log provider (Application Insights, Kibana, etc).\n**WIC-2001** | *PERSISTENCE_RPT_NOT_FOUND* | An error occurred while trying to retrieve the RPT content saved in storage by WISP SOAP Converter. This can be related either with the use of a wrong sessionId or a missed persistence from WISP SOAP Converter, so it is better to analyze the entire flow using Technical Support's APIs. This block totally the conversion of the RPTs in GPD's payment positions, so the whole process is discarded.\n**WIC-2002** | *PERSISTENCE_RT_NOT_FOUND* | An error occurred while trying to retrieve the RT content saved in storage by WISP Converter. This can be related either with the use of a wrong identifier, a missed persistence or an expired object, so it is better to analyze the entire flow using Technical Support's APIs.\n**WIC-2003** | *PERSISTENCE_REQUESTID_CACHING_ERROR* | An error occurred while trying to retrieve data from internal cache. Specifically, the cached key, defined in format wisp_nav2iuv__
\n", "termsOfService": "https://www.pagopa.gov.it/", "title": "WISP Converter", - "version": "0.4.11" + "version": "0.4.11-1-PAGOPA-2221" }, "servers": [ { diff --git a/openapi/openapi_redirect.json b/openapi/openapi_redirect.json index d1a4c420..d83e9fdc 100644 --- a/openapi/openapi_redirect.json +++ b/openapi/openapi_redirect.json @@ -2,7 +2,7 @@ "openapi": "3.0.1", "info": { "title": "WISP-Converter-redirect", - "version": "0.4.11" + "version": "0.4.11-1-PAGOPA-2221" }, "servers": [ { diff --git a/pom.xml b/pom.xml index 72e2131b..86ea4aef 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ it.gov.pagopa wisp-converter - 0.4.11 + 0.4.11-1-PAGOPA-2221 pagoPA WISP Converter A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, converting them in NMU payments. From 67990d2244823ee921369d7d2fe75abdce5d4f8f Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Thu, 17 Oct 2024 14:56:38 +0000 Subject: [PATCH 12/20] Bump to version 0.4.11-2-PAGOPA-2221 [skip ci] --- helm/Chart.yaml | 4 ++-- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- openapi/openapi.json | 2 +- openapi/openapi_redirect.json | 2 +- pom.xml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 3adfe0f4..51161385 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-wisp-converter description: A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, interfacing them with GPD system type: application -version: 0.241.0 -appVersion: 0.4.11-1-PAGOPA-2221 +version: 0.242.0 +appVersion: 0.4.11-2-PAGOPA-2221 dependencies: - name: microservice-chart version: 3.0.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 295e6b14..bbb1eb11 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "0.4.11-1-PAGOPA-2221" + tag: "0.4.11-2-PAGOPA-2221" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 710c5a4c..882b4f45 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "0.4.11-1-PAGOPA-2221" + tag: "0.4.11-2-PAGOPA-2221" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index c3120d9b..9c0df44a 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "0.4.11-1-PAGOPA-2221" + tag: "0.4.11-2-PAGOPA-2221" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi/openapi.json b/openapi/openapi.json index 42dc7c21..0795db5e 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "description": "A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, converting them in NMU payments.\n\n# OPERATIVE INFO\n\n\n## EVENT MAPPING IN RE\n\n
Details\nFIELD | SCOPE | DESCRIPTION\n- | - | -\n**requestId** | BOTH | The identifier, set by X-Request-ID, from which the events can be grouped.\n**operationId** | BOTH | The identifier associated to a request identifier\n**clientOperationId** | BOTH | The identifier that associate a client to an operation identifier.\n**component** | BOTH | The applicative component from which the event is generated.
In NDP it is mapped with field 'componente'.
Values:
_WISP_SOAP_CONVERTER_
_WISP_CONVERTER_\n**insertedTimestamp** | BOTH | The time on which the event is inserted in RE storage\n**eventCategory** | BOTH | The category on which the event can be grouped.
In NDP it is mapped with field 'categoriaEvento'.
Values:
_INTERFACE_
_INTERNAL_\n**eventSubcategory** | BOTH | The subcategory related to the specific nature of the event.
In NDP it is mapped with field 'sottoTipoEvento'.
Values:
_REQ_
_RESP_
_INTERN_\n**callType** | INTERFACE | The type of role that the application has in the communication with the remote endpoint.
Values:
_SERVER_
_CLIENT_\n**outcome** | INTERFACE | The outcome of the operation described by the event.
In NDP it is mapped with field 'esito'.
Values:
_SEND_: Correctly sent request to HTTP endpoint. In NDP it is mapped with value 'INVIATA'.
_SEND_FAILURE_: Failed to send request to HTTP endpoint. In NDP it is mapped with value 'INVIATA_KO'
_RECEIVED_: Received an OK response from HTTP endpoint. In NDP it is mapped with value 'RICEVUTA_KO'
_RECEIVED_FAILURE_: Received a failure response from endpoint. In NDP it is mapped with value 'RICEVUTA_KO'
_NEVER_RECEIVED_: Failed to receive response at all from endpoint. In NDP it is mapped with value 'NO_RICEVUTA'
_EXECUTED_INTERNAL_STEP_: Executed internal step on execution. In NDP it is mapped with value 'CAMBIO_STATO'\n**httpMethod** | INTERFACE | The HTTP method of the endpoint related to the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpUri** | INTERFACE | The URI related to the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpHeaders** | INTERFACE | The list of HTTP headers extracted from the request/response analyzed by the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpCallRemoteAddress** | INTERFACE | The remote IP address extracted from the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpStatusCode** | INTERFACE | The status code extracted from the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**executionTimeMs** | INTERFACE | The duration time of the invocation of the endpoint related to the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**compressedPayload** | INTERFACE | The payload of the request/response analyzed by the event.
This value is zipped using GZip compression algorithm.\n**compressedPayloadLength** | INTERFACE | The length (in number of characters) of the compressed payload.\n**businessProcess** | INTERFACE | The descriptive label associated to the endpoint called by user and related to the whole process.\n**operationStatus** | INTERFACE | The final status of the whole operation.
This is set only in the events that describe the response in output to user.\n**operationErrorTitle** | INTERFACE | The error title extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**operationErrorDetail** | INTERFACE | The error detail message extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**operationErrorCode** | INTERFACE | The error code extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**primitive** | INTERNAL | The typology of primitive analyzed and tracked by the event.
In NDP it is mapped with field 'eventType'.\n**sessionId** | INTERNAL | The session identifier generated by WISP SOAP Converter and used in the request.\n**cartId** | INTERNAL | The cart identifier used in the request.\n**iuv** | INTERNAL | The 'identificativo univoco pagamento' used in the request.\n**noticeNumber** | INTERNAL | The notice number (aka NAV code) used in the request.\n**domainId** | INTERNAL | The creditor institution identifier used in the request.\n**ccp** | INTERNAL | The 'codice contesto pagamento' used in the request.\n**psp** | INTERNAL | The payment service provider used in the request.\n**station** | INTERNAL | The station used in the request.\n**channel** | INTERNAL | The channel used in the request.\n**status** | INTERNAL | The state of the internal step executed.
Values:
_FOUND_RPT_IN_STORAGE_
_FOUND_RT_IN_STORAGE_
_EXTRACTED_DATA_FROM_RPT_
_CREATED_NEW_PAYMENT_POSITION_IN_GPD_
_GENERATED_NAV_FOR_NEW_PAYMENT_POSITION_
_UPDATED_EXISTING_PAYMENT_POSITION_IN_GPD_
_GENERATING_RT_FOR_INVALID_PAYMENT_POSITION_IN_GPD_
_GENERATING_RT_FOR_REDIRECT_ERROR_
_GENERATED_CACHE_ABOUT_RPT_FOR_DECOUPLER_
_GENERATED_CACHE_ABOUT_RPT_FOR_CARTSESSION_CACHING_
_GENERATED_CACHE_ABOUT_RPT_FOR_RT_GENERATION_
_SAVED_RPT_IN_CART_RECEIVED_REDIRECT_URL_FROM_CHECKOUT_
_RT_NOT_GENERABLE_FOR_GPD_STATION_
_RT_NOT_GENERABLE_FOR_NOT_EXISTING_PAYMENT_POSITION_
_NEGATIVE_RT_TRY_TO_SEND_TO_CREDITOR_INSTITUTION_
_POSITIVE_RT_TRY_TO_SEND_TO_CREDITOR_INSTITUTION_
_RT_SEND_SUCCESS_
_RT_SEND_FAILURE_
_RT_ALREADY_SENT_
_RT_SEND_SCHEDULING_SUCCESS_
_RT_SEND_SCHEDULING_FAILURE_
_RT_SCHEDULED_SEND_SUCCESS_
_RT_SCHEDULED_SEND_FAILURE_
_RT_SEND_RESCHEDULING_FAILURE_
_RT_SEND_RESCHEDULING_REACHED_MAX_RETRIES_
_RT_SEND_RESCHEDULING_SUCCESS_
_RT_START_RECONCILIATION_PROCESS_
_RT_END_RECONCILIATION_PROCESS_
_RT_DEAD_LETTER_SAVED_
_RT_DEAD_LETTER_FAILED_
_RECEIPT_TIMER_GENERATION_CREATED_SCHEDULED_SEND_
_RECEIPT_TIMER_GENERATION_CACHED_SEQUENCE_NUMBER_
_RECEIPT_TIMER_GENERATION_DELETED_SCHEDULED_SEND_
_RECEIPT_TIMER_GENERATION_SKIP_DELETE_SCHEDULED_SEND_
_RECEIPT_TIMER_PAYMENT_TOKEN_TIMEOUT_TRIGGER_
_ECOMMERCE_HANG_TIMER_TRIGGER_
_ECOMMERCE_HANG_TIMER_CREATED_
_ECOMMERCE_HANG_TIMER_DELETED_
_RPT_TIMER_TRIGGER_
_RPT_TIMER_CREATED_
_RPT_TIMER_DELETED_
_RPT_TIMER_NOT_SET_
_COMMUNICATING_WITH_GPD_REQUEST_
_COMMUNICATING_WITH_GPD_RESPONSE_
_COMMUNICATING_WITH_IUV_GENERATOR_REQUEST_
_COMMUNICATING_WITH_IUV_GENERATOR_RESPONSE_
_COMMUNICATING_WITH_CHECKOUT_REQUEST_
_COMMUNICATING_WITH_CHECKOUT_RESPONSE_
_COMMUNICATING_WITH_DECOUPLER_CACHING_REQUEST_
_COMMUNICATING_WITH_DECOUPLER_CACHING_RESPONSE_
_COMMUNICATING_WITH_CREDITOR_INSTITUTION_REQUEST_
_COMMUNICATING_WITH_CREDITOR_INSTITUTION_RESPONSE_\n**info** | INTERNAL | The other information that can be inserted for the tracing.\n**paymentToken** | INTERNAL | The payment token.\n\n
\n\n\n## OPERATIONAL ERROR CODES\n\n
Details\nNAME | CODE | DESCRIPTION\n- | - | -\n**WIC-500** | *ERROR* | A not documented generic error occurred while execution. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1000** | *GENERIC_ERROR* | A generic error occurred while executing conversion flow. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1001** | *PARSING_GENERIC_ERROR* | A generic error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1002** | *PARSING_INVALID_HEADER* | An error occurred while parsing of the content header, associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT.\n**WIC-1003** | *PARSING_INVALID_BODY* | An error occurred while parsing of the content payload, associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT.\n**WIC-1004** | *PARSING_INVALID_XML_NODES* | An error occurred while parsing of the of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The XML content extracted, either from payload or from header, is invalid because it is not possible to extract tag nodes from document. So, the document is probably empty.\n**WIC-1005** | *PARSING_INVALID_ZIPPED_PAYLOAD* | An error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The SOAP request analyzed and stored in dedicated storage is not usable for convert the debt positions in GPD system. This is probably due to an invalid conversion of the SOAP request via GZip algorithm executed before the same is stored in its storage.\n**WIC-1006** | *PARSING_RPT_PRIMITIVE_NOT_VALID* | An error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The primitive (the content related to header 'soapaction') cannot be handled by WISP Converter application in redirect process: only one of nodoInviaRPT and nodoInviaCarrelloRPT can be accepted.\n**WIC-1100** | *VALIDATION_INVALID_MULTIBENEFICIARY_CART* | An error occurred while analyzing the RPTs extracted from SOAP request. In particular, the request is arrived as nodoInviaCarrelloRPT as multi-beneficiary cart, but the number of RPTs in the request is lower than two, so it cannot be correctly handled as multi-beneficiary.\n**WIC-1101** | *VALIDATION_INVALID_IBANS* | An error occurred while analyzing the RPTs extracted from SOAP request. An IBAN must always be set in RPT transfers if they aren't related to digital stamps (which don't require an IBAN, because they will be reported to specific subject). In this case, in one or more RPT transfers not related to digital stamp, the IBAN is not correctly set.\n**WIC-1102** | *VALIDATION_INVALID_DEBTOR* | An error occurred while analyzing the RPTs extracted from SOAP request. In particular, in a cart there are different debtor subjects and this is not permitted for this flow. So, the whole cart is discarded.\n**WIC-1200** | *CONFIGURATION_INVALID_CACHE* | An error occurred while trying to access data from cached configuration. It is possible that the cache is not retrieved yet by this service or a corrupted configuration was returned from APIConfig Cache internal service. If this problem still occurs, please check the connectivity with APIConfig Cache.\n**WIC-1201** | *CONFIGURATION_INVALID_STATION* | An error occurred while retrieving data from local cached configuration. In particular, it is not possible to retrieve the configuration about the station because it does not exists in cache, and maybe also in general configuration. So, a change in whole configuration and/or a refresh on cache is required.\n**WIC-1202** | *CONFIGURATION_INVALID_CREDITOR_INSTITUTION_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the required station does not exists in cached configuration. So, a change in whole configuration and/or a refresh on cache is required.\n**WIC-1203** | *CONFIGURATION_INVALID_STATION_REDIRECT_URL* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration about redirection in error cases is not correctly set to points towards some creditor institution's endpoint. So, a change in configuration is required.\n**WIC-1204** | *CONFIGURATION_INVALID_STATION_SERVICE_URL* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is not correctly set to points towards GPD service endpoint for RT generator. So, a change in configuration is required.\n**WIC-1205** | *CONFIGURATION_NOT_GPD_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is not correctly set to points towards GPD service endpoint. So, a change in configuration is required.\n**WIC-1206** | *CONFIGURATION_INVALID_GPD_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is correctly set to points towards GPD service endpoint but uses the 'v1' primitive version (and it must use the 'v2' version). So, a change in configuration is required.\n**WIC-1207** | *CONFIGURATION_INVALID_STATION_PROXY* | An error occurred while checking the station that will be used for the receipt send process. In particular, analyzing the station it turns out that the configuration is not correctly set to configure proxy structure for RT generator. So, a change in configuration is required.\n**WIC-1300** | *PAYMENT_POSITION_NOT_IN_PAYABLE_STATE* | An error occurred while checking an existing payment position. One or more RPTs extracted from the request refers to existing payment positions in GPD that have a state from which it is impossible to execute a payment flow. If the execution of this flow is related to a RPT cart, all the payments that can be retrieved or generated ex novo from those RPTs are declared as atomically invalid (if one RPT in cart is bad, all RPTs in cart are bad) and not payable with this flow.\n**WIC-1301** | *PAYMENT_POSITION_IN_INCONSISTENT_STATE* | An error occurred while checking an existing payment position in GPD system. The retrieved payment position, previously inserted in GPD by this same flow or by other procedures, is in an invalid state, not mappable to an existing value. This can be related to a wrong setting in GPD or a corruption of the retrieved data.\n**WIC-1302** | *PAYMENT_POSITION_NOT_VALID* | An error occurred while generating a payment position. In particular, something during the generation of a new payment position or the analysis of an existing payment position went wrong and the operation cannot be completed. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1303** | *PAYMENT_OPTION_NOT_EXTRACTABLE* | An error occurred while extracting a payment option from a payment position. This can be caused by a malformed payment position that does not have a payment option. Remember that a payment position in this flow must have one and only one payment option.\n**WIC-1400** | *RECEIPT_GENERATION_GENERIC_ERROR* | An error occurred while generating an RT (aka a receipt). An unhandled error occurred and it is impossible to complete the process. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1401** | *RECEIPT_GENERATION_WRONG_RESPONSE_FROM_CREDITOR_INSTITUTION* | An error occurred while generating an RT (aka a receipt). Specifically, the RT request is sent to creditor institution but this one responded with an invalid response from which is impossible to continue the analysis. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1402** | *RECEIPT_GENERATION_ERROR_RESPONSE_FROM_CREDITOR_INSTITUTION* | An error occurred while generating an RT (aka a receipt). Specifically, the RT request is sent to creditor institution but this one responded with an error response that explicit the occurred problem. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1403** | *RECEIPT_KO_NOT_SENT* | An error occurred while sending a negative RT (aka a KO receipt). So, no receipt can be sent lately to creditor institution and probably the process must be executed manually. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1404** | *RECEIPT_OK_NOT_SENT* | An error occurred while sending a positive RT (aka a OK receipt). So, no receipt can be sent lately to creditor institution and probably the process must be executed manually. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1405** | *RECEIPT_GENERATION_IDEMPOTENCY_LOCKED_BY_ANOTHER_PROCESS* | An error occurred while generating an RT (aka a receipt). Two or more generation processes are concurrently trying to execute the same operation on the same receipt but only one of them is currently 'authorized' to do so.\n**WIC-1406** | *RECEIPT_GENERATION_NOT_PROCESSABLE* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be started correctly because it is trying to lock the idempotency key that is already in a locked state. Probably the process is in execution by another thread.\n**WIC-1407** | *RECEIPT_GENERATION_ALREADY_PROCESSED* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be completed correctly because it is trying to unlock the idempotency key that is not in a locked state. Probably the process was already completed.\n**WIC-1408** | *RECEIPT_GENERATION_ANOMALY_ON_PROCESSING* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be completed correctly because there is a mismatch between the type of the cached receipt and the kind of request made for generate the same receipt. For example, the cached receipt is defined as negative paaInviaRT but the request was made to 'receipt/ok' endpoint. This is an anomaly that should never happens in a correct NMU flow execution but must be traced in case of error.\n**WIC-1409** | *RECEIPT_KO_NOT_GENERATED_BUT_MAYBE_RESCHEDULED* | An error occurred while generating a negative RT (aka a KO receipt). The receipt could be sent lately to creditor institution but for better understanding the cause, please use the Technical Support's APIs.\n**WIC-1410** | *RECEIPT_OK_NOT_GENERATED_BUT_MAYBE_RESCHEDULED* | An error occurred while generating a positive RT (aka a OK receipt). The receipt could be sent lately to creditor institution but for better understanding the cause, please use the Technical Support's APIs.\n**WIC-1411** | *RECEIPT_GENERATION_ERROR_DEAD_LETTER* | An error occurred while generating an RT (aka a receipt). Specifically, the creditor institution response status has not been recognized, for this reason the RT has been placed in the dead letter container.\n**WIC-2000** | *PERSISTENCE_SAVING_RE_ERROR* | An error occurred wile trying to store a new event in the Registro Eventi storage. The error is somewhat related to a persistence problem of the used storage and in the majority of the cases is temporary (maybe a 429 HTTP code). This error currently blocks the entire flow because that can lead to untraceable requests. For better understanding the cause, please execute a search in the log provider (Application Insights, Kibana, etc).\n**WIC-2001** | *PERSISTENCE_RPT_NOT_FOUND* | An error occurred while trying to retrieve the RPT content saved in storage by WISP SOAP Converter. This can be related either with the use of a wrong sessionId or a missed persistence from WISP SOAP Converter, so it is better to analyze the entire flow using Technical Support's APIs. This block totally the conversion of the RPTs in GPD's payment positions, so the whole process is discarded.\n**WIC-2002** | *PERSISTENCE_RT_NOT_FOUND* | An error occurred while trying to retrieve the RT content saved in storage by WISP Converter. This can be related either with the use of a wrong identifier, a missed persistence or an expired object, so it is better to analyze the entire flow using Technical Support's APIs.\n**WIC-2003** | *PERSISTENCE_REQUESTID_CACHING_ERROR* | An error occurred while trying to retrieve data from internal cache. Specifically, the cached key, defined in format wisp_nav2iuv__
\n", "termsOfService": "https://www.pagopa.gov.it/", "title": "WISP Converter", - "version": "0.4.11-1-PAGOPA-2221" + "version": "0.4.11-2-PAGOPA-2221" }, "servers": [ { diff --git a/openapi/openapi_redirect.json b/openapi/openapi_redirect.json index d83e9fdc..9f82fcd7 100644 --- a/openapi/openapi_redirect.json +++ b/openapi/openapi_redirect.json @@ -2,7 +2,7 @@ "openapi": "3.0.1", "info": { "title": "WISP-Converter-redirect", - "version": "0.4.11-1-PAGOPA-2221" + "version": "0.4.11-2-PAGOPA-2221" }, "servers": [ { diff --git a/pom.xml b/pom.xml index 86ea4aef..6328ecc5 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ it.gov.pagopa wisp-converter - 0.4.11-1-PAGOPA-2221 + 0.4.11-2-PAGOPA-2221 pagoPA WISP Converter A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, converting them in NMU payments. From 338656d0e902f54b210ea0dd777436cf37b3fd2c Mon Sep 17 00:00:00 2001 From: Jacopo Carlini Date: Thu, 17 Oct 2024 17:12:21 +0200 Subject: [PATCH 13/20] [PAGOPA-2221] fix --- Dockerfile | 1 + docker/run_docker.sh | 44 ++++++++++++++++++++++---------------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7064dbd1..3e2fb683 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,7 @@ COPY --from=buildtime /build/target/*.jar application.jar RUN java -Djarmode=layertools -jar application.jar extract FROM ghcr.io/pagopa/docker-base-springboot-openjdk17:v2.2.0@sha256:b866656c31f2c6ebe6e78b9437ce930d6c94c0b4bfc8e9ecc1076a780b9dfb18 +COPY --chown=spring:spring docker/applicationinsights.json ./applicationinsights.json COPY --chown=spring:spring --from=builder dependencies/ ./ COPY --chown=spring:spring --from=builder snapshot-dependencies/ ./ diff --git a/docker/run_docker.sh b/docker/run_docker.sh index 27db20b5..8ecfd9ac 100755 --- a/docker/run_docker.sh +++ b/docker/run_docker.sh @@ -20,28 +20,28 @@ else image="${repository}:latest" fi export image=${image} -# -#FILE=.env -#if test -f "$FILE"; then -# rm .env -#fi -#config=$(yq -r '."microservice-chart".envConfig' ../helm/values-$ENV.yaml) -#IFS=$'\n' -#for line in $(echo "$config" | yq -r '. | to_entries[] | select(.key) | "\(.key)=\(.value)"'); do -# echo "$line" >> .env -#done -# -#keyvault=$(yq -r '."microservice-chart".keyvault.name' ../helm/values-$ENV.yaml) -#secret=$(yq -r '."microservice-chart".envSecret' ../helm/values-$ENV.yaml) -#for line in $(echo "$secret" | yq -r '. | to_entries[] | select(.key) | "\(.key)=\(.value)"'); do -# IFS='=' read -r -a array <<< "$line" -# response=$(az keyvault secret show --vault-name $keyvault --name "${array[1]}") -# response=$(echo "$response" | tr -d '\n') -# value=$(echo "$response" | yq -r '.value') -# value=$(echo "$value" | sed 's/\$/\$\$/g') -# value=$(echo "$value" | tr -d '\n') -# echo "${array[0]}=$value" >> .env -#done + +FILE=.env +if test -f "$FILE"; then + rm .env +fi +config=$(yq -r '."microservice-chart".envConfig' ../helm/values-$ENV.yaml) +IFS=$'\n' +for line in $(echo "$config" | yq -r '. | to_entries[] | select(.key) | "\(.key)=\(.value)"'); do + echo "$line" >> .env +done + +keyvault=$(yq -r '."microservice-chart".keyvault.name' ../helm/values-$ENV.yaml) +secret=$(yq -r '."microservice-chart".envSecret' ../helm/values-$ENV.yaml) +for line in $(echo "$secret" | yq -r '. | to_entries[] | select(.key) | "\(.key)=\(.value)"'); do + IFS='=' read -r -a array <<< "$line" + response=$(az keyvault secret show --vault-name $keyvault --name "${array[1]}") + response=$(echo "$response" | tr -d '\n') + value=$(echo "$response" | yq -r '.value') + value=$(echo "$value" | sed 's/\$/\$\$/g') + value=$(echo "$value" | tr -d '\n') + echo "${array[0]}=$value" >> .env +done stack_name=$(cd .. && basename "$PWD") From c54c6b272086c008e503cd2fa2d0fc8dbf9fdf2c Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Thu, 17 Oct 2024 15:14:11 +0000 Subject: [PATCH 14/20] Bump to version 0.4.11-3-PAGOPA-2221 [skip ci] --- helm/Chart.yaml | 4 ++-- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- openapi/openapi.json | 2 +- openapi/openapi_redirect.json | 2 +- pom.xml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 51161385..294cb4fc 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-wisp-converter description: A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, interfacing them with GPD system type: application -version: 0.242.0 -appVersion: 0.4.11-2-PAGOPA-2221 +version: 0.243.0 +appVersion: 0.4.11-3-PAGOPA-2221 dependencies: - name: microservice-chart version: 3.0.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index bbb1eb11..d8bb1ec8 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "0.4.11-2-PAGOPA-2221" + tag: "0.4.11-3-PAGOPA-2221" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 882b4f45..a56f75d0 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "0.4.11-2-PAGOPA-2221" + tag: "0.4.11-3-PAGOPA-2221" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 9c0df44a..fa01e0e3 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "0.4.11-2-PAGOPA-2221" + tag: "0.4.11-3-PAGOPA-2221" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi/openapi.json b/openapi/openapi.json index 0795db5e..f294f206 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "description": "A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, converting them in NMU payments.\n\n# OPERATIVE INFO\n\n\n## EVENT MAPPING IN RE\n\n
Details\nFIELD | SCOPE | DESCRIPTION\n- | - | -\n**requestId** | BOTH | The identifier, set by X-Request-ID, from which the events can be grouped.\n**operationId** | BOTH | The identifier associated to a request identifier\n**clientOperationId** | BOTH | The identifier that associate a client to an operation identifier.\n**component** | BOTH | The applicative component from which the event is generated.
In NDP it is mapped with field 'componente'.
Values:
_WISP_SOAP_CONVERTER_
_WISP_CONVERTER_\n**insertedTimestamp** | BOTH | The time on which the event is inserted in RE storage\n**eventCategory** | BOTH | The category on which the event can be grouped.
In NDP it is mapped with field 'categoriaEvento'.
Values:
_INTERFACE_
_INTERNAL_\n**eventSubcategory** | BOTH | The subcategory related to the specific nature of the event.
In NDP it is mapped with field 'sottoTipoEvento'.
Values:
_REQ_
_RESP_
_INTERN_\n**callType** | INTERFACE | The type of role that the application has in the communication with the remote endpoint.
Values:
_SERVER_
_CLIENT_\n**outcome** | INTERFACE | The outcome of the operation described by the event.
In NDP it is mapped with field 'esito'.
Values:
_SEND_: Correctly sent request to HTTP endpoint. In NDP it is mapped with value 'INVIATA'.
_SEND_FAILURE_: Failed to send request to HTTP endpoint. In NDP it is mapped with value 'INVIATA_KO'
_RECEIVED_: Received an OK response from HTTP endpoint. In NDP it is mapped with value 'RICEVUTA_KO'
_RECEIVED_FAILURE_: Received a failure response from endpoint. In NDP it is mapped with value 'RICEVUTA_KO'
_NEVER_RECEIVED_: Failed to receive response at all from endpoint. In NDP it is mapped with value 'NO_RICEVUTA'
_EXECUTED_INTERNAL_STEP_: Executed internal step on execution. In NDP it is mapped with value 'CAMBIO_STATO'\n**httpMethod** | INTERFACE | The HTTP method of the endpoint related to the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpUri** | INTERFACE | The URI related to the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpHeaders** | INTERFACE | The list of HTTP headers extracted from the request/response analyzed by the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpCallRemoteAddress** | INTERFACE | The remote IP address extracted from the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpStatusCode** | INTERFACE | The status code extracted from the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**executionTimeMs** | INTERFACE | The duration time of the invocation of the endpoint related to the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**compressedPayload** | INTERFACE | The payload of the request/response analyzed by the event.
This value is zipped using GZip compression algorithm.\n**compressedPayloadLength** | INTERFACE | The length (in number of characters) of the compressed payload.\n**businessProcess** | INTERFACE | The descriptive label associated to the endpoint called by user and related to the whole process.\n**operationStatus** | INTERFACE | The final status of the whole operation.
This is set only in the events that describe the response in output to user.\n**operationErrorTitle** | INTERFACE | The error title extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**operationErrorDetail** | INTERFACE | The error detail message extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**operationErrorCode** | INTERFACE | The error code extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**primitive** | INTERNAL | The typology of primitive analyzed and tracked by the event.
In NDP it is mapped with field 'eventType'.\n**sessionId** | INTERNAL | The session identifier generated by WISP SOAP Converter and used in the request.\n**cartId** | INTERNAL | The cart identifier used in the request.\n**iuv** | INTERNAL | The 'identificativo univoco pagamento' used in the request.\n**noticeNumber** | INTERNAL | The notice number (aka NAV code) used in the request.\n**domainId** | INTERNAL | The creditor institution identifier used in the request.\n**ccp** | INTERNAL | The 'codice contesto pagamento' used in the request.\n**psp** | INTERNAL | The payment service provider used in the request.\n**station** | INTERNAL | The station used in the request.\n**channel** | INTERNAL | The channel used in the request.\n**status** | INTERNAL | The state of the internal step executed.
Values:
_FOUND_RPT_IN_STORAGE_
_FOUND_RT_IN_STORAGE_
_EXTRACTED_DATA_FROM_RPT_
_CREATED_NEW_PAYMENT_POSITION_IN_GPD_
_GENERATED_NAV_FOR_NEW_PAYMENT_POSITION_
_UPDATED_EXISTING_PAYMENT_POSITION_IN_GPD_
_GENERATING_RT_FOR_INVALID_PAYMENT_POSITION_IN_GPD_
_GENERATING_RT_FOR_REDIRECT_ERROR_
_GENERATED_CACHE_ABOUT_RPT_FOR_DECOUPLER_
_GENERATED_CACHE_ABOUT_RPT_FOR_CARTSESSION_CACHING_
_GENERATED_CACHE_ABOUT_RPT_FOR_RT_GENERATION_
_SAVED_RPT_IN_CART_RECEIVED_REDIRECT_URL_FROM_CHECKOUT_
_RT_NOT_GENERABLE_FOR_GPD_STATION_
_RT_NOT_GENERABLE_FOR_NOT_EXISTING_PAYMENT_POSITION_
_NEGATIVE_RT_TRY_TO_SEND_TO_CREDITOR_INSTITUTION_
_POSITIVE_RT_TRY_TO_SEND_TO_CREDITOR_INSTITUTION_
_RT_SEND_SUCCESS_
_RT_SEND_FAILURE_
_RT_ALREADY_SENT_
_RT_SEND_SCHEDULING_SUCCESS_
_RT_SEND_SCHEDULING_FAILURE_
_RT_SCHEDULED_SEND_SUCCESS_
_RT_SCHEDULED_SEND_FAILURE_
_RT_SEND_RESCHEDULING_FAILURE_
_RT_SEND_RESCHEDULING_REACHED_MAX_RETRIES_
_RT_SEND_RESCHEDULING_SUCCESS_
_RT_START_RECONCILIATION_PROCESS_
_RT_END_RECONCILIATION_PROCESS_
_RT_DEAD_LETTER_SAVED_
_RT_DEAD_LETTER_FAILED_
_RECEIPT_TIMER_GENERATION_CREATED_SCHEDULED_SEND_
_RECEIPT_TIMER_GENERATION_CACHED_SEQUENCE_NUMBER_
_RECEIPT_TIMER_GENERATION_DELETED_SCHEDULED_SEND_
_RECEIPT_TIMER_GENERATION_SKIP_DELETE_SCHEDULED_SEND_
_RECEIPT_TIMER_PAYMENT_TOKEN_TIMEOUT_TRIGGER_
_ECOMMERCE_HANG_TIMER_TRIGGER_
_ECOMMERCE_HANG_TIMER_CREATED_
_ECOMMERCE_HANG_TIMER_DELETED_
_RPT_TIMER_TRIGGER_
_RPT_TIMER_CREATED_
_RPT_TIMER_DELETED_
_RPT_TIMER_NOT_SET_
_COMMUNICATING_WITH_GPD_REQUEST_
_COMMUNICATING_WITH_GPD_RESPONSE_
_COMMUNICATING_WITH_IUV_GENERATOR_REQUEST_
_COMMUNICATING_WITH_IUV_GENERATOR_RESPONSE_
_COMMUNICATING_WITH_CHECKOUT_REQUEST_
_COMMUNICATING_WITH_CHECKOUT_RESPONSE_
_COMMUNICATING_WITH_DECOUPLER_CACHING_REQUEST_
_COMMUNICATING_WITH_DECOUPLER_CACHING_RESPONSE_
_COMMUNICATING_WITH_CREDITOR_INSTITUTION_REQUEST_
_COMMUNICATING_WITH_CREDITOR_INSTITUTION_RESPONSE_\n**info** | INTERNAL | The other information that can be inserted for the tracing.\n**paymentToken** | INTERNAL | The payment token.\n\n
\n\n\n## OPERATIONAL ERROR CODES\n\n
Details\nNAME | CODE | DESCRIPTION\n- | - | -\n**WIC-500** | *ERROR* | A not documented generic error occurred while execution. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1000** | *GENERIC_ERROR* | A generic error occurred while executing conversion flow. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1001** | *PARSING_GENERIC_ERROR* | A generic error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1002** | *PARSING_INVALID_HEADER* | An error occurred while parsing of the content header, associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT.\n**WIC-1003** | *PARSING_INVALID_BODY* | An error occurred while parsing of the content payload, associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT.\n**WIC-1004** | *PARSING_INVALID_XML_NODES* | An error occurred while parsing of the of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The XML content extracted, either from payload or from header, is invalid because it is not possible to extract tag nodes from document. So, the document is probably empty.\n**WIC-1005** | *PARSING_INVALID_ZIPPED_PAYLOAD* | An error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The SOAP request analyzed and stored in dedicated storage is not usable for convert the debt positions in GPD system. This is probably due to an invalid conversion of the SOAP request via GZip algorithm executed before the same is stored in its storage.\n**WIC-1006** | *PARSING_RPT_PRIMITIVE_NOT_VALID* | An error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The primitive (the content related to header 'soapaction') cannot be handled by WISP Converter application in redirect process: only one of nodoInviaRPT and nodoInviaCarrelloRPT can be accepted.\n**WIC-1100** | *VALIDATION_INVALID_MULTIBENEFICIARY_CART* | An error occurred while analyzing the RPTs extracted from SOAP request. In particular, the request is arrived as nodoInviaCarrelloRPT as multi-beneficiary cart, but the number of RPTs in the request is lower than two, so it cannot be correctly handled as multi-beneficiary.\n**WIC-1101** | *VALIDATION_INVALID_IBANS* | An error occurred while analyzing the RPTs extracted from SOAP request. An IBAN must always be set in RPT transfers if they aren't related to digital stamps (which don't require an IBAN, because they will be reported to specific subject). In this case, in one or more RPT transfers not related to digital stamp, the IBAN is not correctly set.\n**WIC-1102** | *VALIDATION_INVALID_DEBTOR* | An error occurred while analyzing the RPTs extracted from SOAP request. In particular, in a cart there are different debtor subjects and this is not permitted for this flow. So, the whole cart is discarded.\n**WIC-1200** | *CONFIGURATION_INVALID_CACHE* | An error occurred while trying to access data from cached configuration. It is possible that the cache is not retrieved yet by this service or a corrupted configuration was returned from APIConfig Cache internal service. If this problem still occurs, please check the connectivity with APIConfig Cache.\n**WIC-1201** | *CONFIGURATION_INVALID_STATION* | An error occurred while retrieving data from local cached configuration. In particular, it is not possible to retrieve the configuration about the station because it does not exists in cache, and maybe also in general configuration. So, a change in whole configuration and/or a refresh on cache is required.\n**WIC-1202** | *CONFIGURATION_INVALID_CREDITOR_INSTITUTION_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the required station does not exists in cached configuration. So, a change in whole configuration and/or a refresh on cache is required.\n**WIC-1203** | *CONFIGURATION_INVALID_STATION_REDIRECT_URL* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration about redirection in error cases is not correctly set to points towards some creditor institution's endpoint. So, a change in configuration is required.\n**WIC-1204** | *CONFIGURATION_INVALID_STATION_SERVICE_URL* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is not correctly set to points towards GPD service endpoint for RT generator. So, a change in configuration is required.\n**WIC-1205** | *CONFIGURATION_NOT_GPD_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is not correctly set to points towards GPD service endpoint. So, a change in configuration is required.\n**WIC-1206** | *CONFIGURATION_INVALID_GPD_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is correctly set to points towards GPD service endpoint but uses the 'v1' primitive version (and it must use the 'v2' version). So, a change in configuration is required.\n**WIC-1207** | *CONFIGURATION_INVALID_STATION_PROXY* | An error occurred while checking the station that will be used for the receipt send process. In particular, analyzing the station it turns out that the configuration is not correctly set to configure proxy structure for RT generator. So, a change in configuration is required.\n**WIC-1300** | *PAYMENT_POSITION_NOT_IN_PAYABLE_STATE* | An error occurred while checking an existing payment position. One or more RPTs extracted from the request refers to existing payment positions in GPD that have a state from which it is impossible to execute a payment flow. If the execution of this flow is related to a RPT cart, all the payments that can be retrieved or generated ex novo from those RPTs are declared as atomically invalid (if one RPT in cart is bad, all RPTs in cart are bad) and not payable with this flow.\n**WIC-1301** | *PAYMENT_POSITION_IN_INCONSISTENT_STATE* | An error occurred while checking an existing payment position in GPD system. The retrieved payment position, previously inserted in GPD by this same flow or by other procedures, is in an invalid state, not mappable to an existing value. This can be related to a wrong setting in GPD or a corruption of the retrieved data.\n**WIC-1302** | *PAYMENT_POSITION_NOT_VALID* | An error occurred while generating a payment position. In particular, something during the generation of a new payment position or the analysis of an existing payment position went wrong and the operation cannot be completed. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1303** | *PAYMENT_OPTION_NOT_EXTRACTABLE* | An error occurred while extracting a payment option from a payment position. This can be caused by a malformed payment position that does not have a payment option. Remember that a payment position in this flow must have one and only one payment option.\n**WIC-1400** | *RECEIPT_GENERATION_GENERIC_ERROR* | An error occurred while generating an RT (aka a receipt). An unhandled error occurred and it is impossible to complete the process. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1401** | *RECEIPT_GENERATION_WRONG_RESPONSE_FROM_CREDITOR_INSTITUTION* | An error occurred while generating an RT (aka a receipt). Specifically, the RT request is sent to creditor institution but this one responded with an invalid response from which is impossible to continue the analysis. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1402** | *RECEIPT_GENERATION_ERROR_RESPONSE_FROM_CREDITOR_INSTITUTION* | An error occurred while generating an RT (aka a receipt). Specifically, the RT request is sent to creditor institution but this one responded with an error response that explicit the occurred problem. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1403** | *RECEIPT_KO_NOT_SENT* | An error occurred while sending a negative RT (aka a KO receipt). So, no receipt can be sent lately to creditor institution and probably the process must be executed manually. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1404** | *RECEIPT_OK_NOT_SENT* | An error occurred while sending a positive RT (aka a OK receipt). So, no receipt can be sent lately to creditor institution and probably the process must be executed manually. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1405** | *RECEIPT_GENERATION_IDEMPOTENCY_LOCKED_BY_ANOTHER_PROCESS* | An error occurred while generating an RT (aka a receipt). Two or more generation processes are concurrently trying to execute the same operation on the same receipt but only one of them is currently 'authorized' to do so.\n**WIC-1406** | *RECEIPT_GENERATION_NOT_PROCESSABLE* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be started correctly because it is trying to lock the idempotency key that is already in a locked state. Probably the process is in execution by another thread.\n**WIC-1407** | *RECEIPT_GENERATION_ALREADY_PROCESSED* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be completed correctly because it is trying to unlock the idempotency key that is not in a locked state. Probably the process was already completed.\n**WIC-1408** | *RECEIPT_GENERATION_ANOMALY_ON_PROCESSING* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be completed correctly because there is a mismatch between the type of the cached receipt and the kind of request made for generate the same receipt. For example, the cached receipt is defined as negative paaInviaRT but the request was made to 'receipt/ok' endpoint. This is an anomaly that should never happens in a correct NMU flow execution but must be traced in case of error.\n**WIC-1409** | *RECEIPT_KO_NOT_GENERATED_BUT_MAYBE_RESCHEDULED* | An error occurred while generating a negative RT (aka a KO receipt). The receipt could be sent lately to creditor institution but for better understanding the cause, please use the Technical Support's APIs.\n**WIC-1410** | *RECEIPT_OK_NOT_GENERATED_BUT_MAYBE_RESCHEDULED* | An error occurred while generating a positive RT (aka a OK receipt). The receipt could be sent lately to creditor institution but for better understanding the cause, please use the Technical Support's APIs.\n**WIC-1411** | *RECEIPT_GENERATION_ERROR_DEAD_LETTER* | An error occurred while generating an RT (aka a receipt). Specifically, the creditor institution response status has not been recognized, for this reason the RT has been placed in the dead letter container.\n**WIC-2000** | *PERSISTENCE_SAVING_RE_ERROR* | An error occurred wile trying to store a new event in the Registro Eventi storage. The error is somewhat related to a persistence problem of the used storage and in the majority of the cases is temporary (maybe a 429 HTTP code). This error currently blocks the entire flow because that can lead to untraceable requests. For better understanding the cause, please execute a search in the log provider (Application Insights, Kibana, etc).\n**WIC-2001** | *PERSISTENCE_RPT_NOT_FOUND* | An error occurred while trying to retrieve the RPT content saved in storage by WISP SOAP Converter. This can be related either with the use of a wrong sessionId or a missed persistence from WISP SOAP Converter, so it is better to analyze the entire flow using Technical Support's APIs. This block totally the conversion of the RPTs in GPD's payment positions, so the whole process is discarded.\n**WIC-2002** | *PERSISTENCE_RT_NOT_FOUND* | An error occurred while trying to retrieve the RT content saved in storage by WISP Converter. This can be related either with the use of a wrong identifier, a missed persistence or an expired object, so it is better to analyze the entire flow using Technical Support's APIs.\n**WIC-2003** | *PERSISTENCE_REQUESTID_CACHING_ERROR* | An error occurred while trying to retrieve data from internal cache. Specifically, the cached key, defined in format wisp_nav2iuv__
\n", "termsOfService": "https://www.pagopa.gov.it/", "title": "WISP Converter", - "version": "0.4.11-2-PAGOPA-2221" + "version": "0.4.11-3-PAGOPA-2221" }, "servers": [ { diff --git a/openapi/openapi_redirect.json b/openapi/openapi_redirect.json index 9f82fcd7..601539d0 100644 --- a/openapi/openapi_redirect.json +++ b/openapi/openapi_redirect.json @@ -2,7 +2,7 @@ "openapi": "3.0.1", "info": { "title": "WISP-Converter-redirect", - "version": "0.4.11-2-PAGOPA-2221" + "version": "0.4.11-3-PAGOPA-2221" }, "servers": [ { diff --git a/pom.xml b/pom.xml index 6328ecc5..d575ba85 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ it.gov.pagopa wisp-converter - 0.4.11-2-PAGOPA-2221 + 0.4.11-3-PAGOPA-2221 pagoPA WISP Converter A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, converting them in NMU payments. From 73cc92b5b977fd0a36a8e0b3253bfc38654d6eb5 Mon Sep 17 00:00:00 2001 From: Jacopo Carlini Date: Thu, 17 Oct 2024 17:43:26 +0200 Subject: [PATCH 15/20] [PAGOPA-2221] fix --- docker/applicationinsights.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/applicationinsights.json b/docker/applicationinsights.json index d4c30dc1..05b7bb86 100644 --- a/docker/applicationinsights.json +++ b/docker/applicationinsights.json @@ -30,7 +30,7 @@ "matchType": "regexp" } ], - "percentage": 5 + "percentage": 0 }, { "telemetryType": "exception", From 1a47493a112c5e1e3de32efb48b7bbbc2e0218c6 Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Thu, 17 Oct 2024 15:44:52 +0000 Subject: [PATCH 16/20] Bump to version 0.4.11-4-PAGOPA-2221 [skip ci] --- helm/Chart.yaml | 4 ++-- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- openapi/openapi.json | 2 +- openapi/openapi_redirect.json | 2 +- pom.xml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 294cb4fc..ec4b899b 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-wisp-converter description: A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, interfacing them with GPD system type: application -version: 0.243.0 -appVersion: 0.4.11-3-PAGOPA-2221 +version: 0.244.0 +appVersion: 0.4.11-4-PAGOPA-2221 dependencies: - name: microservice-chart version: 3.0.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index d8bb1ec8..c31616f1 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "0.4.11-3-PAGOPA-2221" + tag: "0.4.11-4-PAGOPA-2221" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index a56f75d0..04337c0e 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "0.4.11-3-PAGOPA-2221" + tag: "0.4.11-4-PAGOPA-2221" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index fa01e0e3..82cabfa2 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "0.4.11-3-PAGOPA-2221" + tag: "0.4.11-4-PAGOPA-2221" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi/openapi.json b/openapi/openapi.json index f294f206..324cbcee 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "description": "A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, converting them in NMU payments.\n\n# OPERATIVE INFO\n\n\n## EVENT MAPPING IN RE\n\n
Details\nFIELD | SCOPE | DESCRIPTION\n- | - | -\n**requestId** | BOTH | The identifier, set by X-Request-ID, from which the events can be grouped.\n**operationId** | BOTH | The identifier associated to a request identifier\n**clientOperationId** | BOTH | The identifier that associate a client to an operation identifier.\n**component** | BOTH | The applicative component from which the event is generated.
In NDP it is mapped with field 'componente'.
Values:
_WISP_SOAP_CONVERTER_
_WISP_CONVERTER_\n**insertedTimestamp** | BOTH | The time on which the event is inserted in RE storage\n**eventCategory** | BOTH | The category on which the event can be grouped.
In NDP it is mapped with field 'categoriaEvento'.
Values:
_INTERFACE_
_INTERNAL_\n**eventSubcategory** | BOTH | The subcategory related to the specific nature of the event.
In NDP it is mapped with field 'sottoTipoEvento'.
Values:
_REQ_
_RESP_
_INTERN_\n**callType** | INTERFACE | The type of role that the application has in the communication with the remote endpoint.
Values:
_SERVER_
_CLIENT_\n**outcome** | INTERFACE | The outcome of the operation described by the event.
In NDP it is mapped with field 'esito'.
Values:
_SEND_: Correctly sent request to HTTP endpoint. In NDP it is mapped with value 'INVIATA'.
_SEND_FAILURE_: Failed to send request to HTTP endpoint. In NDP it is mapped with value 'INVIATA_KO'
_RECEIVED_: Received an OK response from HTTP endpoint. In NDP it is mapped with value 'RICEVUTA_KO'
_RECEIVED_FAILURE_: Received a failure response from endpoint. In NDP it is mapped with value 'RICEVUTA_KO'
_NEVER_RECEIVED_: Failed to receive response at all from endpoint. In NDP it is mapped with value 'NO_RICEVUTA'
_EXECUTED_INTERNAL_STEP_: Executed internal step on execution. In NDP it is mapped with value 'CAMBIO_STATO'\n**httpMethod** | INTERFACE | The HTTP method of the endpoint related to the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpUri** | INTERFACE | The URI related to the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpHeaders** | INTERFACE | The list of HTTP headers extracted from the request/response analyzed by the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpCallRemoteAddress** | INTERFACE | The remote IP address extracted from the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpStatusCode** | INTERFACE | The status code extracted from the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**executionTimeMs** | INTERFACE | The duration time of the invocation of the endpoint related to the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**compressedPayload** | INTERFACE | The payload of the request/response analyzed by the event.
This value is zipped using GZip compression algorithm.\n**compressedPayloadLength** | INTERFACE | The length (in number of characters) of the compressed payload.\n**businessProcess** | INTERFACE | The descriptive label associated to the endpoint called by user and related to the whole process.\n**operationStatus** | INTERFACE | The final status of the whole operation.
This is set only in the events that describe the response in output to user.\n**operationErrorTitle** | INTERFACE | The error title extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**operationErrorDetail** | INTERFACE | The error detail message extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**operationErrorCode** | INTERFACE | The error code extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**primitive** | INTERNAL | The typology of primitive analyzed and tracked by the event.
In NDP it is mapped with field 'eventType'.\n**sessionId** | INTERNAL | The session identifier generated by WISP SOAP Converter and used in the request.\n**cartId** | INTERNAL | The cart identifier used in the request.\n**iuv** | INTERNAL | The 'identificativo univoco pagamento' used in the request.\n**noticeNumber** | INTERNAL | The notice number (aka NAV code) used in the request.\n**domainId** | INTERNAL | The creditor institution identifier used in the request.\n**ccp** | INTERNAL | The 'codice contesto pagamento' used in the request.\n**psp** | INTERNAL | The payment service provider used in the request.\n**station** | INTERNAL | The station used in the request.\n**channel** | INTERNAL | The channel used in the request.\n**status** | INTERNAL | The state of the internal step executed.
Values:
_FOUND_RPT_IN_STORAGE_
_FOUND_RT_IN_STORAGE_
_EXTRACTED_DATA_FROM_RPT_
_CREATED_NEW_PAYMENT_POSITION_IN_GPD_
_GENERATED_NAV_FOR_NEW_PAYMENT_POSITION_
_UPDATED_EXISTING_PAYMENT_POSITION_IN_GPD_
_GENERATING_RT_FOR_INVALID_PAYMENT_POSITION_IN_GPD_
_GENERATING_RT_FOR_REDIRECT_ERROR_
_GENERATED_CACHE_ABOUT_RPT_FOR_DECOUPLER_
_GENERATED_CACHE_ABOUT_RPT_FOR_CARTSESSION_CACHING_
_GENERATED_CACHE_ABOUT_RPT_FOR_RT_GENERATION_
_SAVED_RPT_IN_CART_RECEIVED_REDIRECT_URL_FROM_CHECKOUT_
_RT_NOT_GENERABLE_FOR_GPD_STATION_
_RT_NOT_GENERABLE_FOR_NOT_EXISTING_PAYMENT_POSITION_
_NEGATIVE_RT_TRY_TO_SEND_TO_CREDITOR_INSTITUTION_
_POSITIVE_RT_TRY_TO_SEND_TO_CREDITOR_INSTITUTION_
_RT_SEND_SUCCESS_
_RT_SEND_FAILURE_
_RT_ALREADY_SENT_
_RT_SEND_SCHEDULING_SUCCESS_
_RT_SEND_SCHEDULING_FAILURE_
_RT_SCHEDULED_SEND_SUCCESS_
_RT_SCHEDULED_SEND_FAILURE_
_RT_SEND_RESCHEDULING_FAILURE_
_RT_SEND_RESCHEDULING_REACHED_MAX_RETRIES_
_RT_SEND_RESCHEDULING_SUCCESS_
_RT_START_RECONCILIATION_PROCESS_
_RT_END_RECONCILIATION_PROCESS_
_RT_DEAD_LETTER_SAVED_
_RT_DEAD_LETTER_FAILED_
_RECEIPT_TIMER_GENERATION_CREATED_SCHEDULED_SEND_
_RECEIPT_TIMER_GENERATION_CACHED_SEQUENCE_NUMBER_
_RECEIPT_TIMER_GENERATION_DELETED_SCHEDULED_SEND_
_RECEIPT_TIMER_GENERATION_SKIP_DELETE_SCHEDULED_SEND_
_RECEIPT_TIMER_PAYMENT_TOKEN_TIMEOUT_TRIGGER_
_ECOMMERCE_HANG_TIMER_TRIGGER_
_ECOMMERCE_HANG_TIMER_CREATED_
_ECOMMERCE_HANG_TIMER_DELETED_
_RPT_TIMER_TRIGGER_
_RPT_TIMER_CREATED_
_RPT_TIMER_DELETED_
_RPT_TIMER_NOT_SET_
_COMMUNICATING_WITH_GPD_REQUEST_
_COMMUNICATING_WITH_GPD_RESPONSE_
_COMMUNICATING_WITH_IUV_GENERATOR_REQUEST_
_COMMUNICATING_WITH_IUV_GENERATOR_RESPONSE_
_COMMUNICATING_WITH_CHECKOUT_REQUEST_
_COMMUNICATING_WITH_CHECKOUT_RESPONSE_
_COMMUNICATING_WITH_DECOUPLER_CACHING_REQUEST_
_COMMUNICATING_WITH_DECOUPLER_CACHING_RESPONSE_
_COMMUNICATING_WITH_CREDITOR_INSTITUTION_REQUEST_
_COMMUNICATING_WITH_CREDITOR_INSTITUTION_RESPONSE_\n**info** | INTERNAL | The other information that can be inserted for the tracing.\n**paymentToken** | INTERNAL | The payment token.\n\n
\n\n\n## OPERATIONAL ERROR CODES\n\n
Details\nNAME | CODE | DESCRIPTION\n- | - | -\n**WIC-500** | *ERROR* | A not documented generic error occurred while execution. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1000** | *GENERIC_ERROR* | A generic error occurred while executing conversion flow. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1001** | *PARSING_GENERIC_ERROR* | A generic error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1002** | *PARSING_INVALID_HEADER* | An error occurred while parsing of the content header, associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT.\n**WIC-1003** | *PARSING_INVALID_BODY* | An error occurred while parsing of the content payload, associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT.\n**WIC-1004** | *PARSING_INVALID_XML_NODES* | An error occurred while parsing of the of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The XML content extracted, either from payload or from header, is invalid because it is not possible to extract tag nodes from document. So, the document is probably empty.\n**WIC-1005** | *PARSING_INVALID_ZIPPED_PAYLOAD* | An error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The SOAP request analyzed and stored in dedicated storage is not usable for convert the debt positions in GPD system. This is probably due to an invalid conversion of the SOAP request via GZip algorithm executed before the same is stored in its storage.\n**WIC-1006** | *PARSING_RPT_PRIMITIVE_NOT_VALID* | An error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The primitive (the content related to header 'soapaction') cannot be handled by WISP Converter application in redirect process: only one of nodoInviaRPT and nodoInviaCarrelloRPT can be accepted.\n**WIC-1100** | *VALIDATION_INVALID_MULTIBENEFICIARY_CART* | An error occurred while analyzing the RPTs extracted from SOAP request. In particular, the request is arrived as nodoInviaCarrelloRPT as multi-beneficiary cart, but the number of RPTs in the request is lower than two, so it cannot be correctly handled as multi-beneficiary.\n**WIC-1101** | *VALIDATION_INVALID_IBANS* | An error occurred while analyzing the RPTs extracted from SOAP request. An IBAN must always be set in RPT transfers if they aren't related to digital stamps (which don't require an IBAN, because they will be reported to specific subject). In this case, in one or more RPT transfers not related to digital stamp, the IBAN is not correctly set.\n**WIC-1102** | *VALIDATION_INVALID_DEBTOR* | An error occurred while analyzing the RPTs extracted from SOAP request. In particular, in a cart there are different debtor subjects and this is not permitted for this flow. So, the whole cart is discarded.\n**WIC-1200** | *CONFIGURATION_INVALID_CACHE* | An error occurred while trying to access data from cached configuration. It is possible that the cache is not retrieved yet by this service or a corrupted configuration was returned from APIConfig Cache internal service. If this problem still occurs, please check the connectivity with APIConfig Cache.\n**WIC-1201** | *CONFIGURATION_INVALID_STATION* | An error occurred while retrieving data from local cached configuration. In particular, it is not possible to retrieve the configuration about the station because it does not exists in cache, and maybe also in general configuration. So, a change in whole configuration and/or a refresh on cache is required.\n**WIC-1202** | *CONFIGURATION_INVALID_CREDITOR_INSTITUTION_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the required station does not exists in cached configuration. So, a change in whole configuration and/or a refresh on cache is required.\n**WIC-1203** | *CONFIGURATION_INVALID_STATION_REDIRECT_URL* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration about redirection in error cases is not correctly set to points towards some creditor institution's endpoint. So, a change in configuration is required.\n**WIC-1204** | *CONFIGURATION_INVALID_STATION_SERVICE_URL* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is not correctly set to points towards GPD service endpoint for RT generator. So, a change in configuration is required.\n**WIC-1205** | *CONFIGURATION_NOT_GPD_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is not correctly set to points towards GPD service endpoint. So, a change in configuration is required.\n**WIC-1206** | *CONFIGURATION_INVALID_GPD_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is correctly set to points towards GPD service endpoint but uses the 'v1' primitive version (and it must use the 'v2' version). So, a change in configuration is required.\n**WIC-1207** | *CONFIGURATION_INVALID_STATION_PROXY* | An error occurred while checking the station that will be used for the receipt send process. In particular, analyzing the station it turns out that the configuration is not correctly set to configure proxy structure for RT generator. So, a change in configuration is required.\n**WIC-1300** | *PAYMENT_POSITION_NOT_IN_PAYABLE_STATE* | An error occurred while checking an existing payment position. One or more RPTs extracted from the request refers to existing payment positions in GPD that have a state from which it is impossible to execute a payment flow. If the execution of this flow is related to a RPT cart, all the payments that can be retrieved or generated ex novo from those RPTs are declared as atomically invalid (if one RPT in cart is bad, all RPTs in cart are bad) and not payable with this flow.\n**WIC-1301** | *PAYMENT_POSITION_IN_INCONSISTENT_STATE* | An error occurred while checking an existing payment position in GPD system. The retrieved payment position, previously inserted in GPD by this same flow or by other procedures, is in an invalid state, not mappable to an existing value. This can be related to a wrong setting in GPD or a corruption of the retrieved data.\n**WIC-1302** | *PAYMENT_POSITION_NOT_VALID* | An error occurred while generating a payment position. In particular, something during the generation of a new payment position or the analysis of an existing payment position went wrong and the operation cannot be completed. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1303** | *PAYMENT_OPTION_NOT_EXTRACTABLE* | An error occurred while extracting a payment option from a payment position. This can be caused by a malformed payment position that does not have a payment option. Remember that a payment position in this flow must have one and only one payment option.\n**WIC-1400** | *RECEIPT_GENERATION_GENERIC_ERROR* | An error occurred while generating an RT (aka a receipt). An unhandled error occurred and it is impossible to complete the process. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1401** | *RECEIPT_GENERATION_WRONG_RESPONSE_FROM_CREDITOR_INSTITUTION* | An error occurred while generating an RT (aka a receipt). Specifically, the RT request is sent to creditor institution but this one responded with an invalid response from which is impossible to continue the analysis. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1402** | *RECEIPT_GENERATION_ERROR_RESPONSE_FROM_CREDITOR_INSTITUTION* | An error occurred while generating an RT (aka a receipt). Specifically, the RT request is sent to creditor institution but this one responded with an error response that explicit the occurred problem. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1403** | *RECEIPT_KO_NOT_SENT* | An error occurred while sending a negative RT (aka a KO receipt). So, no receipt can be sent lately to creditor institution and probably the process must be executed manually. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1404** | *RECEIPT_OK_NOT_SENT* | An error occurred while sending a positive RT (aka a OK receipt). So, no receipt can be sent lately to creditor institution and probably the process must be executed manually. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1405** | *RECEIPT_GENERATION_IDEMPOTENCY_LOCKED_BY_ANOTHER_PROCESS* | An error occurred while generating an RT (aka a receipt). Two or more generation processes are concurrently trying to execute the same operation on the same receipt but only one of them is currently 'authorized' to do so.\n**WIC-1406** | *RECEIPT_GENERATION_NOT_PROCESSABLE* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be started correctly because it is trying to lock the idempotency key that is already in a locked state. Probably the process is in execution by another thread.\n**WIC-1407** | *RECEIPT_GENERATION_ALREADY_PROCESSED* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be completed correctly because it is trying to unlock the idempotency key that is not in a locked state. Probably the process was already completed.\n**WIC-1408** | *RECEIPT_GENERATION_ANOMALY_ON_PROCESSING* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be completed correctly because there is a mismatch between the type of the cached receipt and the kind of request made for generate the same receipt. For example, the cached receipt is defined as negative paaInviaRT but the request was made to 'receipt/ok' endpoint. This is an anomaly that should never happens in a correct NMU flow execution but must be traced in case of error.\n**WIC-1409** | *RECEIPT_KO_NOT_GENERATED_BUT_MAYBE_RESCHEDULED* | An error occurred while generating a negative RT (aka a KO receipt). The receipt could be sent lately to creditor institution but for better understanding the cause, please use the Technical Support's APIs.\n**WIC-1410** | *RECEIPT_OK_NOT_GENERATED_BUT_MAYBE_RESCHEDULED* | An error occurred while generating a positive RT (aka a OK receipt). The receipt could be sent lately to creditor institution but for better understanding the cause, please use the Technical Support's APIs.\n**WIC-1411** | *RECEIPT_GENERATION_ERROR_DEAD_LETTER* | An error occurred while generating an RT (aka a receipt). Specifically, the creditor institution response status has not been recognized, for this reason the RT has been placed in the dead letter container.\n**WIC-2000** | *PERSISTENCE_SAVING_RE_ERROR* | An error occurred wile trying to store a new event in the Registro Eventi storage. The error is somewhat related to a persistence problem of the used storage and in the majority of the cases is temporary (maybe a 429 HTTP code). This error currently blocks the entire flow because that can lead to untraceable requests. For better understanding the cause, please execute a search in the log provider (Application Insights, Kibana, etc).\n**WIC-2001** | *PERSISTENCE_RPT_NOT_FOUND* | An error occurred while trying to retrieve the RPT content saved in storage by WISP SOAP Converter. This can be related either with the use of a wrong sessionId or a missed persistence from WISP SOAP Converter, so it is better to analyze the entire flow using Technical Support's APIs. This block totally the conversion of the RPTs in GPD's payment positions, so the whole process is discarded.\n**WIC-2002** | *PERSISTENCE_RT_NOT_FOUND* | An error occurred while trying to retrieve the RT content saved in storage by WISP Converter. This can be related either with the use of a wrong identifier, a missed persistence or an expired object, so it is better to analyze the entire flow using Technical Support's APIs.\n**WIC-2003** | *PERSISTENCE_REQUESTID_CACHING_ERROR* | An error occurred while trying to retrieve data from internal cache. Specifically, the cached key, defined in format wisp_nav2iuv__
\n", "termsOfService": "https://www.pagopa.gov.it/", "title": "WISP Converter", - "version": "0.4.11-3-PAGOPA-2221" + "version": "0.4.11-4-PAGOPA-2221" }, "servers": [ { diff --git a/openapi/openapi_redirect.json b/openapi/openapi_redirect.json index 601539d0..2de22f07 100644 --- a/openapi/openapi_redirect.json +++ b/openapi/openapi_redirect.json @@ -2,7 +2,7 @@ "openapi": "3.0.1", "info": { "title": "WISP-Converter-redirect", - "version": "0.4.11-3-PAGOPA-2221" + "version": "0.4.11-4-PAGOPA-2221" }, "servers": [ { diff --git a/pom.xml b/pom.xml index d575ba85..3b8fc08f 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ it.gov.pagopa wisp-converter - 0.4.11-3-PAGOPA-2221 + 0.4.11-4-PAGOPA-2221 pagoPA WISP Converter A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, converting them in NMU payments. From faa91d3a360ab4f92fab0cac2298f0e299c1052f Mon Sep 17 00:00:00 2001 From: Jacopo Carlini Date: Thu, 17 Oct 2024 18:10:12 +0200 Subject: [PATCH 17/20] [PAGOPA-2221] fix --- docker/applicationinsights.json | 13 +----------- .../wispconverter/config/LoggingAspect.java | 21 +++++++------------ .../controller/RPTTimerController.java | 4 ++-- .../controller/ReceiptController.java | 6 +++--- .../controller/ReceiptTimerController.java | 4 ++-- .../controller/RecoveryController.java | 8 +++---- .../controller/RedirectController.java | 2 +- 7 files changed, 21 insertions(+), 37 deletions(-) diff --git a/docker/applicationinsights.json b/docker/applicationinsights.json index 05b7bb86..d718daad 100644 --- a/docker/applicationinsights.json +++ b/docker/applicationinsights.json @@ -4,7 +4,7 @@ "level": "INFO" }, "sampling": { - "percentage": 5, + "percentage": 0, "overrides": [ { "telemetryType": "dependency", @@ -21,17 +21,6 @@ ], "percentage": 100 }, - { - "telemetryType": "trace", - "attributes": [ - { - "key": "message", - "value": "^(?!Invoking API operation).*", - "matchType": "regexp" - } - ], - "percentage": 0 - }, { "telemetryType": "exception", "percentage": 100 diff --git a/src/main/java/it/gov/pagopa/wispconverter/config/LoggingAspect.java b/src/main/java/it/gov/pagopa/wispconverter/config/LoggingAspect.java index 726ea29f..38fd3191 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/config/LoggingAspect.java +++ b/src/main/java/it/gov/pagopa/wispconverter/config/LoggingAspect.java @@ -2,13 +2,18 @@ import static it.gov.pagopa.wispconverter.util.CommonUtility.deNull; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import it.gov.pagopa.wispconverter.exception.AppErrorCodeMessageEnum; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.xml.bind.JAXBElement; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; import java.util.UUID; - import javax.annotation.PostConstruct; - +import lombok.extern.slf4j.Slf4j; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.AfterReturning; @@ -23,16 +28,6 @@ import org.springframework.stereotype.Component; import org.springframework.web.ErrorResponse; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -import it.gov.pagopa.wispconverter.exception.AppErrorCodeMessageEnum; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.xml.bind.JAXBElement; -import lombok.extern.slf4j.Slf4j; - - @Aspect @Component @Slf4j @@ -144,7 +139,7 @@ public Object logApiInvocation(ProceedingJoinPoint joinPoint) throws Throwable { Map params = getParams(joinPoint); MDC.put(ARGS, params.toString()); - log.info("Invoking API operation {} - args: {}", joinPoint.getSignature().getName(), params); + log.info("Invoking API operation{} - args: {}", joinPoint.getSignature().getName(), params); Object result = joinPoint.proceed(); diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/RPTTimerController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/RPTTimerController.java index 1b9cbad4..e0c990ad 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/RPTTimerController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/RPTTimerController.java @@ -51,7 +51,7 @@ public class RPTTimerController { @Trace(businessProcess = RPT_BP_TIMER_SET, reEnabled = true) public void createTimer(@RequestBody RPTTimerRequest request) { try { - log.info("Invoking API operation createRPTTimer - args: {}", request.toString()); + log.debug("Invoking API operationcreateRPTTimer - args: {}", request.toString()); rptTimerService.sendMessage(request); log.debug("Successful API operation createRPTTimer"); } catch (Exception ex) { @@ -77,7 +77,7 @@ public void createTimer(@RequestBody RPTTimerRequest request) { @Trace(businessProcess = RPT_BP_TIMER_DELETE, reEnabled = true) public void deleteTimer(@RequestParam() String sessionId) { try { - log.info("Invoking API operation deleteRPTTimer - args: {}", sanitizeInput(sessionId)); + log.debug("Invoking API operationdeleteRPTTimer - args: {}", sanitizeInput(sessionId)); rptTimerService.cancelScheduledMessage(sessionId); log.debug("Successful API operation deleteRPTTimer"); } catch (Exception ex) { diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java index 2c123ce6..1f7a7a06 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptController.java @@ -76,7 +76,7 @@ public class ReceiptController { @Trace(businessProcess = BP_RECEIPT_RETRIEVE, reEnabled = true) public ResponseEntity receiptRetrieve(@QueryParam("ci") String ci, @QueryParam("ccp") String ccp, @QueryParam("iuv") String iuv) { try { - log.info("Invoking API operation receiptRetrieve - ci: {}, ccp: {}, iuv: {}", sanitizeInput(ci), sanitizeInput(ccp), sanitizeInput(iuv)); + log.debug("Invoking API operationreceiptRetrieve - ci: {}, ccp: {}, iuv: {}", sanitizeInput(ci), sanitizeInput(ccp), sanitizeInput(iuv)); if(rtReceiptCosmosService.receiptRtExist(ci, iuv, ccp)) return ResponseEntity.ok(""); else return ResponseEntity.notFound().build(); @@ -106,7 +106,7 @@ public ResponseEntity receiptRetrieve(@QueryParam("ci") String ci, @Quer public void receiptKo(@RequestBody String request) throws Exception { try { - log.info("Invoking API operation receiptKo - args: {}", request); + log.debug("Invoking API operationreceiptKo - args: {}", request); receiptService.sendKoPaaInviaRtToCreditorInstitution(List.of(mapper.readValue(request, ReceiptDto.class)).toString()); log.debug("Successful API operation receiptKo"); } catch (Exception ex) { @@ -133,7 +133,7 @@ public void receiptKo(@RequestBody String request) throws Exception { public void receiptOk(@RequestBody ReceiptRequest request) throws IOException { try { - log.info("Invoking API operation receiptOk - args: {}", this.getReceiptRequestInfoToLog(request.getContent())); + log.debug("Invoking API operationreceiptOk - args: {}", this.getReceiptRequestInfoToLog(request.getContent())); receiptService.sendOkPaaInviaRtToCreditorInstitution(request.getContent()); log.debug("Successful API operation receiptOk"); } catch (Exception ex) { diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java index b0e3f29c..661af047 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/ReceiptTimerController.java @@ -54,7 +54,7 @@ public class ReceiptTimerController { @Trace(businessProcess = BP_TIMER_SET, reEnabled = true) public void createTimer(@RequestBody ReceiptTimerRequest request) { try { - log.info("Invoking API operation createTimer - args: {}", request.toString()); + log.debug("Invoking API operationcreateTimer - args: {}", request.toString()); receiptTimerService.sendMessage(request); log.debug("Successful API operation createTimer"); } catch (Exception ex) { @@ -79,7 +79,7 @@ public void createTimer(@RequestBody ReceiptTimerRequest request) { @Trace(businessProcess = BP_TIMER_DELETE, reEnabled = true) public void deleteTimer(@RequestParam() String paymentTokens) { try { - log.info("Invoking API operation deleteTimer - args: {}", sanitizeInput(paymentTokens)); + log.debug("Invoking API operationdeleteTimer - args: {}", sanitizeInput(paymentTokens)); List tokens = Arrays.asList(paymentTokens.split(",")); receiptTimerService.cancelScheduledMessage(tokens); log.debug("Successful API operation deleteTimer"); diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java index 4240812b..cedf84ac 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/RecoveryController.java @@ -45,7 +45,7 @@ public class RecoveryController { @PostMapping(value = "/{creditor_institution}/receipt-ko") public ResponseEntity recoverReceiptKOForCreditorInstitution(@PathVariable("creditor_institution") String ci, @QueryParam("date_from") String dateFrom, @QueryParam("date_to") String dateTo) { try { - log.info("Invoking API operation recoverReceiptKOForCreditorInstitution - args: {} {} {}", + log.debug("Invoking API operationrecoverReceiptKOForCreditorInstitution - args: {} {} {}", sanitizeInput(ci), dateFrom, dateTo); RecoveryReceiptResponse response = recoveryService.recoverReceiptKOByCI(ci, dateFrom, dateTo); return ResponseEntity.ok(response); @@ -73,7 +73,7 @@ public ResponseEntity recoverReceiptKOForCreditorInstit @Pattern(regexp = "[a-zA-Z0-9_-]{1,10}") @QueryParam("date_from") String dateFrom, @Pattern(regexp = "[a-zA-Z0-9_-]{1,10}") @QueryParam("date_to") String dateTo) { try { - log.info("Invoking API operation recoverReceiptKOForCreditorInstitution - args: {} {} {} {}", + log.debug("Invoking API operationrecoverReceiptKOForCreditorInstitution - args: {} {} {} {}", sanitizeInput(ci), sanitizeInput(iuv), dateFrom, dateTo); RecoveryReceiptResponse recoveryReceiptResponse = recoveryService.recoverReceiptKOByIUV(ci, iuv, dateFrom, dateTo); @@ -102,7 +102,7 @@ public ResponseEntity recoverReceiptKOForCreditorInstit @PostMapping(value = "/receipts") public ResponseEntity recoverReceiptToBeReSent(@RequestBody RecoveryReceiptRequest request) { try { - log.info("Invoking API operation recoverReceiptToBeReSent - args: {}", request.toString()); + log.debug("Invoking API operationrecoverReceiptToBeReSent - args: {}", request.toString()); return ResponseEntity.ok(recoveryService.recoverReceiptToBeReSent(request)); } catch (Exception ex) { String operationId = MDC.get(Constants.MDC_OPERATION_ID); @@ -121,7 +121,7 @@ public ResponseEntity recoverReceiptToBeReSent(@R @PostMapping(value = "/partitions") public ResponseEntity recoverReceiptToBeReSentByPartition(@RequestBody RecoveryReceiptByPartitionRequest request) { try { - log.info("Invoking API operation recoverReceiptToBeReSentByPartition - args: {}", request.toString()); + log.debug("Invoking API operationrecoverReceiptToBeReSentByPartition - args: {}", request.toString()); return ResponseEntity.ok(recoveryService.recoverReceiptToBeReSentByPartition(request)); } catch (Exception ex) { String operationId = MDC.get(Constants.MDC_OPERATION_ID); diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/RedirectController.java b/src/main/java/it/gov/pagopa/wispconverter/controller/RedirectController.java index 3a4ab679..fb9d08e9 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/controller/RedirectController.java +++ b/src/main/java/it/gov/pagopa/wispconverter/controller/RedirectController.java @@ -53,7 +53,7 @@ public String redirect(@Parameter(description = "", example = "identificativoInt @RequestParam("idSession") String idSession, HttpServletResponse response) { try { - log.info("Invoking API operation redirect - args: {}", idSession.matches("[\\w\\-]*") ? idSession : "..."); + log.debug("Invoking API operationredirect - args: {}", idSession.matches("[\\w\\-]*") ? idSession : "..."); String redirectURI = converterService.convert(idSession); log.debug("Successful API operation redirect - result: {}", redirectURI); return "redirect:" + redirectURI; From cfe56818f14557d705695e6581d4650893ac8d64 Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Thu, 17 Oct 2024 16:14:09 +0000 Subject: [PATCH 18/20] Bump to version 0.4.11-5-PAGOPA-2221 [skip ci] --- helm/Chart.yaml | 4 ++-- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- openapi/openapi.json | 2 +- openapi/openapi_redirect.json | 2 +- pom.xml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index ec4b899b..96a2ccef 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-wisp-converter description: A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, interfacing them with GPD system type: application -version: 0.244.0 -appVersion: 0.4.11-4-PAGOPA-2221 +version: 0.245.0 +appVersion: 0.4.11-5-PAGOPA-2221 dependencies: - name: microservice-chart version: 3.0.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index c31616f1..c053f490 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "0.4.11-4-PAGOPA-2221" + tag: "0.4.11-5-PAGOPA-2221" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 04337c0e..5d5b1adb 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "0.4.11-4-PAGOPA-2221" + tag: "0.4.11-5-PAGOPA-2221" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 82cabfa2..cf88466b 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "0.4.11-4-PAGOPA-2221" + tag: "0.4.11-5-PAGOPA-2221" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi/openapi.json b/openapi/openapi.json index 324cbcee..7a4d83f3 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "description": "A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, converting them in NMU payments.\n\n# OPERATIVE INFO\n\n\n## EVENT MAPPING IN RE\n\n
Details\nFIELD | SCOPE | DESCRIPTION\n- | - | -\n**requestId** | BOTH | The identifier, set by X-Request-ID, from which the events can be grouped.\n**operationId** | BOTH | The identifier associated to a request identifier\n**clientOperationId** | BOTH | The identifier that associate a client to an operation identifier.\n**component** | BOTH | The applicative component from which the event is generated.
In NDP it is mapped with field 'componente'.
Values:
_WISP_SOAP_CONVERTER_
_WISP_CONVERTER_\n**insertedTimestamp** | BOTH | The time on which the event is inserted in RE storage\n**eventCategory** | BOTH | The category on which the event can be grouped.
In NDP it is mapped with field 'categoriaEvento'.
Values:
_INTERFACE_
_INTERNAL_\n**eventSubcategory** | BOTH | The subcategory related to the specific nature of the event.
In NDP it is mapped with field 'sottoTipoEvento'.
Values:
_REQ_
_RESP_
_INTERN_\n**callType** | INTERFACE | The type of role that the application has in the communication with the remote endpoint.
Values:
_SERVER_
_CLIENT_\n**outcome** | INTERFACE | The outcome of the operation described by the event.
In NDP it is mapped with field 'esito'.
Values:
_SEND_: Correctly sent request to HTTP endpoint. In NDP it is mapped with value 'INVIATA'.
_SEND_FAILURE_: Failed to send request to HTTP endpoint. In NDP it is mapped with value 'INVIATA_KO'
_RECEIVED_: Received an OK response from HTTP endpoint. In NDP it is mapped with value 'RICEVUTA_KO'
_RECEIVED_FAILURE_: Received a failure response from endpoint. In NDP it is mapped with value 'RICEVUTA_KO'
_NEVER_RECEIVED_: Failed to receive response at all from endpoint. In NDP it is mapped with value 'NO_RICEVUTA'
_EXECUTED_INTERNAL_STEP_: Executed internal step on execution. In NDP it is mapped with value 'CAMBIO_STATO'\n**httpMethod** | INTERFACE | The HTTP method of the endpoint related to the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpUri** | INTERFACE | The URI related to the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpHeaders** | INTERFACE | The list of HTTP headers extracted from the request/response analyzed by the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpCallRemoteAddress** | INTERFACE | The remote IP address extracted from the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpStatusCode** | INTERFACE | The status code extracted from the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**executionTimeMs** | INTERFACE | The duration time of the invocation of the endpoint related to the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**compressedPayload** | INTERFACE | The payload of the request/response analyzed by the event.
This value is zipped using GZip compression algorithm.\n**compressedPayloadLength** | INTERFACE | The length (in number of characters) of the compressed payload.\n**businessProcess** | INTERFACE | The descriptive label associated to the endpoint called by user and related to the whole process.\n**operationStatus** | INTERFACE | The final status of the whole operation.
This is set only in the events that describe the response in output to user.\n**operationErrorTitle** | INTERFACE | The error title extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**operationErrorDetail** | INTERFACE | The error detail message extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**operationErrorCode** | INTERFACE | The error code extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**primitive** | INTERNAL | The typology of primitive analyzed and tracked by the event.
In NDP it is mapped with field 'eventType'.\n**sessionId** | INTERNAL | The session identifier generated by WISP SOAP Converter and used in the request.\n**cartId** | INTERNAL | The cart identifier used in the request.\n**iuv** | INTERNAL | The 'identificativo univoco pagamento' used in the request.\n**noticeNumber** | INTERNAL | The notice number (aka NAV code) used in the request.\n**domainId** | INTERNAL | The creditor institution identifier used in the request.\n**ccp** | INTERNAL | The 'codice contesto pagamento' used in the request.\n**psp** | INTERNAL | The payment service provider used in the request.\n**station** | INTERNAL | The station used in the request.\n**channel** | INTERNAL | The channel used in the request.\n**status** | INTERNAL | The state of the internal step executed.
Values:
_FOUND_RPT_IN_STORAGE_
_FOUND_RT_IN_STORAGE_
_EXTRACTED_DATA_FROM_RPT_
_CREATED_NEW_PAYMENT_POSITION_IN_GPD_
_GENERATED_NAV_FOR_NEW_PAYMENT_POSITION_
_UPDATED_EXISTING_PAYMENT_POSITION_IN_GPD_
_GENERATING_RT_FOR_INVALID_PAYMENT_POSITION_IN_GPD_
_GENERATING_RT_FOR_REDIRECT_ERROR_
_GENERATED_CACHE_ABOUT_RPT_FOR_DECOUPLER_
_GENERATED_CACHE_ABOUT_RPT_FOR_CARTSESSION_CACHING_
_GENERATED_CACHE_ABOUT_RPT_FOR_RT_GENERATION_
_SAVED_RPT_IN_CART_RECEIVED_REDIRECT_URL_FROM_CHECKOUT_
_RT_NOT_GENERABLE_FOR_GPD_STATION_
_RT_NOT_GENERABLE_FOR_NOT_EXISTING_PAYMENT_POSITION_
_NEGATIVE_RT_TRY_TO_SEND_TO_CREDITOR_INSTITUTION_
_POSITIVE_RT_TRY_TO_SEND_TO_CREDITOR_INSTITUTION_
_RT_SEND_SUCCESS_
_RT_SEND_FAILURE_
_RT_ALREADY_SENT_
_RT_SEND_SCHEDULING_SUCCESS_
_RT_SEND_SCHEDULING_FAILURE_
_RT_SCHEDULED_SEND_SUCCESS_
_RT_SCHEDULED_SEND_FAILURE_
_RT_SEND_RESCHEDULING_FAILURE_
_RT_SEND_RESCHEDULING_REACHED_MAX_RETRIES_
_RT_SEND_RESCHEDULING_SUCCESS_
_RT_START_RECONCILIATION_PROCESS_
_RT_END_RECONCILIATION_PROCESS_
_RT_DEAD_LETTER_SAVED_
_RT_DEAD_LETTER_FAILED_
_RECEIPT_TIMER_GENERATION_CREATED_SCHEDULED_SEND_
_RECEIPT_TIMER_GENERATION_CACHED_SEQUENCE_NUMBER_
_RECEIPT_TIMER_GENERATION_DELETED_SCHEDULED_SEND_
_RECEIPT_TIMER_GENERATION_SKIP_DELETE_SCHEDULED_SEND_
_RECEIPT_TIMER_PAYMENT_TOKEN_TIMEOUT_TRIGGER_
_ECOMMERCE_HANG_TIMER_TRIGGER_
_ECOMMERCE_HANG_TIMER_CREATED_
_ECOMMERCE_HANG_TIMER_DELETED_
_RPT_TIMER_TRIGGER_
_RPT_TIMER_CREATED_
_RPT_TIMER_DELETED_
_RPT_TIMER_NOT_SET_
_COMMUNICATING_WITH_GPD_REQUEST_
_COMMUNICATING_WITH_GPD_RESPONSE_
_COMMUNICATING_WITH_IUV_GENERATOR_REQUEST_
_COMMUNICATING_WITH_IUV_GENERATOR_RESPONSE_
_COMMUNICATING_WITH_CHECKOUT_REQUEST_
_COMMUNICATING_WITH_CHECKOUT_RESPONSE_
_COMMUNICATING_WITH_DECOUPLER_CACHING_REQUEST_
_COMMUNICATING_WITH_DECOUPLER_CACHING_RESPONSE_
_COMMUNICATING_WITH_CREDITOR_INSTITUTION_REQUEST_
_COMMUNICATING_WITH_CREDITOR_INSTITUTION_RESPONSE_\n**info** | INTERNAL | The other information that can be inserted for the tracing.\n**paymentToken** | INTERNAL | The payment token.\n\n
\n\n\n## OPERATIONAL ERROR CODES\n\n
Details\nNAME | CODE | DESCRIPTION\n- | - | -\n**WIC-500** | *ERROR* | A not documented generic error occurred while execution. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1000** | *GENERIC_ERROR* | A generic error occurred while executing conversion flow. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1001** | *PARSING_GENERIC_ERROR* | A generic error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1002** | *PARSING_INVALID_HEADER* | An error occurred while parsing of the content header, associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT.\n**WIC-1003** | *PARSING_INVALID_BODY* | An error occurred while parsing of the content payload, associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT.\n**WIC-1004** | *PARSING_INVALID_XML_NODES* | An error occurred while parsing of the of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The XML content extracted, either from payload or from header, is invalid because it is not possible to extract tag nodes from document. So, the document is probably empty.\n**WIC-1005** | *PARSING_INVALID_ZIPPED_PAYLOAD* | An error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The SOAP request analyzed and stored in dedicated storage is not usable for convert the debt positions in GPD system. This is probably due to an invalid conversion of the SOAP request via GZip algorithm executed before the same is stored in its storage.\n**WIC-1006** | *PARSING_RPT_PRIMITIVE_NOT_VALID* | An error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The primitive (the content related to header 'soapaction') cannot be handled by WISP Converter application in redirect process: only one of nodoInviaRPT and nodoInviaCarrelloRPT can be accepted.\n**WIC-1100** | *VALIDATION_INVALID_MULTIBENEFICIARY_CART* | An error occurred while analyzing the RPTs extracted from SOAP request. In particular, the request is arrived as nodoInviaCarrelloRPT as multi-beneficiary cart, but the number of RPTs in the request is lower than two, so it cannot be correctly handled as multi-beneficiary.\n**WIC-1101** | *VALIDATION_INVALID_IBANS* | An error occurred while analyzing the RPTs extracted from SOAP request. An IBAN must always be set in RPT transfers if they aren't related to digital stamps (which don't require an IBAN, because they will be reported to specific subject). In this case, in one or more RPT transfers not related to digital stamp, the IBAN is not correctly set.\n**WIC-1102** | *VALIDATION_INVALID_DEBTOR* | An error occurred while analyzing the RPTs extracted from SOAP request. In particular, in a cart there are different debtor subjects and this is not permitted for this flow. So, the whole cart is discarded.\n**WIC-1200** | *CONFIGURATION_INVALID_CACHE* | An error occurred while trying to access data from cached configuration. It is possible that the cache is not retrieved yet by this service or a corrupted configuration was returned from APIConfig Cache internal service. If this problem still occurs, please check the connectivity with APIConfig Cache.\n**WIC-1201** | *CONFIGURATION_INVALID_STATION* | An error occurred while retrieving data from local cached configuration. In particular, it is not possible to retrieve the configuration about the station because it does not exists in cache, and maybe also in general configuration. So, a change in whole configuration and/or a refresh on cache is required.\n**WIC-1202** | *CONFIGURATION_INVALID_CREDITOR_INSTITUTION_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the required station does not exists in cached configuration. So, a change in whole configuration and/or a refresh on cache is required.\n**WIC-1203** | *CONFIGURATION_INVALID_STATION_REDIRECT_URL* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration about redirection in error cases is not correctly set to points towards some creditor institution's endpoint. So, a change in configuration is required.\n**WIC-1204** | *CONFIGURATION_INVALID_STATION_SERVICE_URL* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is not correctly set to points towards GPD service endpoint for RT generator. So, a change in configuration is required.\n**WIC-1205** | *CONFIGURATION_NOT_GPD_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is not correctly set to points towards GPD service endpoint. So, a change in configuration is required.\n**WIC-1206** | *CONFIGURATION_INVALID_GPD_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is correctly set to points towards GPD service endpoint but uses the 'v1' primitive version (and it must use the 'v2' version). So, a change in configuration is required.\n**WIC-1207** | *CONFIGURATION_INVALID_STATION_PROXY* | An error occurred while checking the station that will be used for the receipt send process. In particular, analyzing the station it turns out that the configuration is not correctly set to configure proxy structure for RT generator. So, a change in configuration is required.\n**WIC-1300** | *PAYMENT_POSITION_NOT_IN_PAYABLE_STATE* | An error occurred while checking an existing payment position. One or more RPTs extracted from the request refers to existing payment positions in GPD that have a state from which it is impossible to execute a payment flow. If the execution of this flow is related to a RPT cart, all the payments that can be retrieved or generated ex novo from those RPTs are declared as atomically invalid (if one RPT in cart is bad, all RPTs in cart are bad) and not payable with this flow.\n**WIC-1301** | *PAYMENT_POSITION_IN_INCONSISTENT_STATE* | An error occurred while checking an existing payment position in GPD system. The retrieved payment position, previously inserted in GPD by this same flow or by other procedures, is in an invalid state, not mappable to an existing value. This can be related to a wrong setting in GPD or a corruption of the retrieved data.\n**WIC-1302** | *PAYMENT_POSITION_NOT_VALID* | An error occurred while generating a payment position. In particular, something during the generation of a new payment position or the analysis of an existing payment position went wrong and the operation cannot be completed. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1303** | *PAYMENT_OPTION_NOT_EXTRACTABLE* | An error occurred while extracting a payment option from a payment position. This can be caused by a malformed payment position that does not have a payment option. Remember that a payment position in this flow must have one and only one payment option.\n**WIC-1400** | *RECEIPT_GENERATION_GENERIC_ERROR* | An error occurred while generating an RT (aka a receipt). An unhandled error occurred and it is impossible to complete the process. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1401** | *RECEIPT_GENERATION_WRONG_RESPONSE_FROM_CREDITOR_INSTITUTION* | An error occurred while generating an RT (aka a receipt). Specifically, the RT request is sent to creditor institution but this one responded with an invalid response from which is impossible to continue the analysis. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1402** | *RECEIPT_GENERATION_ERROR_RESPONSE_FROM_CREDITOR_INSTITUTION* | An error occurred while generating an RT (aka a receipt). Specifically, the RT request is sent to creditor institution but this one responded with an error response that explicit the occurred problem. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1403** | *RECEIPT_KO_NOT_SENT* | An error occurred while sending a negative RT (aka a KO receipt). So, no receipt can be sent lately to creditor institution and probably the process must be executed manually. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1404** | *RECEIPT_OK_NOT_SENT* | An error occurred while sending a positive RT (aka a OK receipt). So, no receipt can be sent lately to creditor institution and probably the process must be executed manually. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1405** | *RECEIPT_GENERATION_IDEMPOTENCY_LOCKED_BY_ANOTHER_PROCESS* | An error occurred while generating an RT (aka a receipt). Two or more generation processes are concurrently trying to execute the same operation on the same receipt but only one of them is currently 'authorized' to do so.\n**WIC-1406** | *RECEIPT_GENERATION_NOT_PROCESSABLE* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be started correctly because it is trying to lock the idempotency key that is already in a locked state. Probably the process is in execution by another thread.\n**WIC-1407** | *RECEIPT_GENERATION_ALREADY_PROCESSED* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be completed correctly because it is trying to unlock the idempotency key that is not in a locked state. Probably the process was already completed.\n**WIC-1408** | *RECEIPT_GENERATION_ANOMALY_ON_PROCESSING* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be completed correctly because there is a mismatch between the type of the cached receipt and the kind of request made for generate the same receipt. For example, the cached receipt is defined as negative paaInviaRT but the request was made to 'receipt/ok' endpoint. This is an anomaly that should never happens in a correct NMU flow execution but must be traced in case of error.\n**WIC-1409** | *RECEIPT_KO_NOT_GENERATED_BUT_MAYBE_RESCHEDULED* | An error occurred while generating a negative RT (aka a KO receipt). The receipt could be sent lately to creditor institution but for better understanding the cause, please use the Technical Support's APIs.\n**WIC-1410** | *RECEIPT_OK_NOT_GENERATED_BUT_MAYBE_RESCHEDULED* | An error occurred while generating a positive RT (aka a OK receipt). The receipt could be sent lately to creditor institution but for better understanding the cause, please use the Technical Support's APIs.\n**WIC-1411** | *RECEIPT_GENERATION_ERROR_DEAD_LETTER* | An error occurred while generating an RT (aka a receipt). Specifically, the creditor institution response status has not been recognized, for this reason the RT has been placed in the dead letter container.\n**WIC-2000** | *PERSISTENCE_SAVING_RE_ERROR* | An error occurred wile trying to store a new event in the Registro Eventi storage. The error is somewhat related to a persistence problem of the used storage and in the majority of the cases is temporary (maybe a 429 HTTP code). This error currently blocks the entire flow because that can lead to untraceable requests. For better understanding the cause, please execute a search in the log provider (Application Insights, Kibana, etc).\n**WIC-2001** | *PERSISTENCE_RPT_NOT_FOUND* | An error occurred while trying to retrieve the RPT content saved in storage by WISP SOAP Converter. This can be related either with the use of a wrong sessionId or a missed persistence from WISP SOAP Converter, so it is better to analyze the entire flow using Technical Support's APIs. This block totally the conversion of the RPTs in GPD's payment positions, so the whole process is discarded.\n**WIC-2002** | *PERSISTENCE_RT_NOT_FOUND* | An error occurred while trying to retrieve the RT content saved in storage by WISP Converter. This can be related either with the use of a wrong identifier, a missed persistence or an expired object, so it is better to analyze the entire flow using Technical Support's APIs.\n**WIC-2003** | *PERSISTENCE_REQUESTID_CACHING_ERROR* | An error occurred while trying to retrieve data from internal cache. Specifically, the cached key, defined in format wisp_nav2iuv__
\n", "termsOfService": "https://www.pagopa.gov.it/", "title": "WISP Converter", - "version": "0.4.11-4-PAGOPA-2221" + "version": "0.4.11-5-PAGOPA-2221" }, "servers": [ { diff --git a/openapi/openapi_redirect.json b/openapi/openapi_redirect.json index 2de22f07..c6161f93 100644 --- a/openapi/openapi_redirect.json +++ b/openapi/openapi_redirect.json @@ -2,7 +2,7 @@ "openapi": "3.0.1", "info": { "title": "WISP-Converter-redirect", - "version": "0.4.11-4-PAGOPA-2221" + "version": "0.4.11-5-PAGOPA-2221" }, "servers": [ { diff --git a/pom.xml b/pom.xml index 3b8fc08f..fe1ed4cc 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ it.gov.pagopa wisp-converter - 0.4.11-4-PAGOPA-2221 + 0.4.11-5-PAGOPA-2221 pagoPA WISP Converter A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, converting them in NMU payments. From 1d2d65192bda1d3ec453535540312e8cd1417f25 Mon Sep 17 00:00:00 2001 From: Jacopo Carlini Date: Thu, 17 Oct 2024 18:42:43 +0200 Subject: [PATCH 19/20] [PAGOPA-2221] fix --- docker/applicationinsights.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker/applicationinsights.json b/docker/applicationinsights.json index d718daad..7a160bb2 100644 --- a/docker/applicationinsights.json +++ b/docker/applicationinsights.json @@ -21,6 +21,10 @@ ], "percentage": 100 }, + { + "telemetryType": "trace", + "percentage": 0 + }, { "telemetryType": "exception", "percentage": 100 From 813e689443bfa4ff0afe14de80cf991f9ef94313 Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Thu, 17 Oct 2024 16:44:10 +0000 Subject: [PATCH 20/20] Bump to version 0.4.11-6-PAGOPA-2221 [skip ci] --- helm/Chart.yaml | 4 ++-- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- openapi/openapi.json | 2 +- openapi/openapi_redirect.json | 2 +- pom.xml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 96a2ccef..18e96c66 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-wisp-converter description: A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, interfacing them with GPD system type: application -version: 0.245.0 -appVersion: 0.4.11-5-PAGOPA-2221 +version: 0.246.0 +appVersion: 0.4.11-6-PAGOPA-2221 dependencies: - name: microservice-chart version: 3.0.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index c053f490..a490308b 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "0.4.11-5-PAGOPA-2221" + tag: "0.4.11-6-PAGOPA-2221" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 5d5b1adb..47a0dee1 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "0.4.11-5-PAGOPA-2221" + tag: "0.4.11-6-PAGOPA-2221" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index cf88466b..38105bac 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "0.4.11-5-PAGOPA-2221" + tag: "0.4.11-6-PAGOPA-2221" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi/openapi.json b/openapi/openapi.json index 7a4d83f3..76af6336 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "description": "A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, converting them in NMU payments.\n\n# OPERATIVE INFO\n\n\n## EVENT MAPPING IN RE\n\n
Details\nFIELD | SCOPE | DESCRIPTION\n- | - | -\n**requestId** | BOTH | The identifier, set by X-Request-ID, from which the events can be grouped.\n**operationId** | BOTH | The identifier associated to a request identifier\n**clientOperationId** | BOTH | The identifier that associate a client to an operation identifier.\n**component** | BOTH | The applicative component from which the event is generated.
In NDP it is mapped with field 'componente'.
Values:
_WISP_SOAP_CONVERTER_
_WISP_CONVERTER_\n**insertedTimestamp** | BOTH | The time on which the event is inserted in RE storage\n**eventCategory** | BOTH | The category on which the event can be grouped.
In NDP it is mapped with field 'categoriaEvento'.
Values:
_INTERFACE_
_INTERNAL_\n**eventSubcategory** | BOTH | The subcategory related to the specific nature of the event.
In NDP it is mapped with field 'sottoTipoEvento'.
Values:
_REQ_
_RESP_
_INTERN_\n**callType** | INTERFACE | The type of role that the application has in the communication with the remote endpoint.
Values:
_SERVER_
_CLIENT_\n**outcome** | INTERFACE | The outcome of the operation described by the event.
In NDP it is mapped with field 'esito'.
Values:
_SEND_: Correctly sent request to HTTP endpoint. In NDP it is mapped with value 'INVIATA'.
_SEND_FAILURE_: Failed to send request to HTTP endpoint. In NDP it is mapped with value 'INVIATA_KO'
_RECEIVED_: Received an OK response from HTTP endpoint. In NDP it is mapped with value 'RICEVUTA_KO'
_RECEIVED_FAILURE_: Received a failure response from endpoint. In NDP it is mapped with value 'RICEVUTA_KO'
_NEVER_RECEIVED_: Failed to receive response at all from endpoint. In NDP it is mapped with value 'NO_RICEVUTA'
_EXECUTED_INTERNAL_STEP_: Executed internal step on execution. In NDP it is mapped with value 'CAMBIO_STATO'\n**httpMethod** | INTERFACE | The HTTP method of the endpoint related to the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpUri** | INTERFACE | The URI related to the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpHeaders** | INTERFACE | The list of HTTP headers extracted from the request/response analyzed by the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpCallRemoteAddress** | INTERFACE | The remote IP address extracted from the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpStatusCode** | INTERFACE | The status code extracted from the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**executionTimeMs** | INTERFACE | The duration time of the invocation of the endpoint related to the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**compressedPayload** | INTERFACE | The payload of the request/response analyzed by the event.
This value is zipped using GZip compression algorithm.\n**compressedPayloadLength** | INTERFACE | The length (in number of characters) of the compressed payload.\n**businessProcess** | INTERFACE | The descriptive label associated to the endpoint called by user and related to the whole process.\n**operationStatus** | INTERFACE | The final status of the whole operation.
This is set only in the events that describe the response in output to user.\n**operationErrorTitle** | INTERFACE | The error title extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**operationErrorDetail** | INTERFACE | The error detail message extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**operationErrorCode** | INTERFACE | The error code extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**primitive** | INTERNAL | The typology of primitive analyzed and tracked by the event.
In NDP it is mapped with field 'eventType'.\n**sessionId** | INTERNAL | The session identifier generated by WISP SOAP Converter and used in the request.\n**cartId** | INTERNAL | The cart identifier used in the request.\n**iuv** | INTERNAL | The 'identificativo univoco pagamento' used in the request.\n**noticeNumber** | INTERNAL | The notice number (aka NAV code) used in the request.\n**domainId** | INTERNAL | The creditor institution identifier used in the request.\n**ccp** | INTERNAL | The 'codice contesto pagamento' used in the request.\n**psp** | INTERNAL | The payment service provider used in the request.\n**station** | INTERNAL | The station used in the request.\n**channel** | INTERNAL | The channel used in the request.\n**status** | INTERNAL | The state of the internal step executed.
Values:
_FOUND_RPT_IN_STORAGE_
_FOUND_RT_IN_STORAGE_
_EXTRACTED_DATA_FROM_RPT_
_CREATED_NEW_PAYMENT_POSITION_IN_GPD_
_GENERATED_NAV_FOR_NEW_PAYMENT_POSITION_
_UPDATED_EXISTING_PAYMENT_POSITION_IN_GPD_
_GENERATING_RT_FOR_INVALID_PAYMENT_POSITION_IN_GPD_
_GENERATING_RT_FOR_REDIRECT_ERROR_
_GENERATED_CACHE_ABOUT_RPT_FOR_DECOUPLER_
_GENERATED_CACHE_ABOUT_RPT_FOR_CARTSESSION_CACHING_
_GENERATED_CACHE_ABOUT_RPT_FOR_RT_GENERATION_
_SAVED_RPT_IN_CART_RECEIVED_REDIRECT_URL_FROM_CHECKOUT_
_RT_NOT_GENERABLE_FOR_GPD_STATION_
_RT_NOT_GENERABLE_FOR_NOT_EXISTING_PAYMENT_POSITION_
_NEGATIVE_RT_TRY_TO_SEND_TO_CREDITOR_INSTITUTION_
_POSITIVE_RT_TRY_TO_SEND_TO_CREDITOR_INSTITUTION_
_RT_SEND_SUCCESS_
_RT_SEND_FAILURE_
_RT_ALREADY_SENT_
_RT_SEND_SCHEDULING_SUCCESS_
_RT_SEND_SCHEDULING_FAILURE_
_RT_SCHEDULED_SEND_SUCCESS_
_RT_SCHEDULED_SEND_FAILURE_
_RT_SEND_RESCHEDULING_FAILURE_
_RT_SEND_RESCHEDULING_REACHED_MAX_RETRIES_
_RT_SEND_RESCHEDULING_SUCCESS_
_RT_START_RECONCILIATION_PROCESS_
_RT_END_RECONCILIATION_PROCESS_
_RT_DEAD_LETTER_SAVED_
_RT_DEAD_LETTER_FAILED_
_RECEIPT_TIMER_GENERATION_CREATED_SCHEDULED_SEND_
_RECEIPT_TIMER_GENERATION_CACHED_SEQUENCE_NUMBER_
_RECEIPT_TIMER_GENERATION_DELETED_SCHEDULED_SEND_
_RECEIPT_TIMER_GENERATION_SKIP_DELETE_SCHEDULED_SEND_
_RECEIPT_TIMER_PAYMENT_TOKEN_TIMEOUT_TRIGGER_
_ECOMMERCE_HANG_TIMER_TRIGGER_
_ECOMMERCE_HANG_TIMER_CREATED_
_ECOMMERCE_HANG_TIMER_DELETED_
_RPT_TIMER_TRIGGER_
_RPT_TIMER_CREATED_
_RPT_TIMER_DELETED_
_RPT_TIMER_NOT_SET_
_COMMUNICATING_WITH_GPD_REQUEST_
_COMMUNICATING_WITH_GPD_RESPONSE_
_COMMUNICATING_WITH_IUV_GENERATOR_REQUEST_
_COMMUNICATING_WITH_IUV_GENERATOR_RESPONSE_
_COMMUNICATING_WITH_CHECKOUT_REQUEST_
_COMMUNICATING_WITH_CHECKOUT_RESPONSE_
_COMMUNICATING_WITH_DECOUPLER_CACHING_REQUEST_
_COMMUNICATING_WITH_DECOUPLER_CACHING_RESPONSE_
_COMMUNICATING_WITH_CREDITOR_INSTITUTION_REQUEST_
_COMMUNICATING_WITH_CREDITOR_INSTITUTION_RESPONSE_\n**info** | INTERNAL | The other information that can be inserted for the tracing.\n**paymentToken** | INTERNAL | The payment token.\n\n
\n\n\n## OPERATIONAL ERROR CODES\n\n
Details\nNAME | CODE | DESCRIPTION\n- | - | -\n**WIC-500** | *ERROR* | A not documented generic error occurred while execution. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1000** | *GENERIC_ERROR* | A generic error occurred while executing conversion flow. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1001** | *PARSING_GENERIC_ERROR* | A generic error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1002** | *PARSING_INVALID_HEADER* | An error occurred while parsing of the content header, associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT.\n**WIC-1003** | *PARSING_INVALID_BODY* | An error occurred while parsing of the content payload, associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT.\n**WIC-1004** | *PARSING_INVALID_XML_NODES* | An error occurred while parsing of the of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The XML content extracted, either from payload or from header, is invalid because it is not possible to extract tag nodes from document. So, the document is probably empty.\n**WIC-1005** | *PARSING_INVALID_ZIPPED_PAYLOAD* | An error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The SOAP request analyzed and stored in dedicated storage is not usable for convert the debt positions in GPD system. This is probably due to an invalid conversion of the SOAP request via GZip algorithm executed before the same is stored in its storage.\n**WIC-1006** | *PARSING_RPT_PRIMITIVE_NOT_VALID* | An error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The primitive (the content related to header 'soapaction') cannot be handled by WISP Converter application in redirect process: only one of nodoInviaRPT and nodoInviaCarrelloRPT can be accepted.\n**WIC-1100** | *VALIDATION_INVALID_MULTIBENEFICIARY_CART* | An error occurred while analyzing the RPTs extracted from SOAP request. In particular, the request is arrived as nodoInviaCarrelloRPT as multi-beneficiary cart, but the number of RPTs in the request is lower than two, so it cannot be correctly handled as multi-beneficiary.\n**WIC-1101** | *VALIDATION_INVALID_IBANS* | An error occurred while analyzing the RPTs extracted from SOAP request. An IBAN must always be set in RPT transfers if they aren't related to digital stamps (which don't require an IBAN, because they will be reported to specific subject). In this case, in one or more RPT transfers not related to digital stamp, the IBAN is not correctly set.\n**WIC-1102** | *VALIDATION_INVALID_DEBTOR* | An error occurred while analyzing the RPTs extracted from SOAP request. In particular, in a cart there are different debtor subjects and this is not permitted for this flow. So, the whole cart is discarded.\n**WIC-1200** | *CONFIGURATION_INVALID_CACHE* | An error occurred while trying to access data from cached configuration. It is possible that the cache is not retrieved yet by this service or a corrupted configuration was returned from APIConfig Cache internal service. If this problem still occurs, please check the connectivity with APIConfig Cache.\n**WIC-1201** | *CONFIGURATION_INVALID_STATION* | An error occurred while retrieving data from local cached configuration. In particular, it is not possible to retrieve the configuration about the station because it does not exists in cache, and maybe also in general configuration. So, a change in whole configuration and/or a refresh on cache is required.\n**WIC-1202** | *CONFIGURATION_INVALID_CREDITOR_INSTITUTION_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the required station does not exists in cached configuration. So, a change in whole configuration and/or a refresh on cache is required.\n**WIC-1203** | *CONFIGURATION_INVALID_STATION_REDIRECT_URL* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration about redirection in error cases is not correctly set to points towards some creditor institution's endpoint. So, a change in configuration is required.\n**WIC-1204** | *CONFIGURATION_INVALID_STATION_SERVICE_URL* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is not correctly set to points towards GPD service endpoint for RT generator. So, a change in configuration is required.\n**WIC-1205** | *CONFIGURATION_NOT_GPD_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is not correctly set to points towards GPD service endpoint. So, a change in configuration is required.\n**WIC-1206** | *CONFIGURATION_INVALID_GPD_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is correctly set to points towards GPD service endpoint but uses the 'v1' primitive version (and it must use the 'v2' version). So, a change in configuration is required.\n**WIC-1207** | *CONFIGURATION_INVALID_STATION_PROXY* | An error occurred while checking the station that will be used for the receipt send process. In particular, analyzing the station it turns out that the configuration is not correctly set to configure proxy structure for RT generator. So, a change in configuration is required.\n**WIC-1300** | *PAYMENT_POSITION_NOT_IN_PAYABLE_STATE* | An error occurred while checking an existing payment position. One or more RPTs extracted from the request refers to existing payment positions in GPD that have a state from which it is impossible to execute a payment flow. If the execution of this flow is related to a RPT cart, all the payments that can be retrieved or generated ex novo from those RPTs are declared as atomically invalid (if one RPT in cart is bad, all RPTs in cart are bad) and not payable with this flow.\n**WIC-1301** | *PAYMENT_POSITION_IN_INCONSISTENT_STATE* | An error occurred while checking an existing payment position in GPD system. The retrieved payment position, previously inserted in GPD by this same flow or by other procedures, is in an invalid state, not mappable to an existing value. This can be related to a wrong setting in GPD or a corruption of the retrieved data.\n**WIC-1302** | *PAYMENT_POSITION_NOT_VALID* | An error occurred while generating a payment position. In particular, something during the generation of a new payment position or the analysis of an existing payment position went wrong and the operation cannot be completed. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1303** | *PAYMENT_OPTION_NOT_EXTRACTABLE* | An error occurred while extracting a payment option from a payment position. This can be caused by a malformed payment position that does not have a payment option. Remember that a payment position in this flow must have one and only one payment option.\n**WIC-1400** | *RECEIPT_GENERATION_GENERIC_ERROR* | An error occurred while generating an RT (aka a receipt). An unhandled error occurred and it is impossible to complete the process. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1401** | *RECEIPT_GENERATION_WRONG_RESPONSE_FROM_CREDITOR_INSTITUTION* | An error occurred while generating an RT (aka a receipt). Specifically, the RT request is sent to creditor institution but this one responded with an invalid response from which is impossible to continue the analysis. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1402** | *RECEIPT_GENERATION_ERROR_RESPONSE_FROM_CREDITOR_INSTITUTION* | An error occurred while generating an RT (aka a receipt). Specifically, the RT request is sent to creditor institution but this one responded with an error response that explicit the occurred problem. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1403** | *RECEIPT_KO_NOT_SENT* | An error occurred while sending a negative RT (aka a KO receipt). So, no receipt can be sent lately to creditor institution and probably the process must be executed manually. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1404** | *RECEIPT_OK_NOT_SENT* | An error occurred while sending a positive RT (aka a OK receipt). So, no receipt can be sent lately to creditor institution and probably the process must be executed manually. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1405** | *RECEIPT_GENERATION_IDEMPOTENCY_LOCKED_BY_ANOTHER_PROCESS* | An error occurred while generating an RT (aka a receipt). Two or more generation processes are concurrently trying to execute the same operation on the same receipt but only one of them is currently 'authorized' to do so.\n**WIC-1406** | *RECEIPT_GENERATION_NOT_PROCESSABLE* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be started correctly because it is trying to lock the idempotency key that is already in a locked state. Probably the process is in execution by another thread.\n**WIC-1407** | *RECEIPT_GENERATION_ALREADY_PROCESSED* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be completed correctly because it is trying to unlock the idempotency key that is not in a locked state. Probably the process was already completed.\n**WIC-1408** | *RECEIPT_GENERATION_ANOMALY_ON_PROCESSING* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be completed correctly because there is a mismatch between the type of the cached receipt and the kind of request made for generate the same receipt. For example, the cached receipt is defined as negative paaInviaRT but the request was made to 'receipt/ok' endpoint. This is an anomaly that should never happens in a correct NMU flow execution but must be traced in case of error.\n**WIC-1409** | *RECEIPT_KO_NOT_GENERATED_BUT_MAYBE_RESCHEDULED* | An error occurred while generating a negative RT (aka a KO receipt). The receipt could be sent lately to creditor institution but for better understanding the cause, please use the Technical Support's APIs.\n**WIC-1410** | *RECEIPT_OK_NOT_GENERATED_BUT_MAYBE_RESCHEDULED* | An error occurred while generating a positive RT (aka a OK receipt). The receipt could be sent lately to creditor institution but for better understanding the cause, please use the Technical Support's APIs.\n**WIC-1411** | *RECEIPT_GENERATION_ERROR_DEAD_LETTER* | An error occurred while generating an RT (aka a receipt). Specifically, the creditor institution response status has not been recognized, for this reason the RT has been placed in the dead letter container.\n**WIC-2000** | *PERSISTENCE_SAVING_RE_ERROR* | An error occurred wile trying to store a new event in the Registro Eventi storage. The error is somewhat related to a persistence problem of the used storage and in the majority of the cases is temporary (maybe a 429 HTTP code). This error currently blocks the entire flow because that can lead to untraceable requests. For better understanding the cause, please execute a search in the log provider (Application Insights, Kibana, etc).\n**WIC-2001** | *PERSISTENCE_RPT_NOT_FOUND* | An error occurred while trying to retrieve the RPT content saved in storage by WISP SOAP Converter. This can be related either with the use of a wrong sessionId or a missed persistence from WISP SOAP Converter, so it is better to analyze the entire flow using Technical Support's APIs. This block totally the conversion of the RPTs in GPD's payment positions, so the whole process is discarded.\n**WIC-2002** | *PERSISTENCE_RT_NOT_FOUND* | An error occurred while trying to retrieve the RT content saved in storage by WISP Converter. This can be related either with the use of a wrong identifier, a missed persistence or an expired object, so it is better to analyze the entire flow using Technical Support's APIs.\n**WIC-2003** | *PERSISTENCE_REQUESTID_CACHING_ERROR* | An error occurred while trying to retrieve data from internal cache. Specifically, the cached key, defined in format wisp_nav2iuv__
\n", "termsOfService": "https://www.pagopa.gov.it/", "title": "WISP Converter", - "version": "0.4.11-5-PAGOPA-2221" + "version": "0.4.11-6-PAGOPA-2221" }, "servers": [ { diff --git a/openapi/openapi_redirect.json b/openapi/openapi_redirect.json index c6161f93..9ea81dde 100644 --- a/openapi/openapi_redirect.json +++ b/openapi/openapi_redirect.json @@ -2,7 +2,7 @@ "openapi": "3.0.1", "info": { "title": "WISP-Converter-redirect", - "version": "0.4.11-5-PAGOPA-2221" + "version": "0.4.11-6-PAGOPA-2221" }, "servers": [ { diff --git a/pom.xml b/pom.xml index fe1ed4cc..2ec39bee 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ it.gov.pagopa wisp-converter - 0.4.11-5-PAGOPA-2221 + 0.4.11-6-PAGOPA-2221 pagoPA WISP Converter A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, converting them in NMU payments.