[Bug] [API] API can not start with oAUTH configuration | 3.2.2
Search before asking
- [X] I had searched in the issues and found no similar issues.
What happened
JAVA_HOME=/opt/java/openjdk
JAVA_OPTS=-Xms512m -Xmx512m -Xmn256m -XX:-UseContainerSupport
2024-07-25 12:26:34.354 +0000 INFO [org.hibernate.validator.internal.util.Version] - HV000001: Hibernate Validator 6.2.2.Final
[INFO] 2024-07-25 12:26:34.842 +0000 o.s.c.k.c.KubernetesClientUtils:[44] - Created API client in the cluster.
================================================================================
_ _ _ _ ____ _ _ _
__| | ___ | |_ __ | |__ (_)_ __ / ___| ___| |__ ___ __| |_ _| | ___ _ __
/ _` |/ _ \| | '_ \| '_ \| | '_ \\___ \ / __| '_ \ / _ \/ _` | | | | |/ _ \ '__|
| (_| | (_) | | |_) | | | | | | | |___) | (__| | | | __/ (_| | |_| | | __/ |
\__,_|\___/|_| .__/|_| |_|_|_| |_|____/ \___|_| |_|\___|\__,_|\__,_|_|\___|_|
|_|
================================================================================
:: DolphinScheduler api server :: (v3.2.2)
[INFO] 2024-07-25 12:26:35.355 +0000 o.s.c.b.c.PropertySourceBootstrapConfiguration:[109] - Located property source: [BootstrapPropertySource {name='bootstrapProperties-configmap.api-server.dolphinscheduler'}]
[INFO] 2024-07-25 12:26:35.365 +0000 o.a.d.a.ApiApplicationServer:[640] - The following 1 profile is active: "kubernetes"
[INFO] 2024-07-25 12:26:37.304 +0000 o.s.c.c.s.GenericScope:[283] - BeanFactory id=13767c53-de37-3da2-baf5-be0de99fd116
[INFO] 2024-07-25 12:26:37.787 +0000 o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker:[376] - Bean 'io.kubernetes.client.spring.extended.manifests.config.KubernetesManifestsAutoConfiguration' of type [io.kubernetes.client.spring.extended.manifests.config.KubernetesManifestsAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[INFO] 2024-07-25 12:26:37.804 +0000 o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker:[376] - Bean 'org.springframework.cloud.commons.config.CommonsConfigAutoConfiguration' of type [org.springframework.cloud.commons.config.CommonsConfigAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[INFO] 2024-07-25 12:26:37.806 +0000 o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker:[376] - Bean 'org.springframework.cloud.client.loadbalancer.LoadBalancerDefaultMappingsProviderAutoConfiguration' of type [org.springframework.cloud.client.loadbalancer.LoadBalancerDefaultMappingsProviderAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[INFO] 2024-07-25 12:26:37.808 +0000 o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker:[376] - Bean 'loadBalancerClientsDefaultsMappingsProvider' of type [org.springframework.cloud.client.loadbalancer.LoadBalancerDefaultMappingsProviderAutoConfiguration$$Lambda$477/1179799230] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[INFO] 2024-07-25 12:26:37.822 +0000 o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker:[376] - Bean 'defaultsBindHandlerAdvisor' of type [org.springframework.cloud.commons.config.DefaultsBindHandlerAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[INFO] 2024-07-25 12:26:37.828 +0000 o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker:[376] - Bean 'kubernetes.manifests-io.kubernetes.client.spring.extended.manifests.config.KubernetesManifestsProperties' of type [io.kubernetes.client.spring.extended.manifests.config.KubernetesManifestsProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[INFO] 2024-07-25 12:26:37.973 +0000 o.e.j.u.log:[170] - Logging initialized @5807ms to org.eclipse.jetty.util.log.Slf4jLog
[INFO] 2024-07-25 12:26:38.253 +0000 o.s.b.w.e.j.JettyServletWebServerFactory:[166] - Server initialized with port: 8080
[INFO] 2024-07-25 12:26:38.262 +0000 o.e.j.s.Server:[375] - jetty-9.4.48.v20220622; built: 2022-06-21T20:42:25.880Z; git: 6b67c5719d1f4371b33655ff2d047d24e171e49a; jvm 1.8.0_412-b08
[INFO] 2024-07-25 12:26:38.313 +0000 o.e.j.s.h.C.application:[2368] - Initializing Spring embedded WebApplicationContext
[INFO] 2024-07-25 12:26:38.313 +0000 o.s.b.w.s.c.ServletWebServerApplicationContext:[292] - Root WebApplicationContext: initialization completed in 2925 ms
[INFO] 2024-07-25 12:26:39.482 +0000 o.a.d.a.c.ApiConfig:[58] - API config: auditEnable -> false
[INFO] 2024-07-25 12:26:39.483 +0000 o.a.d.a.c.ApiConfig:[59] - API config: trafficControl -> ApiConfig.TrafficConfiguration(globalSwitch=false, maxGlobalQpsRate=300, tenantSwitch=false, defaultTenantQpsRate=10, customizeTenantQpsRate={})
[INFO] 2024-07-25 12:26:39.483 +0000 o.a.d.a.c.ApiConfig:[60] - API config: pythonGateway -> ApiConfig.PythonGatewayConfiguration(enabled=true, gatewayServerAddress=0.0.0.0, gatewayServerPort=25333, pythonAddress=127.0.0.1, pythonPort=25334, connectTimeout=0, readTimeout=0, authToken=jwUDzpLsNKEFER4*a8gruBH_GsAurNxU7A@Xc)
[INFO] 2024-07-25 12:26:39.627 +0000 o.e.j.s.session:[334] - DefaultSessionIdManager workerName=node0
[INFO] 2024-07-25 12:26:39.627 +0000 o.e.j.s.session:[339] - No SessionScavenger set, using defaults
[INFO] 2024-07-25 12:26:39.629 +0000 o.e.j.s.session:[132] - node0 Scavenging every 660000ms
[INFO] 2024-07-25 12:26:39.637 +0000 o.e.j.s.h.ContextHandler:[921] - Started o.s.b.w.e.j.JettyEmbeddedWebAppContext@633a11eb{application,/,[file:///tmp/jetty-docbase.8080.6111811476742742715/, jar:file:/opt/dolphinscheduler/libs/fs.realpath-1.0.0.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/swagger-ui-4.11.1.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/inherits-2.0.4.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/glob-8.1.0.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/semver-5.7.2.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/proto-list-1.2.4.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/balanced-match-1.0.2.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/once-1.4.0.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/nopt-6.0.0.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/config-chain-1.1.13.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/lru-cache-4.1.5.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/wrappy-1.0.2.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/inflight-1.0.6.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/js-beautify-1.14.7.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/pseudomap-1.0.2.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/commander-2.20.3.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/ini-1.3.8.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/editorconfig-0.15.3.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/sigmund-1.0.1.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/brace-expansion-2.0.1.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/yallist-2.1.2.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/minimatch-5.1.6.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/abbrev-1.1.1.jar!/META-INF/resources],AVAILABLE}
[INFO] 2024-07-25 12:26:39.637 +0000 o.e.j.s.Server:[415] - Started @7472ms
[WARN] 2024-07-25 12:26:39.727 +0000 o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext:[591] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apiApplicationServer': Unsatisfied dependency expressed through field 'pluginDao'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pluginDao': Unsatisfied dependency expressed through field 'pluginDefineMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginDefineMapper' defined in URL [jar:file:/opt/dolphinscheduler/libs/dolphinscheduler-dao-3.2.2.jar!/org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration]: Constructor threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.dolphinscheduler.dao.DaoConfiguration': Unsatisfied dependency expressed through field 'daoPluginConfiguration'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.dolphinscheduler.dao.plugin.api.DaoPluginConfiguration' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
[INFO] 2024-07-25 12:26:39.733 +0000 o.e.j.s.session:[149] - node0 Stopped scavenging
[INFO] 2024-07-25 12:26:39.734 +0000 o.e.j.s.h.ContextHandler:[1159] - Stopped o.s.b.w.e.j.JettyEmbeddedWebAppContext@633a11eb{application,/,[file:///tmp/jetty-docbase.8080.6111811476742742715/, jar:file:/opt/dolphinscheduler/libs/fs.realpath-1.0.0.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/swagger-ui-4.11.1.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/inherits-2.0.4.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/glob-8.1.0.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/semver-5.7.2.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/proto-list-1.2.4.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/balanced-match-1.0.2.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/once-1.4.0.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/nopt-6.0.0.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/config-chain-1.1.13.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/lru-cache-4.1.5.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/wrappy-1.0.2.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/inflight-1.0.6.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/js-beautify-1.14.7.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/pseudomap-1.0.2.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/commander-2.20.3.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/ini-1.3.8.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/editorconfig-0.15.3.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/sigmund-1.0.1.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/brace-expansion-2.0.1.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/yallist-2.1.2.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/minimatch-5.1.6.jar!/META-INF/resources, jar:file:/opt/dolphinscheduler/libs/abbrev-1.1.1.jar!/META-INF/resources],STOPPED}
[INFO] 2024-07-25 12:26:39.757 +0000 o.s.b.a.l.ConditionEvaluationReportLoggingListener:[136] -
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
[ERROR] 2024-07-25 12:26:39.827 +0000 o.s.b.d.LoggingFailureAnalysisReporter:[40] -
***************************
APPLICATION FAILED TO START
***************************
Description:
Field daoPluginConfiguration in org.apache.dolphinscheduler.dao.DaoConfiguration required a bean of type 'org.apache.dolphinscheduler.dao.plugin.api.DaoPluginConfiguration' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'org.apache.dolphinscheduler.dao.plugin.api.DaoPluginConfiguration' in your configuration.
What you expected to happen
Service should start
How to reproduce
values.yaml
api:
enableCustomizedConfig: true
customizedConfig:
application.yaml: |
security:
authentication:
type: OAUTH2
oauth2:
enable: true
provider:
okta:
authorizationUri: "xxx"
redirectUri: "xxx"
clientId: "xxx"
clientSecret: "xxx"
tokenUri: "xxx"
userInfoUri: "xxx"
callbackUrl: "xxx"
iconUri: "xxx"
provider: okta
Anything else
No response
Version
3.2.x
Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Hello, may I ask if this problem has been solved?
@yonghen1 nope
@yurymkomarov thank you,I know
@yurymkomarov It seems that your error may be a database configuration problem. Please provide a complete configuration file for better analysis.
@det101 I have a similar oauth configuration and encountered the same problem. here is my external postgresql (version 17.4) config:
datasource:
# -- The profile of datasource
profile: postgresql
postgresql:
# -- If not exists external PostgreSQL, by default, the DolphinScheduler will use a internal PostgreSQL
enabled: false
externalDatabase:
# -- If exists external database, and set postgresql.enable value to false.
# external database will be used, otherwise Dolphinscheduler's internal database will be used.
enabled: true
# -- The type of external database, supported types: postgresql, mysql
type: "postgresql"
# -- The host of external database
host: "xxx"
# -- The port of external database
port: "5432"
# -- The username of external database
username: "dolphinscheduler"
# -- The password of external database
password: "xxx"
# -- The database of external database
database: "dolphinscheduler"
# -- The params of external database
params: "characterEncoding=utf8"
# -- The driverClassName of external database
driverClassName: "org.postgresql.Driver"
user dolphinscheduler is the own of database dolphinscheduler, and dolphinscheduler-db-init-job create all tables successfully.