alibaba / nacos

an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.
https://nacos.io
Apache License 2.0
30.29k stars 12.84k forks source link

docker nacos-server:v2.2.1镜像启动失败! #10705

Closed yuluo-yx closed 1 year ago

yuluo-yx commented 1 year ago

Describe the bug 我在windwos系统中使用 docker pull nacos/nacos-server:v2.2.1 拉取 nacos镜像 之后使用如下命令启动nacos docker run --name nacos-server -e MODE=standalone -p 8848:8848 -d nacos/nacos-server:v2.2.1

容器状态为 Exited,查看日志如下:

2023-06-28 09:43:57 Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authFilterRegistration' defined in class path resource [com/alibaba/nacos/core/auth/AuthConfig.class]: Unsatisfied dependency expressed through method 'authFilterRegistration' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authFilter' defined in class path resource [com/alibaba/nacos/core/auth/AuthConfig.class]: Unsatisfied dependency expressed through method 'authFilter' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authConfigs': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'NACOS_AUTH_IDENTITY_KEY' in value "${NACOS_AUTH_IDENTITY_KEY}"
2023-06-28 09:43:57     at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:541)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:213)
2023-06-28 09:43:57     at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:212)
2023-06-28 09:43:57     at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:203)
2023-06-28 09:43:57     at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addServletContextInitializerBeans(ServletContextInitializerBeans.java:97)
2023-06-28 09:43:57     at org.springframework.boot.web.servlet.ServletContextInitializerBeans.<init>(ServletContextInitializerBeans.java:86)
2023-06-28 09:43:57     at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans(ServletWebServerApplicationContext.java:260)
2023-06-28 09:43:57     at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:234)
2023-06-28 09:43:57     at org.springframework.boot.web.embedded.tomcat.TomcatStarter.onStartup(TomcatStarter.java:53)
2023-06-28 09:43:57     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5211)
2023-06-28 09:43:57     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2023-06-28 09:43:57     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393)
2023-06-28 09:43:57     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1383)
2023-06-28 09:43:57     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2023-06-28 09:43:57     at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
2023-06-28 09:43:57     at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
2023-06-28 09:43:57     at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
2023-06-28 09:43:57     at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
2023-06-28 09:43:57     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2023-06-28 09:43:57     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393)
2023-06-28 09:43:57     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1383)
2023-06-28 09:43:57     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2023-06-28 09:43:57     at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
2023-06-28 09:43:57     at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
2023-06-28 09:43:57     at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
2023-06-28 09:43:57     at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:265)
2023-06-28 09:43:57     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2023-06-28 09:43:57     at org.apache.catalina.core.StandardService.startInternal(StandardService.java:430)
2023-06-28 09:43:57     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2023-06-28 09:43:57     at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
2023-06-28 09:43:57     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2023-06-28 09:43:57     at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486)
2023-06-28 09:43:57     at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:123)
2023-06-28 09:43:57     ... 21 common frames omitted
2023-06-28 09:43:57 Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authFilter' defined in class path resource [com/alibaba/nacos/core/auth/AuthConfig.class]: Unsatisfied dependency expressed through method 'authFilter' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authConfigs': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'NACOS_AUTH_IDENTITY_KEY' in value "${NACOS_AUTH_IDENTITY_KEY}"
2023-06-28 09:43:57     at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:541)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
2023-06-28 09:43:57     at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
2023-06-28 09:43:57     ... 61 common frames omitted
2023-06-28 09:43:57 Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authConfigs': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'NACOS_AUTH_IDENTITY_KEY' in value "${NACOS_AUTH_IDENTITY_KEY}"
2023-06-28 09:43:57     at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:405)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
2023-06-28 09:43:57     at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
2023-06-28 09:43:57     ... 75 common frames omitted
2023-06-28 09:43:57 Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'NACOS_AUTH_IDENTITY_KEY' in value "${NACOS_AUTH_IDENTITY_KEY}"
2023-06-28 09:43:57     at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:180)
2023-06-28 09:43:57     at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126)
2023-06-28 09:43:57     at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:239)
2023-06-28 09:43:57     at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210)
2023-06-28 09:43:57     at org.springframework.core.env.AbstractPropertyResolver.resolveNestedPlaceholders(AbstractPropertyResolver.java:230)
2023-06-28 09:43:57     at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver.getProperty(ConfigurationPropertySourcesPropertyResolver.java:79)
2023-06-28 09:43:57     at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver.getProperty(ConfigurationPropertySourcesPropertyResolver.java:60)
2023-06-28 09:43:57     at org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:594)
2023-06-28 09:43:57     at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$1.getProperty(PropertySourcesPlaceholderConfigurer.java:153)
2023-06-28 09:43:57     at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$1.getProperty(PropertySourcesPlaceholderConfigurer.java:149)
2023-06-28 09:43:57     at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:85)
2023-06-28 09:43:57     at org.springframework.core.env.PropertySourcesPropertyResolver.getPropertyAsRawString(PropertySourcesPropertyResolver.java:74)
2023-06-28 09:43:57     at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:159)
2023-06-28 09:43:57     at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126)
2023-06-28 09:43:57     at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:239)
2023-06-28 09:43:57     at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210)
2023-06-28 09:43:57     at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.lambda$processProperties$0(PropertySourcesPlaceholderConfigurer.java:191)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:936)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1332)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
2023-06-28 09:43:57     at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657)
2023-06-28 09:43:57     at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640)
2023-06-28 09:43:57     at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
2023-06-28 09:43:57     at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
2023-06-28 09:43:57     ... 87 common frames omitted
2023-06-28 09:43:57 2023-06-28 09:43:57,310 WARN [WatchFileCenter] start close
2023-06-28 09:43:57 
2023-06-28 09:43:57 2023-06-28 09:43:57,310 WARN [WatchFileCenter] start to shutdown this watcher which is watch : /home/nacos/conf
2023-06-28 09:43:57 
2023-06-28 09:43:57 2023-06-28 09:43:57,311 WARN [WatchFileCenter] already closed
2023-06-28 09:43:57 
2023-06-28 09:43:57 2023-06-28 09:43:57,312 WARN [NotifyCenter] Start destroying Publisher
2023-06-28 09:43:57 
2023-06-28 09:43:57 2023-06-28 09:43:57,312 WARN [NotifyCenter] Destruction of the end
2023-06-28 09:43:57 
2023-06-28 09:43:57 2023-06-28 09:43:57,313 ERROR Nacos failed to start, please see /home/nacos/logs/nacos.log for more details.
2023-06-28 09:43:57 
2023-06-28 09:43:57 2023-06-28 09:43:57,330 INFO 
2023-06-28 09:43:57 
2023-06-28 09:43:57 Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-06-28 09:43:57 
2023-06-28 09:43:57 2023-06-28 09:43:57,374 ERROR Application run failed
2023-06-28 09:43:57 
2023-06-28 09:43:57 org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2023-06-28 09:43:57     at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:163)
2023-06-28 09:43:57     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577)
2023-06-28 09:43:57     at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
2023-06-28 09:43:57     at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:745)
2023-06-28 09:43:57     at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:423)
2023-06-28 09:43:57     at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
2023-06-28 09:43:57     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317)
2023-06-28 09:43:57     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
2023-06-28 09:43:57     at com.alibaba.nacos.Nacos.main(Nacos.java:35)
2023-06-28 09:43:57     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2023-06-28 09:43:57     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2023-06-28 09:43:57     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2023-06-28 09:43:57     at java.lang.reflect.Method.invoke(Method.java:498)
2023-06-28 09:43:57     at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
2023-06-28 09:43:57     at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
2023-06-28 09:43:57     at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
2023-06-28 09:43:57     at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:467)
2023-06-28 09:43:57 Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2023-06-28 09:43:57     at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:142)
2023-06-28 09:43:57     at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:104)
2023-06-28 09:43:57     at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:479)
2023-06-28 09:43:57     at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:211)
2023-06-28 09:43:57     at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:182)
2023-06-28 09:43:57     at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:160)
2023-06-28 09:43:57     ... 16 common frames omitted
2023-06-28 09:43:57 Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authFilterRegistration' defined in class path resource [com/alibaba/nacos/core/auth/AuthConfig.class]: Unsatisfied dependency expressed through method 'authFilterRegistration' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authFilter' defined in class path resource [com/alibaba/nacos/core/auth/AuthConfig.class]: Unsatisfied dependency expressed through method 'authFilter' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authConfigs': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'NACOS_AUTH_IDENTITY_KEY' in value "${NACOS_AUTH_IDENTITY_KEY}"
2023-06-28 09:43:57     at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:541)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
2023-06-28 09:43:57     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:213)
2023-06-28 09:43:57     at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:212)
2023-06-28 09:43:57     at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:203)
2023-06-28 09:43:57     at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addServletContextInitializerBeans(ServletContextInitializerBeans.java:97)
2023-06-28 09:43:57     at org.springframework.boot.web.servlet.ServletContextInitializerBeans.<init>(ServletContextInitializerBeans.java:86)
2023-06-28 09:43:57     at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans(ServletWebServerApplicationContext.java:260)
2023-06-28 09:43:57     at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:234)
2023-06-28 09:43:57     at org.springframework.boot.web.embedded.tomcat.TomcatStarter.onStartup(TomcatStarter.java:53)
2023-06-28 09:43:57     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5211)
2023-06-28 09:43:57     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2023-06-28 09:43:57     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393)
2023-06-28 09:43:57     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1383)
2023-06-28 09:43:57     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2023-06-28 09:43:57     at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
2023-06-28 09:43:57     at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
2023-06-28 09:43:57     at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
2023-06-28 09:43:57     at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
2023-06-28 09:43:57     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2023-06-28 09:43:57     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393)
2023-06-28 09:43:57     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1383)
2023-06-28 09:43:57     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2023-06-28 09:43:57     at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
2023-06-28 09:43:57     at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
2023-06-28 09:43:57     at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
2023-06-28 09:43:57     at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:265)
2023-06-28 09:43:57     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2023-06-28 09:43:57     at org.apache.catalina.core.StandardService.startInternal(StandardService.java:430)
2023-06-28 09:43:57     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2023-06-28 09:43:57     at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
2023-06-28 09:43:57     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2023-06-28 09:43:57     at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486)
2023-06-28 09:43:57     at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:123)
2023-06-28 09:43:57     ... 21 common frames omitted
2023-06-28 09:43:57 Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authFilter' defined in class path resource [com/alibaba/nacos/core/auth/AuthConfig.class]: Unsatisfied dependency expressed through method 'authFilter' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authConfigs': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'NACOS_AUTH_IDENTITY_KEY' in value "${NACOS_AUTH_IDENTITY_KEY}"
shixuxi commented 1 year ago

