paypal / mirakl-hyperwallet-connector

The Hyperwallet Mirakl Connector (HMC) is a self-hosted solution that mediates between a Mirakl marketplace solution and the Hyperwallet (PayPal) payout platform.
https://paypal.github.io/mirakl-hyperwallet-connector/
Apache License 2.0
35 stars 34 forks source link

[Issue]: HWC build for ver. 4.14.0 fails #64

Closed pradeep-agnihotri closed 2 years ago

pradeep-agnihotri commented 2 years ago

Describe the Issue

On recommendation of HyperWallet Team we initiated the install of the latest version (currently 4.14.0), but now the connector itself is not building and giving multiple errors.

SEE "Relevant log output" On debugging it was identified that the build fails during the initial tests that are run by the application. The logs are added under "Build Failed JUnit".

Then we ran the build bypassing these tests and the build was successful but again got errors during the JAR execution. The error reported were about the custom fields added in Mirakl for HyperWallet. Refer the logs added under "Field Validation Failure". For example one of the report was as below;

Item 'hw-program' doesn't have the expected definition. Property 'required' doesn't have the correct value. Expected value: '' Actual value: 'true'

Note that we already have a Mirakl instance up, with Seller account already created. While creating the HW related fields the required fields such as "hw-program" have to be setup with a default value for all the existing Seller records. In case of "hw-program" the type is a "Single Value List" and the default value assigned to the existing Seller records is "DEFAULT".

Similar to the "hw-program" field, there are reports for the other fields and the same have been listed under the logs "Field Validation Failure".

Environment

Development

Version

4.14.0

Expected Behavior

The HW Connector should install without any errors for a Mirakl setup with existing Seller records.

Actual Behavior

  1. The build with tests enabled fails.
  2. The build bypassing the tests succeeds but the execution fails for Mirakl HW Custom fields

Steps to Reproduce

  1. Setup Mirakl instance.
  2. Create 2-5 Seller Records.
  3. Add the required Custom fields for HyperWalletConnector in Mirakl Sellers.
  4. Install HWC version 4.14.0 with test enabled.
  5. Install HWC version 4.14.0 with test disabled.

Pre-conditions

  1. Mirakl instance should be setup with existing Seller Records.
  2. The Seller custom fields for HWC should be created after Seller Records are added.

Relevant log output

No response

pradeep-agnihotri commented 2 years ago

================================================================= Build Failed JUnit log

$ ./gradlew build

Task :infrastructure:checkFormatMain Execution optimizations have been disabled for task ':infrastructure:checkFormatMain' to ensure correctness due to the following reasons:

  • Gradle detected a problem with the following location: '/home/deep/Downloads/ajay/mirakl-hyperwallet-connector-main/infrastructure/src/main/java'. Reason: Task ':infrastructure:checkFormatMain' uses this output of task ':infrastructure:formatMain' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Task :infrastructure:checkFormatTest Execution optimizations have been disabled for task ':infrastructure:checkFormatTest' to ensure correctness due to the following reasons:

  • Gradle detected a problem with the following location: '/home/deep/Downloads/ajay/mirakl-hyperwallet-connector-main/infrastructure/src/test/java'. Reason: Task ':infrastructure:checkFormatTest' uses this output of task ':infrastructure:formatTest' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Task :infrastructure:test

Task :invoices:checkFormatMain Execution optimizations have been disabled for task ':invoices:checkFormatMain' to ensure correctness due to the following reasons:

  • Gradle detected a problem with the following location: '/home/deep/Downloads/ajay/mirakl-hyperwallet-connector-main/invoices/src/main/java'. Reason: Task ':invoices:checkFormatMain' uses this output of task ':invoices:formatMain' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Task :invoices:checkFormatTest Execution optimizations have been disabled for task ':invoices:checkFormatTest' to ensure correctness due to the following reasons:

  • Gradle detected a problem with the following location: '/home/deep/Downloads/ajay/mirakl-hyperwallet-connector-main/invoices/src/test/java'. Reason: Task ':invoices:checkFormatTest' uses this output of task ':invoices:formatTest' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Task :kyc:checkFormatMain Execution optimizations have been disabled for task ':kyc:checkFormatMain' to ensure correctness due to the following reasons:

  • Gradle detected a problem with the following location: '/home/deep/Downloads/ajay/mirakl-hyperwallet-connector-main/kyc/src/main/java'. Reason: Task ':kyc:checkFormatMain' uses this output of task ':kyc:formatMain' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Task :kyc:checkFormatTest Execution optimizations have been disabled for task ':kyc:checkFormatTest' to ensure correctness due to the following reasons:

  • Gradle detected a problem with the following location: '/home/deep/Downloads/ajay/mirakl-hyperwallet-connector-main/kyc/src/test/java'. Reason: Task ':kyc:checkFormatTest' uses this output of task ':kyc:formatTest' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Task :kyc:test OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended

Task :notifications:checkFormatMain Execution optimizations have been disabled for task ':notifications:checkFormatMain' to ensure correctness due to the following reasons:

  • Gradle detected a problem with the following location: '/home/deep/Downloads/ajay/mirakl-hyperwallet-connector-main/notifications/src/main/java'. Reason: Task ':notifications:checkFormatMain' uses this output of task ':notifications:formatMain' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Task :notifications:checkFormatTest Execution optimizations have been disabled for task ':notifications:checkFormatTest' to ensure correctness due to the following reasons:

  • Gradle detected a problem with the following location: '/home/deep/Downloads/ajay/mirakl-hyperwallet-connector-main/notifications/src/test/java'. Reason: Task ':notifications:checkFormatTest' uses this output of task ':notifications:formatTest' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Task :notifications:test OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended

