reportportal / kubernetes

Kubernetes/Helm configs for ReportPortal
https://reportportal.io
Apache License 2.0
75 stars 191 forks source link

"uat" container in uat pods restarting with error "superadmin not found" #374

Closed dhruv-chavda-mt closed 5 months ago

dhruv-chavda-mt commented 5 months ago

attaching the whole restart logs here

❯ kl qac-reportportal-new-uat-7c977485b8-lr8h2 -c uat --previous

    ____                        __  ____             __        __
   / __ \___  ____  ____  _____/ /_/ __ \____  _____/ /_____ _/ /
  / /_/ / _ \/ __ \/ __ \/ ___/ __/ /_/ / __ \/ ___/ __/ __ `/ /
 / _, _/  __/ /_/ / /_/ / /  / /_/ ____/ /_/ / /  / /_/ /_/ / /
/_/ |_|\___/ .___/\____/_/   \__/_/    \____/_/   \__/\__,_/_/
          /_/
                Authorization Service: 5.11.0
                Built with ♡ by EPAM Systems
                Spring Boot  (v2.5.14)

2024-03-26 14:46:22.809  INFO 1 --- [           main] c.e.r.auth.AuthServerApplication         : Starting AuthServerApplication using Java 11.0.20.1 on qac-reportportal-new-uat-7c977485b8-lr8h2 with PID 1 (/usr/app/service-authorization-5.11.0-exec.jar started by root in /usr/app)
2024-03-26 14:46:22.816  INFO 1 --- [           main] c.e.r.auth.AuthServerApplication         : The following 1 profile is active: "default"
2024-03-26 14:46:30.222  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2024-03-26 14:46:31.611  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 1299 ms. Found 31 JPA repository interfaces.
2024-03-26 14:46:38.621  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 9999 (http)
2024-03-26 14:46:38.705  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2024-03-26 14:46:38.705  INFO 1 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.82]
2024-03-26 14:46:39.109  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/uat]    : Initializing Spring embedded WebApplicationContext
2024-03-26 14:46:39.109  INFO 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 15985 ms
2024-03-26 14:46:39.905  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2024-03-26 14:46:41.417  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2024-03-26 14:46:45.720  INFO 1 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2024-03-26 14:46:46.030  INFO 1 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.4.24.Final
2024-03-26 14:46:46.925  INFO 1 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2024-03-26 14:46:49.705  INFO 1 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: com.epam.ta.reportportal.commons.JsonbAwarePostgresDialect
2024-03-26 14:46:58.816  INFO 1 --- [           main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2024-03-26 14:46:58.827  INFO 1 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2024-03-26 14:47:09.118  WARN 1 --- [           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
2024-03-26 14:47:14.818  WARN 1 --- [           main] o.s.s.o.p.t.s.JwtAccessTokenConverter    : Unable to create an RSA verifier from verifierKey (ignoreable if using MAC)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.security.saml.saml2.metadata.NameIdFormat (jar:file:/usr/app/service-authorization-5.11.0-exec.jar!/BOOT-INF/lib/spring-security-saml2-core-2.0.0.M31.jar!/) to field java.lang.Enum.name
WARNING: Please consider reporting this to the maintainers of org.springframework.security.saml.saml2.metadata.NameIdFormat
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2024-03-26 14:47:15.609  WARN 1 --- [           main] c.r.client.TrustEverythingTrustManager   : SECURITY ALERT: this trust manager trusts every certificate, effectively disabling peer verification. This is convenient for local development but offers no protection against man-in-the-middle attacks. Please see https://www.rabbitmq.com/ssl.html to learn more about peer certificate verification.
2024-03-26 14:47:16.921  INFO 1 --- [           main] o.o.core.config.InitializationService    : Initializing OpenSAML using the Java Services API
2024-03-26 14:47:22.817 DEBUG 1 --- [           main] .s.o.p.e.FrameworkEndpointHandlerMapping : 8 mappings in 'oauth2EndpointHandlerMapping'
2024-03-26 14:47:23.614  INFO 1 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 2 endpoint(s) beneath base path ''
2024-03-26 14:47:27.807  INFO 1 --- [           main] pertySourcedRequestMappingHandlerMapping : Mapped URL path [/api-docs] onto method [springfox.documentation.swagger2.web.Swagger2Controller#getDocumentation(String, HttpServletRequest)]
2024-03-26 14:47:30.418  INFO 1 --- [           main] o.s.l.c.support.AbstractContextSource    : Property 'userDn' not set - anonymous context will be used for read-write operations
2024-03-26 14:47:30.630 DEBUG 1 --- [           main] s.c.a.w.c.WebSecurityConfigurerAdapter$2 : No authenticationProviders and no parentAuthenticationManager defined. Returning null.
2024-03-26 14:47:31.817  INFO 1 --- [           main] SamlServiceProviderSecurityConfiguration : Configuring SAML SP on pattern:/saml/sp/**
2024-03-26 14:47:32.113 DEBUG 1 --- [           main] edFilterInvocationSecurityMetadataSource : Adding web access control expression [fullyAuthenticated] for Ant [pattern='/sso/oauth/token']
2024-03-26 14:47:32.114 DEBUG 1 --- [           main] edFilterInvocationSecurityMetadataSource : Adding web access control expression [hasAuthority('ROLE_INTERNAL')] for Ant [pattern='/sso/oauth/token_key']
2024-03-26 14:47:32.115 DEBUG 1 --- [           main] edFilterInvocationSecurityMetadataSource : Adding web access control expression [hasAuthority('ROLE_INTERNAL')] for Ant [pattern='/sso/oauth/check_token']
2024-03-26 14:47:32.205  INFO 1 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Will secure Or [Ant [pattern='/sso/oauth/token'], Ant [pattern='/sso/oauth/token_key'], Ant [pattern='/sso/oauth/check_token']] with [org.springframework.security.web.session.DisableEncodeUrlFilter@1ddc5857, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@6f0df74, org.springframework.security.web.context.SecurityContextPersistenceFilter@368e7d3a, org.springframework.security.web.header.HeaderWriterFilter@507e3e77, org.springframework.security.web.authentication.logout.LogoutFilter@28be7db5, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@68ee7b3b, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@375682a5, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@7cd2d3b6, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@42bbd21c, org.springframework.security.web.session.SessionManagementFilter@3956e933, org.springframework.security.web.access.ExceptionTranslationFilter@516370c1, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@7021bb55]
2024-03-26 14:47:32.217 DEBUG 1 --- [           main] edFilterInvocationSecurityMetadataSource : Adding web access control expression [hasRole('ROLE_ADMINISTRATOR')] for Ant [pattern='/settings/**']
2024-03-26 14:47:32.217 DEBUG 1 --- [           main] edFilterInvocationSecurityMetadataSource : Adding web access control expression [hasRole('ROLE_INTERNAL')] for Ant [pattern='/sso/internal/**']
2024-03-26 14:47:32.217 DEBUG 1 --- [           main] edFilterInvocationSecurityMetadataSource : Adding web access control expression [authenticated] for any request
2024-03-26 14:47:32.218  INFO 1 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Will secure Or [Ant [pattern='/sso/me/**'], Ant [pattern='/sso/internal/**'], Ant [pattern='/settings/**']] with [org.springframework.security.web.session.DisableEncodeUrlFilter@5578ed7e, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@5dd5422f, org.springframework.security.web.context.SecurityContextPersistenceFilter@20ee660b, org.springframework.security.web.header.HeaderWriterFilter@46c093b4, org.springframework.security.web.authentication.logout.LogoutFilter@1e8b0ab5, org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter@2e778abb, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@40e41f88, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@27b7913, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@158b8d10, org.springframework.security.web.session.SessionManagementFilter@4ff00844, org.springframework.security.web.access.ExceptionTranslationFilter@72924f19, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@4c5ae26d]
2024-03-26 14:47:32.220 DEBUG 1 --- [           main] edFilterInvocationSecurityMetadataSource : Adding web access control expression [permitAll] for Ant [pattern='/**']
2024-03-26 14:47:32.221  INFO 1 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Will secure Ant [pattern='/saml/sp/**'] with [org.springframework.security.web.session.DisableEncodeUrlFilter@735dc133, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@57330423, org.springframework.security.web.context.SecurityContextPersistenceFilter@2688b2be, org.springframework.security.web.header.HeaderWriterFilter@38276668, org.springframework.security.web.authentication.logout.LogoutFilter@104e6540, org.springframework.security.saml.provider.config.ThreadLocalSamlConfigurationFilter@2257590f, org.springframework.security.saml.provider.config.ThreadLocalSamlConfigurationFilter@c3e5e3c, org.springframework.security.saml.provider.service.ServiceProviderMetadataFilter@11f752d1, org.springframework.security.saml.provider.service.ServiceProviderMetadataFilter@5eaa4ed0, org.springframework.security.saml.provider.service.SamlAuthenticationRequestFilter@462deb2b, org.springframework.security.saml.provider.service.SamlAuthenticationRequestFilter@381c826c, org.springframework.security.saml.provider.service.authentication.SamlAuthenticationResponseFilter@13563e64, org.springframework.security.saml.provider.service.authentication.SamlAuthenticationResponseFilter@1f062e10, org.springframework.security.saml.provider.SamlProviderLogoutFilter@36dbfa68, org.springframework.security.saml.provider.SamlProviderLogoutFilter@6a08113d, org.springframework.security.saml.provider.service.SelectIdentityProviderFilter@480fb706, org.springframework.security.saml.provider.service.SelectIdentityProviderFilter@66d766b9, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@30d3f583, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@3344c1d7, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@f36c8b1, org.springframework.security.web.session.SessionManagementFilter@e09c7a2, org.springframework.security.web.access.ExceptionTranslationFilter@66be0e72, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@3b22bcad]
2024-03-26 14:47:32.223 DEBUG 1 --- [           main] edFilterInvocationSecurityMetadataSource : Adding web access control expression [permitAll] for Ant [pattern='/sso/login/**']
2024-03-26 14:47:32.223 DEBUG 1 --- [           main] edFilterInvocationSecurityMetadataSource : Adding web access control expression [permitAll] for Ant [pattern='/epam/**']
2024-03-26 14:47:32.223 DEBUG 1 --- [           main] edFilterInvocationSecurityMetadataSource : Adding web access control expression [permitAll] for Ant [pattern='/info']
2024-03-26 14:47:32.223 DEBUG 1 --- [           main] edFilterInvocationSecurityMetadataSource : Adding web access control expression [permitAll] for Ant [pattern='/health']
2024-03-26 14:47:32.223 DEBUG 1 --- [           main] edFilterInvocationSecurityMetadataSource : Adding web access control expression [permitAll] for Ant [pattern='/api-docs/**']
2024-03-26 14:47:32.223 DEBUG 1 --- [           main] edFilterInvocationSecurityMetadataSource : Adding web access control expression [permitAll] for Ant [pattern='/saml/**']
2024-03-26 14:47:32.223 DEBUG 1 --- [           main] edFilterInvocationSecurityMetadataSource : Adding web access control expression [permitAll] for Ant [pattern='/templates/**']
2024-03-26 14:47:32.223 DEBUG 1 --- [           main] edFilterInvocationSecurityMetadataSource : Adding web access control expression [authenticated] for any request
2024-03-26 14:47:32.304  INFO 1 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Will secure Ant [pattern='/**'] with [org.springframework.security.web.session.DisableEncodeUrlFilter@339b45f8, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@5fb58f15, org.springframework.security.web.context.SecurityContextPersistenceFilter@1bdb6b36, org.springframework.security.web.header.HeaderWriterFilter@3c3357c7, org.springframework.security.web.authentication.logout.LogoutFilter@655d5285, org.springframework.web.filter.CompositeFilter@1f8ac459, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@381d7c4c, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@1e3689e7, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@7d43c89f, org.springframework.security.web.session.SessionManagementFilter@506d7fed, org.springframework.security.web.access.ExceptionTranslationFilter@74eae1e0, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@3b4b2c03]
2024-03-26 14:47:32.716  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 9999 (http) with context path '/uat'
2024-03-26 14:47:32.717  INFO 1 --- [           main] d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed
2024-03-26 14:47:32.720  INFO 1 --- [           main] d.s.w.p.DocumentationPluginsBootstrapper : Found 1 custom documentation plugin(s)
2024-03-26 14:47:32.907  INFO 1 --- [           main] s.d.s.w.s.ApiListingReferenceScanner     : Scanning for api listing references
2024-03-26 14:47:33.806  INFO 1 --- [           main] .d.s.w.r.o.CachingOperationNameGenerator : Generating unique operation named: getOAuthSettingsUsingGET_1
2024-03-26 14:47:33.823  INFO 1 --- [           main] .d.s.w.r.o.CachingOperationNameGenerator : Generating unique operation named: userUsingGET_1
2024-03-26 14:47:33.906  INFO 1 --- [           main] .d.s.w.r.o.CachingOperationNameGenerator : Generating unique operation named: userUsingPOST_1
2024-03-26 14:47:34.018  INFO 1 --- [           main] c.e.r.auth.AuthServerApplication         : Started AuthServerApplication in 75.005 seconds (JVM running for 78.63)
2024-03-26 14:47:34.331  INFO 1 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2024-03-26 14:47:34.514 ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application run failed

java.lang.IllegalStateException: Failed to execute CommandLineRunner
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:820) ~[spring-boot-2.5.14.jar!/:2.5.14]
    at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:801) ~[spring-boot-2.5.14.jar!/:2.5.14]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:350) ~[spring-boot-2.5.14.jar!/:2.5.14]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1370) ~[spring-boot-2.5.14.jar!/:2.5.14]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1359) ~[spring-boot-2.5.14.jar!/:2.5.14]
    at com.epam.reportportal.auth.AuthServerApplication.main(AuthServerApplication.java:40) ~[classes!/:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[service-authorization-5.11.0-exec.jar:na]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[service-authorization-5.11.0-exec.jar:na]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[service-authorization-5.11.0-exec.jar:na]
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[service-authorization-5.11.0-exec.jar:na]
Caused by: javax.persistence.EntityNotFoundException: superadmin not found
    at com.epam.reportportal.auth.AdminPasswordInitializer.lambda$run$0(AdminPasswordInitializer.java:42) ~[classes!/:na]
    at java.base/java.util.Optional.orElseThrow(Optional.java:408) ~[na:na]
    at com.epam.reportportal.auth.AdminPasswordInitializer.run(AdminPasswordInitializer.java:42) ~[classes!/:na]
    at com.epam.reportportal.auth.AdminPasswordInitializer$$FastClassBySpringCGLIB$$ee8f261a.invoke(<generated>) ~[classes!/:na]
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.30.jar!/:5.3.30]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) ~[spring-aop-5.3.20.jar!/:5.3.20]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.20.jar!/:5.3.20]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.20.jar!/:5.3.20]
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[spring-tx-5.3.20.jar!/:5.3.20]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) ~[spring-tx-5.3.20.jar!/:5.3.20]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-5.3.20.jar!/:5.3.20]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.20.jar!/:5.3.20]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.20.jar!/:5.3.20]
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) ~[spring-aop-5.3.20.jar!/:5.3.20]
    at com.epam.reportportal.auth.AdminPasswordInitializer$$EnhancerBySpringCGLIB$$ba9b90e.run(<generated>) ~[classes!/:na]
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:817) ~[spring-boot-2.5.14.jar!/:2.5.14]
    ... 13 common frames omitted

2024-03-26 14:47:34.718  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2024-03-26 14:47:34.806  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.

Caused by: javax.persistence.EntityNotFoundException: superadmin not found

Can someone please guide me if I'm missing something here?

Pink-Bumblebee commented 5 months ago

@dhruv-chavda-mt , were you upgraded RP or trying to setup new instance? Looks like you've lost somehow superadmin on your instance.

dhruv-chavda-mt commented 5 months ago

Yes We are setting up a new RP version 24.1. But we are using older postgres instance only.

Had to create a new superadmin user to resolve the issue. (checked the issue #290 )

We can close this ticket