显示的很明显撒,你的参数${NACOS_AUTH_IDENTITY_KEY}有问题,要不就是没有要不就是设置出了问题,这个版本貌似必须要设置这个参数,具体看https://nacos.io/zh-cn/docs/quick-start-docker.html这里瞅瞅

yuluo-yx commented 1 year ago

显示的很明显撒,你的参数${NACOS_AUTH_IDENTITY_KEY}有问题,要不就是没有要不就是设置出了问题,这个版本貌似必须要设置这个参数,具体看https://nacos.io/zh-cn/docs/quick-start-docker.html这里瞅瞅

但是 2.2.0 版本可以正常启动,同一个版本分支改动这么大吗?

shixuxi commented 1 year ago

显示的很明显撒,你的参数${NACOS_AUTH_IDENTITY_KEY}有问题,要不就是没有要不就是设置出了问题,这个版本貌似必须要设置这个参数,具体看https://nacos.io/zh-cn/docs/quick-start-docker.html这里瞅瞅

但是 2.2.0 版本可以正常启动,同一个版本分支改动这么大吗?

你再看看这个https://nacos.io/zh-cn/docs/auth.html

yuluo-yx commented 1 year ago

显示的很明显撒,你的参数${NACOS_AUTH_IDENTITY_KEY}有问题,要不就是没有要不就是设置出了问题,这个版本貌似必须要设置这个参数,具体看https://nacos.io/zh-cn/docs/quick-start-docker.html这里瞅瞅

