Docker运行nacos老是报错
·
Docker运行nacos老是报错
2025-08-16 18:41:50,641 ERROR Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'basicAuthenticationFilter' defined in class path resource [com/alibaba/nacos/prometheus/filter/PrometheusAuthFilter.class]: Unsatisfied dependency expressed through method 'basicAuthenticationFilter' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nacosAuthConfig' defined in URL [jar:file:/home/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-plugin-default-impl-2.2.3.jar!/com/alibaba/nacos/plugin/auth/impl/NacosAuthConfig.class]: Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nacosUserDetailsServiceImpl': Unsatisfied dependency expressed through field 'userPersistService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'embeddedUserPersistServiceImpl': Unsatisfied dependency expressed through field 'databaseOperate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'standaloneDatabaseOperateImpl': Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError
2025-08-16 18:41:50,693 WARN Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2025-08-16 18:41:50,703 INFO Nacos Log files: /home/nacos/logs
2025-08-16 18:41:50,704 INFO Nacos Log files: /home/nacos/conf
2025-08-16 18:41:50,704 INFO Nacos Log files: /home/nacos/data
2025-08-16 18:41:50,709 ERROR Startup errors :
错误原因
这是因为v2.2.3版本的nacos镜像缺少文件,或者有权限问题,导致data目录复制不完整,我复制出来就是个几空目录,复制过程会显示只复制了几十KB。
解决方法
把版本换成v2.4.3就可以了,在复制文件的时候data文件夹有3M多。
更多推荐

所有评论(0)