[halo-dev/halo]服务器重启后,halo博客启动失败

2023-12-08 788 views
4

What is version of Halo has the issue?

1.5.4

What database are you using?

MySQL 5.7

What is the project operation method?

Fat Jar

Your site address.

https://www.lixy98.cn

What happened?

昨日下午博客主题点了一下更新,提示更新失败。晚上重启了一下服务器,halo博客就提示报错 Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2023-10-19 19:22:42.199 ERROR 3421 --- [ main] o.s.boot.SpringApplication : Application run failed 此时我看他打印的还是我当前的域名

第二天我重启了一下数据库,再次启动halo博客依然报同样的错误,此时更奇怪的是打印的域名是我几个月之前的

Relevant log output

2023-10-20 09:52:34.371  INFO 21461 --- [           main] run.halo.app.listener.StartedListener    : Halo started at         http://www.lixinyuan.vip:8090
2023-10-20 09:52:34.371  INFO 21461 --- [           main] run.halo.app.listener.StartedListener    : Halo admin started at   http://www.lixinyuan.vip:8090/admin
2023-10-20 09:52:34.371  INFO 21461 --- [           main] run.halo.app.listener.StartedListener    : Halo has started successfully!
2023-10-20 09:52:34.905  INFO 21461 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-10-20 09:52:35.029 ERROR 21461 --- [           main] o.s.boot.SpringApplication               : Application run failed

java.lang.NullPointerException: null
    at run.halo.app.handler.theme.config.impl.YamlThemeConfigResolverImpl.lambda$handleOptions$4(YamlThemeConfigResolverImpl.java:182) ~[classes!/:1.5.4]
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) ~[na:na]
    at run.halo.app.handler.theme.config.impl.YamlThemeConfigResolverImpl.handleOptions(YamlThemeConfigResolverImpl.java:171) ~[classes!/:1.5.4]
    at run.halo.app.handler.theme.config.impl.YamlThemeConfigResolverImpl.lambda$handleItems$3(YamlThemeConfigResolverImpl.java:151) ~[classes!/:1.5.4]
    at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) ~[na:na]
    at run.halo.app.handler.theme.config.impl.YamlThemeConfigResolverImpl.handleItems(YamlThemeConfigResolverImpl.java:131) ~[classes!/:1.5.4]
    at run.halo.app.handler.theme.config.impl.YamlThemeConfigResolverImpl.lambda$handleTabs$1(YamlThemeConfigResolverImpl.java:82) ~[classes!/:1.5.4]
    at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) ~[na:na]
    at run.halo.app.handler.theme.config.impl.YamlThemeConfigResolverImpl.handleTabs(YamlThemeConfigResolverImpl.java:67) ~[classes!/:1.5.4]
    at run.halo.app.handler.theme.config.impl.YamlThemeConfigResolverImpl.resolve(YamlThemeConfigResolverImpl.java:35) ~[classes!/:1.5.4]
    at run.halo.app.service.impl.ThemeServiceImpl.fetchConfig(ThemeServiceImpl.java:293) ~[classes!/:1.5.4]
    at run.halo.app.service.impl.ThemeServiceImpl$$FastClassBySpringCGLIB$$aa446525.invoke(<generated>) ~[classes!/:1.5.4]
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.18.jar!/:5.3.18]
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) ~[spring-aop-5.3.18.jar!/:5.3.18]
    at run.halo.app.service.impl.ThemeServiceImpl$$EnhancerBySpringCGLIB$$7025dc2b.fetchConfig(<generated>) ~[classes!/:1.5.4]
    at run.halo.app.service.impl.ThemeSettingServiceImpl.getConfigItemMap(ThemeSettingServiceImpl.java:211) ~[classes!/:1.5.4]
    at run.halo.app.service.impl.ThemeSettingServiceImpl.listAsMapBy(ThemeSettingServiceImpl.java:137) ~[classes!/:1.5.4]
    at run.halo.app.service.impl.ThemeSettingServiceImpl$$FastClassBySpringCGLIB$$f53155.invoke(<generated>) ~[classes!/:1.5.4]
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.18.jar!/:5.3.18]
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) ~[spring-aop-5.3.18.jar!/:5.3.18]
    at run.halo.app.service.impl.ThemeSettingServiceImpl$$EnhancerBySpringCGLIB$$c0415ebb.listAsMapBy(<generated>) ~[classes!/:1.5.4]
    at run.halo.app.listener.freemarker.FreemarkerConfigAwareListener.lambda$loadThemeConfig$0(FreemarkerConfigAwareListener.java:191) ~[classes!/:1.5.4]
    at java.base/java.util.Optional.ifPresent(Optional.java:183) ~[na:na]
    at run.halo.app.listener.freemarker.FreemarkerConfigAwareListener.loadThemeConfig(FreemarkerConfigAwareListener.java:178) ~[classes!/:1.5.4]
    at run.halo.app.listener.freemarker.FreemarkerConfigAwareListener.onApplicationStartedEvent(FreemarkerConfigAwareListener.java:92) ~[classes!/:1.5.4]
    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.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:344) ~[spring-context-5.3.18.jar!/:5.3.18]
    at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:229) ~[spring-context-5.3.18.jar!/:5.3.18]
    at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:166) ~[spring-context-5.3.18.jar!/:5.3.18]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) ~[spring-context-5.3.18.jar!/:5.3.18]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) ~[spring-context-5.3.18.jar!/:5.3.18]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) ~[spring-context-5.3.18.jar!/:5.3.18]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421) ~[spring-context-5.3.18.jar!/:5.3.18]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378) ~[spring-context-5.3.18.jar!/:5.3.18]
    at org.springframework.boot.context.event.EventPublishingRunListener.started(EventPublishingRunListener.java:105) ~[spring-boot-2.5.12.jar!/:2.5.12]
    at org.springframework.boot.SpringApplicationRunListeners.lambda$started$5(SpringApplicationRunListeners.java:75) ~[spring-boot-2.5.12.jar!/:2.5.12]
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) ~[na:na]
    at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117) ~[spring-boot-2.5.12.jar!/:2.5.12]
    at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111) ~[spring-boot-2.5.12.jar!/:2.5.12]
    at org.springframework.boot.SpringApplicationRunListeners.started(SpringApplicationRunListeners.java:75) ~[spring-boot-2.5.12.jar!/:2.5.12]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:345) ~[spring-boot-2.5.12.jar!/:2.5.12]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1365) ~[spring-boot-2.5.12.jar!/:2.5.12]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-2.5.12.jar!/:2.5.12]
    at run.halo.app.Application.main(Application.java:21) ~[classes!/:1.5.4]
    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) ~[halo.jar:1.5.4]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[halo.jar:1.5.4]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[halo.jar:1.5.4]
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[halo.jar:1.5.4]