但是 2.2.0 版本可以正常启动,同一个版本分支改动这么大吗?

你再看看这个https://nacos.io/zh-cn/docs/auth.html你再看看这个 https://nacos.io/zh-cn/docs/auth.html

文档所说,我可以使用此命令去启动一个nacos容器对吗? docker run --env PREFER_HOST_MODE=hostname --env MODE=standalone --env NACOS_AUTH_ENABLE=true -p 8848:8848 nacos/nacos-server 但是启动结果任然报错,相关配置中并没有 关于 NACOS_AUTH_IDENTITY_KEY 的相关描述

yuluo-yx commented 1 year ago

https://github.com/alibaba/nacos/issues/10190 此issue有相关描述,但是并没有docker启动nacos的有效解决办法

shixuxi commented 1 year ago

这种情况有两种解决办法,第一是最简单的:NACOS_AUTH_IDENTITY_KEY这个参数可以就像你配置NACOS_AUTH_ENABLE=true一样写在你的docker run语句中;第二种是将容器中的/home/nacos/conf/目录下面的application.properties文件挂载到宿主机,然后修改里面的配置就行了,然后重启容器。

shixuxi commented 1 year ago

10190 此issue有相关描述,但是并没有docker启动nacos的有效解决办法

我个人是使用的第二种方式

yuluo-yx commented 1 year ago

10190 此issue有相关描述,但是并没有docker启动nacos的有效解决办法

我个人是使用的第二种方式

非常感谢,我使用的地方是github的ci测试环境下,第二种方式并不支持,为了减少麻烦,我决定使用nacos2.2.0版本!

KomachiSion commented 1 year ago

2.2.1版本后 开启鉴权必须指定token,ideneityKey和Value, 否则不允许启动,这是安全风险的提示。 2.2.0开启鉴权后会有默认值风险,自行评估默认值是否会导致集群被撞库攻击,造成数据泄漏。