apolloconfig / apollo

Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.
https://www.apolloconfig.com
Apache License 2.0
28.95k stars 10.19k forks source link

Upgrading to 2.2.0, enabling LDAP support will cause circular dependencies error #5051

Closed TomXiaoYZ closed 4 months ago

TomXiaoYZ commented 6 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Upgrading to portal 2.2.0.
  2. Enable LDAP support.
  3. Set spring.main.allow-circular-references=true

Expected behavior Application should start normally.

Additional Details & Logs

Error Logs OpenJDK 64-Bit Server VM warning: UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release. OpenJDK 64-Bit Server VM warning: CMSFullGCsBeforeCompaction is deprecated and will likely be removed in a future release.


/ \   _ __   ___ | | | ___

/ \ | ' \ / | | |/ \ / | |) | () | | | () | // \\ ./ _/|||_/ |_|

:: Spring Boot :: (v2.7.11)

2023-12-18 15:22:42.874 INFO 1 --- [ main] c.c.f.apollo.portal.PortalApplication : Starting PortalApplication v2.2.0 using Java 1.8.0_342 on apollo-portal-7cdb5f5f76-9jw5p with PID 1 (/apollo-portal/apollo-portal-2.2.0.jar started by root in /apollo-portal) 2023-12-18 15:22:42.877 INFO 1 --- [ main] c.c.f.apollo.portal.PortalApplication : The following 3 profiles are active: "github", "mysql", "ldap" 2023-12-18 15:22:44.473 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode 2023-12-18 15:22:44.476 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2023-12-18 15:22:44.636 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 148 ms. Found 16 JPA repository interfaces. 2023-12-18 15:22:45.066 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'httpMessageConverterConfiguration' of type [com.ctrip.framework.apollo.common.controller.HttpMessageConverterConfiguration$$EnhancerBySpringCGLIB$$3244aed] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.344 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'messageConverters' of type [com.ctrip.framework.apollo.common.controller.HttpMessageConverterConfiguration$1] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.378 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean '(inner bean)#5ed731d0' of type [org.springframework.beans.factory.config.PropertiesFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.379 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean '(inner bean)#5ed731d0' of type [java.util.Properties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.379 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean '(inner bean)#62fe6067' of type [org.springframework.data.repository.core.support.PropertiesBasedNamedQueries] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.381 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean '(inner bean)#33e01298' of type [org.springframework.data.repository.core.support.RepositoryFragmentsFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.382 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean '(inner bean)#33e01298' of type [org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.384 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.sql.init.DataSourceInitializationConfiguration' of type [org.springframework.boot.autoconfigure.sql.init.DataSourceInitializationConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.385 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.406 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.435 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSource' of type [com.zaxxer.hikari.HikariDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.439 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.sql.init-org.springframework.boot.autoconfigure.sql.init.SqlInitializationProperties' of type [org.springframework.boot.autoconfigure.sql.init.SqlInitializationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.443 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSourceScriptDatabaseInitializer' of type [org.springframework.boot.autoconfigure.sql.init.SqlDataSourceScriptDatabaseInitializer] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.452 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.jpa-org.springframework.boot.autoconfigure.orm.jpa.JpaProperties' of type [org.springframework.boot.autoconfigure.orm.jpa.JpaProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.457 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.jpa.hibernate-org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties' of type [org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.460 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProvidersConfiguration$HikariPoolDataSourceMetadataProviderConfiguration' of type [org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProvidersConfiguration$HikariPoolDataSourceMetadataProviderConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.461 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'hikariPoolDataSourceMetadataProvider' of type [org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProvidersConfiguration$HikariPoolDataSourceMetadataProviderConfiguration$$Lambda$465/1705665942] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.467 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration' of type [org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.546 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'jpaVendorAdapter' of type [org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.550 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'entityManagerFactoryBuilder' of type [org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:45.565 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2023-12-18 15:22:45.814 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2023-12-18 15:22:45.907 INFO 1 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] 2023-12-18 15:22:45.992 INFO 1 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.6.15.Final 2023-12-18 15:22:46.312 INFO 1 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final} 2023-12-18 15:22:46.490 INFO 1 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect 2023-12-18 15:22:46.616 WARN 1 --- [ main] org.hibernate.cfg.AnnotationBinder : HHH000503: A class should not be annotated with both @Inheritance and @MappedSuperclass. @Inheritance will be ignored for: com.ctrip.framework.apollo.common.entity.BaseEntity. 2023-12-18 15:22:46.718 WARN 1 --- [ main] org.hibernate.cfg.AnnotationBinder : HHH000503: A class should not be annotated with both @Inheritance and @MappedSuperclass. @Inheritance will be ignored for: com.ctrip.framework.apollo.audit.entity.BaseEntity. 2023-12-18 15:22:47.797 INFO 1 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 2023-12-18 15:22:47.811 INFO 1 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2023-12-18 15:22:47.815 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'entityManagerFactory' of type [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:47.816 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'entityManagerFactory' of type [com.sun.proxy.$Proxy133] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:47.841 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean '(inner bean)#4763c727' of type [com.sun.proxy.$Proxy134] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:47.861 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'jpaMappingContext' of type [org.springframework.data.jpa.repository.config.JpaMetamodelMappingContextFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:47.861 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'jpaMappingContext' of type [org.springframework.data.jpa.mapping.JpaMetamodelMappingContext] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:48.176 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'serverConfigRepository' of type [org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:48.177 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'serverConfigRepository' of type [com.sun.proxy.$Proxy137] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:48.182 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'portalDBPropertySource' of type [com.ctrip.framework.apollo.portal.service.PortalDBPropertySource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:48.214 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration' of type [org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:48.221 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.transaction-org.springframework.boot.autoconfigure.transaction.TransactionProperties' of type [org.springframework.boot.autoconfigure.transaction.TransactionProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:48.222 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'platformTransactionManagerCustomizers' of type [org.springframework.boot.autoconfigure.transaction.TransactionManagerCustomizers] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:48.230 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'transactionManager' of type [org.springframework.orm.jpa.JpaTransactionManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:48.432 INFO 1 --- [ main] c.c.f.a.p.s.PortalDBPropertySource : Load config from DB : apollo.portal.envs = dev 2023-12-18 15:22:48.432 INFO 1 --- [ main] c.c.f.a.p.s.PortalDBPropertySource : Load config from DB : organizations = [{"orgId":"TEST1","orgName":"样例部门1"},{"orgId":"TEST2","orgName":"样例部门2"}]. Old value = null 2023-12-18 15:22:48.432 INFO 1 --- [ main] c.c.f.a.p.s.PortalDBPropertySource : Load config from DB : superAdmin = apollo. Old value = null 2023-12-18 15:22:48.432 INFO 1 --- [ main] c.c.f.a.p.s.PortalDBPropertySource : Load config from DB : api.readTimeout = 10000. Old value = null 2023-12-18 15:22:48.432 INFO 1 --- [ main] c.c.f.a.p.s.PortalDBPropertySource : Load config from DB : consumer.token.salt = someSalt. Old value = null 2023-12-18 15:22:48.432 INFO 1 --- [ main] c.c.f.a.p.s.PortalDBPropertySource : Load config from DB : admin.createPrivateNamespace.switch = true. Old value = null 2023-12-18 15:22:48.432 INFO 1 --- [ main] c.c.f.a.p.s.PortalDBPropertySource : Load config from DB : configView.memberOnly.envs = dev. Old value = null 2023-12-18 15:22:48.432 INFO 1 --- [ main] c.c.f.a.p.s.PortalDBPropertySource : Load config from DB : apollo.portal.meta.servers = {}. Old value = null 2023-12-18 15:22:48.434 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'portalConfig' of type [com.ctrip.framework.apollo.portal.component.config.PortalConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:48.440 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'apollo.audit.log-com.ctrip.framework.apollo.audit.ApolloAuditProperties' of type [com.ctrip.framework.apollo.audit.ApolloAuditProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:48.440 INFO 1 --- [ main] c.c.f.a.a.c.ApolloAuditAutoConfiguration : ApolloAuditAutoConfigure initializing... 2023-12-18 15:22:48.441 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'com.ctrip.framework.apollo.audit.configuration.ApolloAuditAutoConfiguration' of type [com.ctrip.framework.apollo.audit.configuration.ApolloAuditAutoConfiguration$$EnhancerBySpringCGLIB$$61ec165] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:48.454 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.ldap-com.ctrip.framework.apollo.portal.spi.configuration.LdapProperties' of type [com.ctrip.framework.apollo.portal.spi.configuration.LdapProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-12-18 15:22:48.455 WARN 1 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'methodValidationPostProcessor' defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: Unsatisfied dependency expressed through method 'methodValidationPostProcessor' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'restTemplateFactory' defined in URL [jar:file:/apollo-portal/apollo-portal-2.2.0.jar!/BOOT-INF/classes!/com/ctrip/framework/apollo/portal/component/RestTemplateFactory.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apolloAuditHttpInterceptor' defined in class path resource [com/ctrip/framework/apollo/audit/configuration/ApolloAuditAutoConfiguration.class]: Unsatisfied dependency expressed through method 'apolloAuditHttpInterceptor' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apolloAuditTraceContext' defined in class path resource [com/ctrip/framework/apollo/audit/configuration/ApolloAuditAutoConfiguration.class]: Unsatisfied dependency expressed through method 'apolloAuditTraceContext' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apolloAuditOperatorPortalSupplier' defined in URL [jar:file:/apollo-portal/apollo-portal-2.2.0.jar!/BOOT-INF/classes!/com/ctrip/framework/apollo/portal/audit/ApolloAuditOperatorPortalSupplier.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authConfiguration.SpringSecurityLDAPAuthAutoConfiguration' defined in URL [jar:file:/apollo-portal/apollo-portal-2.2.0.jar!/BOOT-INF/classes!/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration$SpringSecurityLDAPAuthAutoConfiguration.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'authConfiguration.SpringSecurityLDAPAuthAutoConfiguration': Requested bean is currently in creation: Is there an unresolvable circular reference? 2023-12-18 15:22:48.456 INFO 1 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 2023-12-18 15:22:48.457 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... 2023-12-18 15:22:48.469 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. 2023-12-18 15:22:48.486 INFO 1 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2023-12-18 15:22:48.529 ERROR 1 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

The dependencies of some of the beans in the application context form a cycle:

methodValidationPostProcessor defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class] ↓ restTemplateFactory defined in URL [jar:file:/apollo-portal/apollo-portal-2.2.0.jar!/BOOT-INF/classes!/com/ctrip/framework/apollo/portal/component/RestTemplateFactory.class] ↓ apolloAuditHttpInterceptor defined in class path resource [com/ctrip/framework/apollo/audit/configuration/ApolloAuditAutoConfiguration.class] ↓ apolloAuditTraceContext defined in class path resource [com/ctrip/framework/apollo/audit/configuration/ApolloAuditAutoConfiguration.class] ↓ apolloAuditOperatorPortalSupplier defined in URL [jar:file:/apollo-portal/apollo-portal-2.2.0.jar!/BOOT-INF/classes!/com/ctrip/framework/apollo/portal/audit/ApolloAuditOperatorPortalSupplier.class] ┌─────┐ | authConfiguration.SpringSecurityLDAPAuthAutoConfiguration defined in URL [jar:file:/apollo-portal/apollo-portal-2.2.0.jar!/BOOT-INF/classes!/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration$SpringSecurityLDAPAuthAutoConfiguration.class] └─────┘

Action:

Despite circular references being allowed, the dependency cycle between beans could not be broken. Update your application to remove the dependency cycle.

dosubot[bot] commented 6 months ago

🤖

Hello @TomXiaoYZ! 🚀

I'm Dosu, an AI bot here to assist you with your Apollo queries and pesky bugs while we wait for a human maintainer to jump in. Let's turn those 🐛 into 🦋 together! I'm also a great resource if you're interested in contributing to the project.

Just as a friendly reminder, I'm a bot, not a human. So if my jokes fall flat, blame my programmers. 😜 Ready when you are!

Based on the information provided, it seems like you're experiencing a circular dependency issue when upgrading to Apollo 2.2.0 and enabling LDAP support. This could be due to changes in the way beans are initialized or interact with each other in this version.

Unfortunately, I wasn't able to find specific changes in the Apollo 2.2.0 release that could potentially affect the LDAP support and cause circular dependencies. Similarly, I couldn't find any modifications implemented to the restTemplateFactory bean or the exact relationship between the beans mentioned in the error log.

However, I was able to find some information about the functions of the beans mentioned in the error log within the Apollo 2.2.0 release. These beans are part of the ApolloAuditAutoConfiguration.java file and are responsible for various aspects of managing the audit log, such as data influence, operator supply, trace context, HTTP request interception, and API pre-authorization.

If you're still experiencing this issue, it would be helpful to have more information. Could you please provide the exact error message you're seeing, as well as any relevant parts of your configuration? This could help in identifying the cause of the circular dependency issue.

Also, it might be worth checking if there are any custom beans or configurations in your application that could be interacting with these beans in a way that creates a circular dependency.

Lastly, you might want to consider upgrading your Java version. Apollo 2.2.0 might have some features or dependencies that are not fully compatible with Java 1.8.0_342.

I hope this helps! If you have any other questions or need further clarification, feel free to ask.

Best regards, Dosu

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

nobodyiam commented 6 months ago

Looks like an issue related with the apollo audit log feature, would you please config the apollo.audit.log.enabled to false in config/application.properties and try again?

BlackBear2003 commented 6 months ago

config the apollo.audit.log.enabled to false in config/application.properties and try again?

@nobodyiam I tried this and it couldn't start normally

***************************
APPLICATION FAILED TO START
***************************

Description:

The dependencies of some of the beans in the application context form a cycle:

   openApiAuthenticationFilter defined in class path resource [com/ctrip/framework/apollo/portal/spi/configuration/AuthFilterConfiguration.class]
      ↓
   consumerAuthUtil defined in file [/Users/weizhile/Developer/apollo/apollo-portal/target/classes/com/ctrip/framework/apollo/openapi/util/ConsumerAuthUtil.class]
      ↓
   consumerService defined in file [/Users/weizhile/Developer/apollo/apollo-portal/target/classes/com/ctrip/framework/apollo/openapi/service/ConsumerService.class]
┌─────┐
|  authConfiguration.SpringSecurityLDAPAuthAutoConfiguration defined in file [/Users/weizhile/Developer/apollo/apollo-portal/target/classes/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration$SpringSecurityLDAPAuthAutoConfiguration.class]
└─────┘

I will focus on this bug

BlackBear2003 commented 6 months ago

@nobodyiam I think maybe I found the bug of this issue!

There is a circular reference in LDAPAutoConfiguration itself since refactor(apollo-biz): Use constructor injection instead of field injection (#4826) and the bean referred is LdapTemplate

since 2023.4.4 LdapTemplate was add to constructor

image

while itself was injected by this configuration!

image

So I make those changes

image

then the circular reference has gone!! But I don't have ldap test properties to verify that my changes are correct. 🤕

nobodyiam commented 6 months ago

@BlackBear2003 Thank you for the prompt response! Previously, I had an LDAP test environment, but it was lost during the recent OS upgrade. I'm working on restoring it. In the meantime, if you're available, could you also attempt to establish an LDAP environment for testing? The last time, I successfully set it up following the guidelines in #1794.

BlackBear2003 commented 6 months ago

@BlackBear2003 Thank you for the prompt response! Previously, I had an LDAP test environment, but it was lost during the recent OS upgrade. I'm working on restoring it. In the meantime, if you're available, could you also attempt to establish an LDAP environment for testing? The last time, I successfully set it up following the guidelines in #1794.

I'd like to.😃

BlackBear2003 commented 6 months ago

@BlackBear2003 Thank you for the prompt response! Previously, I had an LDAP test environment, but it was lost during the recent OS upgrade. I'm working on restoring it. In the meantime, if you're available, could you also attempt to establish an LDAP environment for testing? The last time, I successfully set it up following the guidelines in #1794.

See https://github.com/apolloconfig/apollo/discussions/5056

nobodyiam commented 6 months ago

@TomXiaoYZ Fixed by #5055.

Jich1123 commented 6 months ago

docker pull apolloconfig/apollo-portal:2.2.0 this images has upgraded?

nobodyiam commented 6 months ago

It's not released yet.

stale[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

stale[bot] commented 4 months ago

This issue has been automatically closed because it has not had activity in the last 7 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.

hhy5861 commented 3 months ago

Is there any solution to this problem? I went back to 2.1.0. Was this issue not repackaged?

zhao-jing-hui commented 1 month ago

apollo.audit.log.enabled

它还没有发布。

大概什么时候发布呀 我配置ldap的时候也遇到了这种问题 2.2.0 image

BlackBear2003 commented 1 month ago

apollo.audit.log.enabled

它还没有发布。

大概什么时候发布呀 我配置ldap的时候也遇到了这种问题 2.2.0

如果急着使用的话,可以按着这个pr来自己修一下,改动很小很小。

https://github.com/apolloconfig/apollo/pull/5055/files