Task :observability:checkFormatMain Execution optimizations have been disabled for task ':observability:checkFormatMain' to ensure correctness due to the following reasons:

  • Gradle detected a problem with the following location: '/home/deep/Downloads/ajay/mirakl-hyperwallet-connector-main/observability/src/main/java'. Reason: Task ':observability:checkFormatMain' uses this output of task ':observability:formatMain' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Task :observability:checkFormatTest Execution optimizations have been disabled for task ':observability:checkFormatTest' to ensure correctness due to the following reasons:

  • Gradle detected a problem with the following location: '/home/deep/Downloads/ajay/mirakl-hyperwallet-connector-main/observability/src/test/java'. Reason: Task ':observability:checkFormatTest' uses this output of task ':observability:formatTest' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Task :observability:test OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended

Task :reports:checkFormatMain Execution optimizations have been disabled for task ':reports:checkFormatMain' to ensure correctness due to the following reasons:

  • Gradle detected a problem with the following location: '/home/deep/Downloads/ajay/mirakl-hyperwallet-connector-main/reports/src/main/java'. Reason: Task ':reports:checkFormatMain' uses this output of task ':reports:formatMain' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Task :reports:checkFormatTest Execution optimizations have been disabled for task ':reports:checkFormatTest' to ensure correctness due to the following reasons:

  • Gradle detected a problem with the following location: '/home/deep/Downloads/ajay/mirakl-hyperwallet-connector-main/reports/src/test/java'. Reason: Task ':reports:checkFormatTest' uses this output of task ':reports:formatTest' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Task :reports:test OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended

Task :sellers:checkFormatMain Execution optimizations have been disabled for task ':sellers:checkFormatMain' to ensure correctness due to the following reasons:

  • Gradle detected a problem with the following location: '/home/deep/Downloads/ajay/mirakl-hyperwallet-connector-main/sellers/src/main/java'. Reason: Task ':sellers:checkFormatMain' uses this output of task ':sellers:formatMain' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Task :sellers:checkFormatTest Execution optimizations have been disabled for task ':sellers:checkFormatTest' to ensure correctness due to the following reasons:

  • Gradle detected a problem with the following location: '/home/deep/Downloads/ajay/mirakl-hyperwallet-connector-main/sellers/src/test/java'. Reason: Task ':sellers:checkFormatTest' uses this output of task ':sellers:formatTest' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Task :sellers:test OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended

SellerModelTest > dateOfBirth_whenMiraklDateOfBirthCustomFieldValueHasAValue_shouldSetDateOfBirthNextDayGivenTimeZoneUTCPlusTwo() FAILED java.lang.AssertionError at SellerModelTest.java:60

BusinessStakeHolderModelTest > dateOfBirth_whenMiraklDateOfBirthBusinessStakeHolderFieldValueHasAValueAndTimeZoneIsUTCPlusTwo_shouldSetDateOfBirthNextDay() FAILED java.lang.AssertionError at BusinessStakeHolderModelTest.java:357

364 tests completed, 2 failed

Task :sellers:test FAILED

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/7.0/userguide/command_line_interface.html#sec:command_line_warnings

Execution optimizations have been disabled for 14 invalid unit(s) of work during this build to ensure correctness. Please consult deprecation warnings for more details.

BUILD FAILED in 4m 28s 89 actionable tasks: 49 executed, 40 up-to-date

pradeep-agnihotri commented 2 years ago

=============================== Field Validation Failure

$ ./gradlew web:bootRun -x test

Task :web:bootRun