Additional information

No response

回答

6

昨日下午博客主题点了一下更新,提示更新失败。

具体怎么更新的?在哪里点的更新。

第二天我重启了一下数据库

什么数据库

从你提供的日志来看,似乎是主题的配置文件不符合规则。

你好,我刚才下载了一个1.6版本的halo包进行替换,启动的时候也报了相同的错误。 这个新版本的halo包里面没有我昨天动的主题啊

3

博客admin后台界面进行的更新,当时提示更新失败错误之类的

数据库版本mysql5.7

0

使用的什么主题?这个问题看起来是因为你 Halo 1.5 升级了适用于 Halo 2 的主题造成的。

你好,我刚才下载了一个1.6版本的halo包进行替换,启动的时候也报了相同的错误。 这个新版本的halo包里面没有我昨天动的主题啊

安装包并不包含主题,你安装的主题应该是存放在工作目录。

你好,使用的是dream主题。 我halo的工作目录在/usr/local/halo/
数据库的存储目录在/usr/local/mysql/data/halodb

我已经重新安装halo1.5.4版本了,替换/root/.halo 现在halo可以正常启动了,访问让我重新安装halo博客,请问原来的文章放在那里呢?还可以找到并导入进去吗?

3

你好,使用的是dream主题。 我halo的工作目录在/usr/local/halo/ 数据库的存储目录在/usr/local/mysql/data/halodb

我已经重新安装halo1.5.4版本了,替换/root/.halo

这有点让人迷惑,工作目录到底是在 /usr/local/halo/ 还是 /root/.halo?如果你之前使用的是 MySQL,只要 MySQL 数据库还在,理论上就算是清空工作目录也不会重新初始化。建议提供你完整的部署方式,不要忽略任何细节,否则我们无法根据当前的这些信息进行判断。

Halo 1.x 工作目录说明

0

你好,我刚将主题降级回去。现在文章之类的可以正常看到了,多谢作者!