. _ _ /\ / '_ () \ \ \ \ ( ( )\ | ' | '| | ' \/ ` | \ \ \ \ \/ _)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||| |\, | / / / / =========|_|==============|__/=//// :: Spring Boot :: (v2.6.6)

2022-07-13 22:02:11.772 INFO 330106 --- [ main] com.paypal.web.WebConnectorApplication : Starting WebConnectorApplication using Java 16.0.1 on deep-developer-vm with PID 330106 (/home/deep/Downloads/ajay/mirakl-hyperwallet-connector-main/web/build/classes/java/main started by deep in /home/deep/Downloads/ajay/mirakl-hyperwallet-connector-main/web) 2022-07-13 22:02:11.777 INFO 330106 --- [ main] com.paypal.web.WebConnectorApplication : The following 1 profile is active: "prod" 2022-07-13 22:02:14.263 INFO 330106 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2022-07-13 22:02:14.447 INFO 330106 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 162 ms. Found 1 JPA repository interfaces. 2022-07-13 22:02:14.458 INFO 330106 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2022-07-13 22:02:14.521 INFO 330106 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 61 ms. Found 5 JPA repository interfaces. 2022-07-13 22:02:14.552 INFO 330106 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2022-07-13 22:02:14.590 INFO 330106 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 35 ms. Found 3 JPA repository interfaces. 2022-07-13 22:02:14.594 INFO 330106 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2022-07-13 22:02:14.606 INFO 330106 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 9 ms. Found 1 JPA repository interfaces. 2022-07-13 22:02:18.160 INFO 330106 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2022-07-13 22:02:18.278 INFO 330106 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2022-07-13 22:02:18.279 INFO 330106 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.60] 2022-07-13 22:02:18.758 INFO 330106 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2022-07-13 22:02:18.761 INFO 330106 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 6887 ms 2022-07-13 22:02:19.554 INFO 330106 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] 2022-07-13 22:02:19.648 INFO 330106 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.6.7.Final 2022-07-13 22:02:20.097 INFO 330106 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final} 2022-07-13 22:02:20.430 INFO 330106 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2022-07-13 22:02:20.794 INFO 330106 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2022-07-13 22:02:20.870 INFO 330106 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect 2022-07-13 22:02:22.757 INFO 330106 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 2022-07-13 22:02:22.777 INFO 330106 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2022-07-13 22:02:22.811 INFO 330106 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] 2022-07-13 22:02:22.859 INFO 330106 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Starting... 2022-07-13 22:02:22.866 INFO 330106 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Start completed. 2022-07-13 22:02:22.866 INFO 330106 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect 2022-07-13 22:02:22.978 INFO 330106 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 2022-07-13 22:02:22.980 INFO 330106 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2022-07-13 22:02:23.021 INFO 330106 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] 2022-07-13 22:02:23.056 INFO 330106 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-3 - Starting... 2022-07-13 22:02:23.066 INFO 330106 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-3 - Start completed. 2022-07-13 22:02:23.068 INFO 330106 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect 2022-07-13 22:02:23.147 INFO 330106 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 2022-07-13 22:02:23.148 INFO 330106 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2022-07-13 22:02:23.168 INFO 330106 --- [ main] com.paypal.web.WebConnectorApplication :

    Hyperwallet Mirakl Connector: Version [null] 

2022-07-13 22:02:26.004 INFO 330106 --- [ main] org.quartz.impl.StdSchedulerFactory : Using default implementation for ThreadExecutor 2022-07-13 22:02:26.040 INFO 330106 --- [ main] org.quartz.core.SchedulerSignalerImpl : Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl 2022-07-13 22:02:26.041 INFO 330106 --- [ main] org.quartz.core.QuartzScheduler : Quartz Scheduler v.2.3.2 created. 2022-07-13 22:02:26.043 INFO 330106 --- [ main] org.quartz.simpl.RAMJobStore : RAMJobStore initialized. 2022-07-13 22:02:26.044 INFO 330106 --- [ main] org.quartz.core.QuartzScheduler : Scheduler meta-data: Quartz Scheduler (v2.3.2) 'HyperwalletMiraklScheduler' with instanceId 'NON_CLUSTERED' Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally. NOT STARTED. Currently in standby mode. Number of jobs executed: 0 Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads. Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.

2022-07-13 22:02:26.045 INFO 330106 --- [ main] org.quartz.impl.StdSchedulerFactory : Quartz scheduler 'HyperwalletMiraklScheduler' initialized from an externally provided properties instance. 2022-07-13 22:02:26.045 INFO 330106 --- [ main] org.quartz.impl.StdSchedulerFactory : Quartz scheduler version: 2.3.2 2022-07-13 22:02:26.047 INFO 330106 --- [ main] org.quartz.core.QuartzScheduler : JobFactory set to: org.springframework.scheduling.quartz.SpringBeanJobFactory@39889671 2022-07-13 22:02:27.413 WARN 330106 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning 2022-07-13 22:02:29.587 INFO 330106 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 1 endpoint(s) beneath base path '/actuator' 2022-07-13 22:02:29.757 INFO 330106 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' 2022-07-13 22:02:29.759 INFO 330106 --- [ main] o.s.s.quartz.SchedulerFactoryBean : Starting Quartz Scheduler now 2022-07-13 22:02:29.760 INFO 330106 --- [ main] org.quartz.core.QuartzScheduler : Scheduler HyperwalletMiraklScheduler_$_NON_CLUSTERED started. 2022-07-13 22:02:31.445 ERROR 330106 --- [ main] c.p.o.s.service.StartupCheckerService : Startup Check Report -> Status: . Dumping individual checks:Run 2022-07-13 22:02:31.448 INFO 330106 --- [ main] c.p.o.s.service.StartupCheckerService : Startup Check: , Status , CheckDetails: Mirakl API is accessible status: UP location: https://milliporesigmaus-dev.mirakl.net/api version: 3.211 2022-07-13 22:02:31.465 ERROR 330106 --- [ main] c.p.o.s.service.StartupCheckerService : Startup Check: , Status , CheckDetails: Expected field 'hw-program' has not been found Offending field details: MiraklField(label=Hyperwallet Program, code=hw-program, description=Your Hyperwallet implementation may consist of one or more programs based on your payout needs. Select the appropriate program for this Seller/Payee., type=SINGLE_VALUE_LIST, permissions=INVISIBLE, required=null, regexpPattern=null, allowedValues=[])

Item 'hw-bankaccount-state' doesn't have the expected definition. Property 'required' doesn't have the correct value. Expected value: '' Actual value: 'true'

Item 'hw-terms-consent' doesn't have the expected definition. Property 'required' doesn't have the correct value. Expected value: '' Actual value: 'true' 2022-07-13 22:02:31.465 INFO 330106 --- [ main] c.p.o.s.service.StartupCheckerService : Startup Check: , Status , CheckDetails:

2022-07-13 22:02:31.466 ERROR 330106 --- [ main] c.p.o.s.service.StartupCheckerService : Some system startup checks has not passed. Please review the logs and fix the reported problems. 2022-07-13 22:02:31.466 ERROR 330106 --- [ main] c.p.o.s.service.StartupCheckerService : Some of the errors found during startup checks will cause the system to not work properly. System will shutdown. 2022-07-13 22:02:31.475 INFO 330106 --- [ main] org.quartz.core.QuartzScheduler : Scheduler HyperwalletMiraklScheduler_$_NONCLUSTERED paused. 2022-07-13 22:02:31.514 INFO 330106 --- [ main] o.s.s.quartz.SchedulerFactoryBean : Shutting down Quartz Scheduler 2022-07-13 22:02:31.515 INFO 330106 --- [ main] org.quartz.core.QuartzScheduler : Scheduler HyperwalletMiraklScheduler$_NONCLUSTERED shutting down. 2022-07-13 22:02:31.515 INFO 330106 --- [ main] org.quartz.core.QuartzScheduler : Scheduler HyperwalletMiraklScheduler$_NONCLUSTERED paused. 2022-07-13 22:02:31.515 INFO 330106 --- [ main] org.quartz.core.QuartzScheduler : Scheduler HyperwalletMiraklScheduler$_NON_CLUSTERED shutdown complete. 2022-07-13 22:02:31.547 INFO 330106 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'web:bootRun 2022-07-13 22:02:31.548 INFO 330106 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-3 - Shutdown initiated... 2022-07-13 22:02:31.588 INFO 330106 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-3 - Shutdown completed. 2022-07-13 22:02:31.589 INFO 330106 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 2022-07-13 22:02:31.589 INFO 330106 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Shutdown initiated... 2022-07-13 22:02:31.614 INFO 330106 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Shutdown completed. 2022-07-13 22:02:31.615 INFO 330106 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 2022-07-13 22:02:31.616 INFO 330106 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... 2022-07-13 22:02:31.663 INFO 330106 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. 2022-07-13 22:02:31.669 INFO 330106 --- [ main] com.paypal.web.WebConnectorApplication : Started WebConnectorApplication in 20.774 seconds (JVM running for 21.528) 2022-07-13 22:02:31.672 INFO 330106 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2022-07-13 22:02:31.719 ERROR 330106 --- [ main] o.s.boot.SpringApplication : Application run failed

java.lang.IllegalStateException: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@51891008 has been closed already at org.springframework.context.support.AbstractApplicationContext.assertBeanFactoryActive(AbstractApplicationContext.java:1138) ~[spring-context-5.3.18.jar:5.3.18] at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1299) ~[spring-context-5.3.18.jar:5.3.18] at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:753) ~[spring-boot-2.6.6.jar:2.6.6] at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) ~[spring-boot-2.6.6.jar:2.6.6] at com.paypal.web.WebConnectorApplication.main(WebConnectorApplication.java:41) ~[main/:na]

Task :web:bootRun FAILED

FAILURE: Build failed with an exception.

BUILD FAILED in 35s 48 actionable tasks: 17 executed, 31 up-to-date

javierpoloe2y commented 2 years ago

Hi @pradeep-agnihotri,

According to your logs, your setup of Mirakl custom fields is not the recommended:

If you want the connector to start even when there are severe errors in the startup check, you can set the PAYPAL_HMC_STARTUPCHECKS_EXITONFAIL environment variable to false. By doing this, the startup check report will be printed in the logs but the connector will not shut down.

javierpoloe2y commented 2 years ago

Hi @pradeep-agnihotri,

Related to the unit test issues, we weren't able to reproduce the error. We have both done a fresh clone of the repo and also make tests with the release zip file, and in both cases, it compiles and passes the tests.

I see in the logs that you are compiling with Java 16. Currently is only tested with Java 15. Can you do a fresh clone of the repo and try to compile it using JDK 15?

pradeep-agnihotri commented 2 years ago

Hello @javierpoloe2y We had all the fields created and were still getting errors about the values present them. For example for the "hw-program" the app was reporting error because of the value mismatch, the app was requiring it to be blank but since the field itself is required we had to provide a default value as "DEFAULT" in the list. We had tried running the build after removing the fields also.

  1. We will try the build with making these fields are NOT-REQUIRED but I am sure the application would report error about the field should be required.
  2. The other option of using "PAYPAL_HMC_STARTUPCHECKS_EXITONFAIL" , in this case the build would be successful, we had already tried this, but when the app would run it would again report errors about the fields or field values not being setup correctly. Please see the second set of logs that have shared earlier.
javierpoloe2y commented 2 years ago

Hi @pradeep-agnihotri,

Regarding hw-program there shouldn't be a mismatch in the values. For single value list fields, if the expected value is "empty", it means that any list of allowed values is valid. In fact, in most of our tests our Mirakl hw-program value has only a DEFAULT value and is properly working.

Regarding NOT REQUIRED values, Mirakl shouldn't complain about them, since you decide what is required or not. It's going to be Hyperwallet the one who would complain if the fields are not filled. As I commented before, the purpose of not having mandatory custom fields is to allow sellers to progressively fill their data while saving their partial progress. However, if you feel more comfortable making these fields mandatory, there is no problem with that. Simply set PAYPAL_HMC_STARTUPCHECKS_EXITONFAIL variable to false, and the startup check report will be only informative.

Also, PAYPAL_HMC_STARTUPCHECKS_EXITONFAIL variable shouldn't affect the build process, since there are no real connections to Mirakl server during the tests and also because this variable is overridden during the integration tests.

Also the second log that you provided says:

 Some of the errors found during startup checks will cause the system to not work properly. System will shutdown.

This only happens when PAYPAL_HMC_STARTUPCHECKS_EXITONFAIL is not set or is set to true. Can you please ensure that you have correctly setup this variable when you start the connector. (In the future we are going to set this variable to false by default to avoid this type of problems).

And if you still have problems after this, you could attach the logs with the startup check report, so we can help you analyzing what's happening.

max6001 commented 2 years ago

Morning @pradeep-agnihotri Have you managed to take into consideration Javier's response? How did it go? What's the current status of your issue?

Thanks in advance for providing us updates,

Best,

pradeep-agnihotri commented 2 years ago

Hello @javierpoloe2y , @max6001 For 1, "hw-program" we did received the error about mismatch for the value and had added the snippet from the logs. Here it is again. Item 'hw-program' doesn't have the expected definition. Property 'required' doesn't have the correct value. Expected value: '' Actual value: 'true' The Single value list in Mirakl contained only one single value of "DEFAULT".

For 2, It was not Mirakl but HWConnector that I suspected to be reporting the error about required fields.

For 3, we did tried installing with "PAYPAL_HMC_STARTUPCHECKS_EXITONFAIL=False" and as reported earlier the build was successful, but during the Connector execution we observed the errors about the mismatching fields. Also, none of the Seller records are being pickup up by the connector jobs.

Below is the log from during the installation. There is not an option to upload the full log output.

[32m :: Spring Boot :: [39m [2m (v2.6.6)[0;39m [2m2022-07-14 12:50:30.688[0;39m [32m INFO[0;39m [35m1100[0;39m [2m---[0;39m [2m[ main][0;39m [36mj.LocalContainerEntityManagerFactoryBean[0;39m [2m:[0;39m Initialized JPA EntityManagerFactory for persistence unit 'default'

[2m2022-07-14 12:50:30.696[0;39m [32m INFO[0;39m [35m1100[0;39m [2m---[0;39m [2m[ main][0;39m [36mcom.paypal.web.WebConnectorApplication [0;39m [2m:[0;39m


Hyperwallet Mirakl Connector: Version [null]


[2m2022-07-14 12:50:34.002[0;39m [32m INFO[0;39m [35m1100[0;39m [2m---[0;39m [2m[ main][0;39m [36morg.quartz.impl.StdSchedulerFactory [0;39m [2m:[0;39m Using default implementation for ThreadExecutor [2m2022-07-14 12:50:34.012[0;39m [32m INFO[0;39m [35m1100[0;39m [2m---[0;39m [2m[ main][0;39m [36morg.quartz.core.SchedulerSignalerImpl [0;39m [2m:[0;39m Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl [2m2022-07-14 12:50:34.013[0;39m [32m INFO[0;39m [35m1100[0;39m [2m---[0;39m [2m[ main][0;39m [36morg.quartz.core.QuartzScheduler [0;39m [2m:[0;39m Quartz Scheduler v.2.3.2 created. [2m2022-07-14 12:50:34.013[0;39m [32m INFO[0;39m [35m1100[0;39m [2m---[0;39m [2m[ main][0;39m [36morg.quartz.simpl.RAMJobStore [0;39m [2m:[0;39m RAMJobStore initialized. [2m2022-07-14 12:50:34.014[0;39m [32m INFO[0;39m [35m1100[0;39m [2m---[0;39m [2m[ main][0;39m [36morg.quartz.core.QuartzScheduler [0;39m [2m:[0;39m Scheduler meta-data: Quartz Scheduler (v2.3.2) 'HyperwalletMiraklScheduler' with instanceId 'NON_CLUSTERED' Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally. NOT STARTED. Currently in standby mode. Number of jobs executed: 0 Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads. Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.

[2m2022-07-14 12:50:34.014[0;39m [32m INFO[0;39m [35m1100[0;39m [2m---[0;39m [2m[ main][0;39m [36morg.quartz.impl.StdSchedulerFactory [0;39m [2m:[0;39m Quartz scheduler 'HyperwalletMiraklScheduler' initialized from an externally provided properties instance. Mirakl API is accessible status: UP location: https://milliporesigmaus-dev.mirakl.net/api version: 3.211 [2m2022-07-14 12:50:39.294[0;39m [33m WARN[0;39m [35m1100[0;39m [2m---[0;39m [2m[ main][0;39m [36mc.p.o.s.service.StartupCheckerService [0;39m [2m:[0;39m Startup Check: , Status , CheckDetails: Item 'hw-bankaccount-state' doesn't have the expected definition. Property 'required' doesn't have the correct value. Expected value: '' Actual value: 'true'

Item 'hw-terms-consent' doesn't have the expected definition. Property 'required' doesn't have the correct value. Expected value: '' Actual value: 'true' [2m2022-07-14 12:50:39.294[0;39m [32m INFO[0;39m [35m1100[0;39m [2m---[0;39m [2m[ main][0;39m [36mc.p.o.s.service.StartupCheckerService [0;39m [2m:[0;39m Startup Check: , Status , CheckDetails: [2m2022-07-14 12:50:39.294[0;39m [33m WARN[0;39m [35m1100[0;39m [2m---[0;39m [2m[ main][0;39m [36mc.p.o.s.service.StartupCheckerService [0;39m [2m:[0;39m Some system startup checks has warnings. It's recommended to review the logs and fix the reported warnings. [2m2022-07-14 12:50:39.297[0;39m [32m INFO[0;39m [35m1100[0;39m [2m---[0;39m [2m[ main][0;39m [36mcom.paypal.web.WebConnectorApplication [0;39m [2m:[0;39m Started WebConnectorApplication in 20.704 seconds (JVM running for 21.772) [2m2022-07-14 12:50:39.500[0;39m [32m INFO[0;39m [35m1100[0;39m [2m---[0;39m [2m[ main][0;39m [36mcom.paypal.web.WebConnectorApplication [0;39m [2m:[0;39m

Application 'hyperwallet-mirakl-connector:' is running! Access URLs: Local: http://localhost:8080 External: http://100.66.0.52:8080 Profile(s): [prod] Mail host: marketplace-m-group.mail.protection.outlook.com Mail port: 25 Mail SSL: false Mail TLS: true Encryption client public/private key location:
Encryption client public key location:

javierpoloe2y commented 2 years ago

Hi @pradeep-agnihotri,

This log:

Item 'hw-program' doesn't have the expected definition.
Property 'required' doesn't have the correct value.
Expected value: ''
Actual value: 'true'

Doesn't warn about the allowed values available in the hw-program custom field, is warning about the property required of that custom field. It says that its expected value was '' which by default is false and it has found true. So you don't have any problem with the allowed values for hw-program custom field.

Here you have a screenshot showing the required property.

Custom_Field_Required_Property

The log about the mismatch on the required property is only informative so you can ignore it. You can keep your fields as mandatory without problem.

Also by looking at the last logs that you have provided, it looks like the connector is starting properly, and you only have some warnings about the required property, so it looks good and ready to work.

Lastly, you are saying that none of the Seller records are being pickup up by the connector jobs. Can you provide some logs about the seller extraction job execution?

asishmishra commented 2 years ago

Some more and latest logs for troubleshooting please. hwc_logs.txt

javierpoloe2y commented 2 years ago

Hi @asishmishra

I have take a look at the logs, and it seems that the jobs are correctly picking the sellers, but probably there is some misconfiguration in the Hyperwallet API configuration.

Let's look at this excerpt from the log:

2022-07-18 14:56:15.304  INFO 1100 --- [eduler_Worker-3] .l.LoggingBatchJobItemProcessingListener : [ProfessionalSellersExtractBatchJob] Starting extraction of items to be processed
2022-07-18 14:56:15.304  INFO 1100 --- [eduler_Worker-3] .s.s.s.i.MiraklSellersExtractServiceImpl : Retrieving shops since Sat Jun 18 14:56:15 UTC 2022
2022-07-18 14:56:15.511  INFO 1100 --- [eduler_Worker-3] .s.s.s.i.MiraklSellersExtractServiceImpl : Shops retrieved [2021,2029,2009,2011,2004,2020,2005,2024,2025,2001,2027,2000,2007,2012,2015,2017,2019,2013,2018,2002,2003,2006,2028,2008,2023,2022,2031,2030,2026]
2022-07-18 14:56:15.511  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2021]
2022-07-18 14:56:15.512  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2029]
2022-07-18 14:56:15.512  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2009]
2022-07-18 14:56:15.512  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2011]
2022-07-18 14:56:15.513  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2020]
2022-07-18 14:56:15.513  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2005]
2022-07-18 14:56:15.514  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2024]
2022-07-18 14:56:15.514  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2025]
2022-07-18 14:56:15.514  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2001]
2022-07-18 14:56:15.514  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2027]
2022-07-18 14:56:15.515  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2000]
2022-07-18 14:56:15.515  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2007]
2022-07-18 14:56:15.515  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2012]
2022-07-18 14:56:15.515  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2015]
2022-07-18 14:56:15.516  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2017]
2022-07-18 14:56:15.516  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2019]
2022-07-18 14:56:15.516  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2013]
2022-07-18 14:56:15.516  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2018]
2022-07-18 14:56:15.516  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2002]
2022-07-18 14:56:15.517  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2003]
2022-07-18 14:56:15.517  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2006]
2022-07-18 14:56:15.517  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2028]
2022-07-18 14:56:15.517  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2008]
2022-07-18 14:56:15.517  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2023]
2022-07-18 14:56:15.518  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2022]
2022-07-18 14:56:15.518  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2031]
2022-07-18 14:56:15.519  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2030]
2022-07-18 14:56:15.519  WARN 1100 --- [eduler_Worker-3] b.c.i.m.MiraklToBankAccountModelExecutor : No bank account info for shop code: [2026]
2022-07-18 14:56:15.522  INFO 1100 --- [eduler_Worker-3] .l.LoggingBatchJobItemProcessingListener : [ProfessionalSellersExtractBatchJob] Retrieved the following number of items to be processed: 1
2022-07-18 14:56:15.523  INFO 1100 --- [eduler_Worker-3] .l.LoggingBatchJobItemProcessingListener : [ProfessionalSellersExtractBatchJob] Processing item of type ProfessionalSeller with id: 2031
2022-07-18 14:56:15.815 ERROR 1100 --- [eduler_Worker-3] i.SellersTokenSynchronizationServiceImpl : Error while getting Hyperwallet user by clientUserId [2031]

com.hyperwallet.clientsdk.HyperwalletException: The information entered does not match our records. Please try again.
    at com.hyperwallet.clientsdk.util.HyperwalletApiClient.checkErrorResponse(HyperwalletApiClient.java:147) ~[sdk-2.2.5.jar:na]
    at com.hyperwallet.clientsdk.util.HyperwalletApiClient.processResponse(HyperwalletApiClient.java:133) ~[sdk-2.2.5.jar:na]
    at com.hyperwallet.clientsdk.util.HyperwalletApiClient.get(HyperwalletApiClient.java:62) ~[sdk-2.2.5.jar:na]
    at com.hyperwallet.clientsdk.Hyperwallet.listUsers(Hyperwallet.java:161) ~[sdk-2.2.5.jar:na]
    at com.paypal.sellers.sellersextract.service.impl.SellersTokenSynchronizationServiceImpl.getHwUserByClientUserId(SellersTokenSynchronizationServiceImpl.java:94) ~[sellers-4.14.0-plain.jar:na]
    at com.paypal.sellers.sellersextract.service.impl.SellersTokenSynchronizationServiceImpl.getHwUser(SellersTokenSynchronizationServiceImpl.java:77) ~[sellers-4.14.0-plain.jar:na]
    at com.paypal.sellers.sellersextract.service.impl.SellersTokenSynchronizationServiceImpl.synchronizeToken(SellersTokenSynchronizationServiceImpl.java:54) ~[sellers-4.14.0-plain.jar:na]
    at com.paypal.sellers.sellersextract.service.impl.SellersTokenSynchronizationServiceImpl.synchronizeToken(SellersTokenSynchronizationServiceImpl.java:26) ~[sellers-4.14.0-plain.jar:na]
    at com.paypal.sellers.batchjobs.professionals.ProfessionalSellersExtractBatchJobItemProcessor.processItem(ProfessionalSellersExtractBatchJobItemProcessor.java:36) ~[sellers-4.14.0-plain.jar:na]
    at com.paypal.sellers.batchjobs.professionals.ProfessionalSellersExtractBatchJobItemProcessor.processItem(ProfessionalSellersExtractBatchJobItemProcessor.java:13) ~[sellers-4.14.0-plain.jar:na]
    at com.paypal.infrastructure.batchjob.AbstractBatchJob.processItem(AbstractBatchJob.java:44) ~[infrastructure-4.14.0-plain.jar:na]
    at com.paypal.infrastructure.batchjob.BatchJobExecutor.processItem(BatchJobExecutor.java:86) ~[infrastructure-4.14.0-plain.jar:na]
    at com.paypal.infrastructure.batchjob.BatchJobExecutor.lambda$execute$0(BatchJobExecutor.java:27) ~[infrastructure-4.14.0-plain.jar:na]
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) ~[na:na]
    at com.paypal.infrastructure.batchjob.BatchJobExecutor.execute(BatchJobExecutor.java:27) ~[infrastructure-4.14.0-plain.jar:na]
    at com.paypal.infrastructure.batchjob.quartz.QuartzBatchJobAdapter.execute(QuartzBatchJobAdapter.java:33) ~[infrastructure-4.14.0-plain.jar:na]
    at com.paypal.infrastructure.batchjob.quartz.AbstractBatchJobSupportQuartzJob.executeBatchJob(AbstractBatchJobSupportQuartzJob.java:20) ~[infrastructure-4.14.0-plain.jar:na]
    at com.paypal.sellers.jobs.ProfessionalSellersExtractJob.execute(ProfessionalSellersExtractJob.java:33) ~[sellers-4.14.0-plain.jar:na]
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202) ~[quartz-2.3.2.jar:na]
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) ~[quartz-2.3.2.jar:na]

As you see all of this shops were returned by Mirakl:

Shops retrieved [2021,2029,2009,2011,2004,2020,2005,2024,2025,2001,2027,2000,2007,2012,2015,2017,2019,2013,2018,2002,2003,2006,2028,2008,2023,2022,2031,2030,2026]

but only this is being processed:

2022-07-18 14:56:15.522  INFO 1100 --- [eduler_Worker-3] .l.LoggingBatchJobItemProcessingListener : [ProfessionalSellersExtractBatchJob] Retrieved the following number of items to be processed: 1
2022-07-18 14:56:15.523  INFO 1100 --- [eduler_Worker-3] .l.LoggingBatchJobItemProcessingListener : [ProfessionalSellersExtractBatchJob] Processing item of type ProfessionalSeller with id: 2031
2022-07-18 14:56:15.815 ERROR 1100 --- [eduler_Worker-3] i.SellersTokenSynchronizationServiceImpl : Error while getting Hyperwallet user by clientUserId [2031]

The reason is that Sellers that didn't accept the terms and conditions (custom field hw-terms-consent) aren't sent to Hyperwallet (you can see it in this little excerpt from MiraklSellersExtractServiceImpl code, look at the filter:)

    @NonNull
    private List<SellerModel> internalExtractProfessionals(final MiraklShops shops) {
        //@formatter:off
        log.info(SHOPS_RETRIEVED_MESSAGE, shops.getShops().stream()
                .filter(MiraklShop::isProfessional)
                .map(MiraklShop::getId)
                .collect(Collectors.joining(LoggingConstantsUtil.LIST_LOGGING_SEPARATOR)));

        return shops.getShops()
                .stream()
                .filter(MiraklShop::isProfessional)
                .map(miraklShopSellerModelStrategyExecutor::execute)
                .filter(SellerModel::hasAcceptedTermsAndConditions)
                .collect(Collectors.toList());
        //@formatter:on
    }

Then when processing the seller with code 2031 we have this other log:

[eduler_Worker-3] i.SellersTokenSynchronizationServiceImpl : Error while getting Hyperwallet user by clientUserId [2031]

com.hyperwallet.clientsdk.HyperwalletException: The information entered does not match our records. Please try again.
    at com.hyperwallet.clientsdk.util.HyperwalletApiClient.checkErrorResponse(HyperwalletApiClient.java:147) ~[sdk-2.2.5.jar:na]
    at com.hyperwallet.clientsdk.util.HyperwalletApiClient.processResponse(HyperwalletApiClient.java:133) ~[sdk-2.2.5.jar:na]
    at com.hyperwallet.clientsdk.util.HyperwalletApiClient.get(HyperwalletApiClient.java:62) ~[sdk-2.2.5.jar:na]
    at com.hyperwallet.clientsdk.Hyperwallet.listUsers(Hyperwallet.java:161) ~[sdk-2.2.5.jar:na]
    at com.paypal.sellers.sellersextract.service.impl.SellersTokenSynchronizationServiceImpl.getHwUserByClientUserId(SellersTokenSynchronizationServiceImpl.java:94) ~[sellers-4.14.0-plain.jar:na]

which shows a request for retrieving the Hyperwallet user from the Mirakl shop id. This is a really simple request which needs only two parameters, the programToken and the id of the shop, but is failing with an error from Hyperwallet server saying:

The information entered does not match our records. Please try again.

So probably there is a problem with the configuration of the program token used to make that request.

So summarizing:

javierpoloe2y commented 2 years ago

@pradeep-agnihotri, @max6001

Regarding my last comment, and to help you identify you configuration problem, this is the expected response from Hyperwallet when the connector makes a request asking for a user with a clientUserId that doesn't exist in Hyperwallet (an empty 204 response):

image

pradeep-agnihotri commented 2 years ago

@javierpoloe2y Thank you for providing the details.

I am attaching the logs for the professionalSellersExtractJob ran after creating a new Seller with ID 2032; for HyperWallet team to review the API response. hwc_logs 202207191300.txt

otheypsy commented 2 years ago

Thank you for the details. I shall forward this information internally.

javierpoloe2y commented 2 years ago

Hi @pradeep-agnihotri,

As a side note, you can try to test if your credentials are correct by making a direct request to Hyperwallet /users endpoint using cUrl or Postman. This is the request that the connector is trying to do:

curl --location --request GET 'https://<YOUR_HYPERWALLET_SERVER>/rest/v4/users/?limit=100&clientUserId=2031' \
--header 'Authorization: Basic <BASE64_CREDENTIALS>'

Also, you can test your configuration of Hyperwallet API using the /programs endpoint:

curl --location --request GET 'https://<YOUR_HYPERWALLET_SERVER>/rest/v4/programs/<YOUR_PROGRAMTOKEN>/' \
--header 'Authorization: Basic <BASE64_CREDENTIALS>' 
pradeep-agnihotri commented 2 years ago

@omkard3sai , @javierpoloe2y After updating the HW API Endpoint in env variables, we are still getting an error reported in the logs. On using this new HW API Endpoint via Postman, we get an empty response back with header status 204.

See the logs from server - hwc_logs 202207201300.txt

Earlier using the old HW API Endpoint URL via Postman, we were observing the same error as reported in error logs. [eduler_Worker-3] i.SellersTokenSynchronizationServiceImpl : Error while getting Hyperwallet user by clientUserId [2032]

pradeep-agnihotri commented 2 years ago

@omkard3sai , @javierpoloe2y For further testing we created a new shop to see if that would make a difference and we observed a different error;

Jul 20, 2022 @ 16:15:49.473 2022-07-20 21:15:48.921 ERROR 965 --- [eduler_Worker-9] s.HyperWalletCreateSellerServiceStrategy : Error creating seller in hyperwallet with clientUserId [2034]: [{}] com.hyperwallet.clientsdk.HyperwalletException: You must provide a value for this field

Log file has more details - hwc_logs 202207201600.txt

javierpoloe2y commented 2 years ago

Hi @pradeep-agnihotri ,

That error is sent by Hyperwallet when one of the required fields for creating a new user wasn't filled. Please review the shop info to ensure that you have filled all the needed fields.

The log is not showing the name of the field that is not filled, but the connector sends an email with more details when an error like this happens. By looking at the logs it seems that you don't have the mail server properly configured in the connector.

While you configure your mail server to receive the mails and have more info about the error, you can take a look at Hyperwallet API documentation to see the required fields expected by Hyperwallet:

Hyperwallet Create User Endpoint

You can extrapolate the required fields by Hyperwallet to the fields that you need to fill in Mirakl.

javierpoloe2y commented 2 years ago

Also @pradeep-agnihotri,

Since the connector was able to make a request to the create user for 2034 it means that the operation of getting a user by its clientUserId that was previously failing for 2031 and 2032 is currently working.

Did you make any changes in your configuration?

max6001 commented 2 years ago

@javierpoloe2y from my discussion with Soumya yesterday they did change the PAYPAL_HYPERWALLET_API_SERVER value from https://uat.paylution.com/ (the one that was throwing the HW error) to https://uat-api.paylution.com/ By testing on Postman they confirmed that the new URL was returning the expected HTTP 204

pradeep-agnihotri commented 2 years ago

@javierpoloe2y We will get the SMTP setting updated. But we were expecting that the errors would be displayed in the logs also. Do you know if the error would be available in the email when it is not written to the logs files?

@omkard3sai , In the logs we see errors for HyperWallet bank account as below; BankAccountRetryBatchJob] Failed processing item of type BankAccount with id: 2034 [ProfessionalSellersRetryBatchJob] Processing item of type ProfessionalSeller with id: 2034

Here is the log file - hwc_logs 202207211600.txt

javierpoloe2y commented 2 years ago

@pradeep-agnihotri

Errors are always in the logs. Error sending by mail is a feature to report errors so users don't need to continuously review the logs to know if something bad has happened.

However, we have detected that the formatting of exceptions is slightly different when they are printed in the log than when they are printed in the mail. That's why I recommended you to set up the mail, to ensure that you have the maximum information available, although in most cases the information will be the same in the log and in the mail.

For example, for the log HyperwalletException: You must provide a value for this field, perhaps the mail includes the field name so you don't need to review all of the seller's fields, but the log error is enough to know that you are not filling all the fields expected by Hyperwallet.

We already have planned to improve the formatting of Hyperwallet SDK and Mirakl SDK exceptions in the logs.

max6001 commented 2 years ago

Hi @pradeep-agnihotri How are you progressing with the HMC first execution? Do you still face any challenge? Please keep us posted so we can either continue our assistance or close this ticket. Thanks,

pradeep-agnihotri commented 2 years ago

Hello @max6001 , @javierpoloe2y We are making progress on fixing the sync issue and directly working with HyperWallet team. We do not see any issue with the connector itself, hence closing this ticket.