Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

保存文章bug,保存分类bug #1681

Closed
rookiehander opened this issue Feb 25, 2022 · 26 comments · Fixed by #1695
Closed

保存文章bug,保存分类bug #1681

rookiehander opened this issue Feb 25, 2022 · 26 comments · Fixed by #1695
Assignees
Labels
confirmed Issue has been confirmed by VS Code Team member resolved

Comments

@rookiehander
Copy link

是什么版本出现了此问题?

1.5.0-alpha.1

使用的什么数据库?

MySQL 8.x

使用的哪种方式部署?

Docker

在线站点地址

No response

发生了什么?

修改日志或者文章的时候,会出现500.

相关日志输出

java.lang.IllegalArgumentException: json value must not be null
	at org.springframework.util.Assert.hasText(Assert.java:289) ~[spring-core-5.3.15.jar:5.3.15]
	at run.halo.app.cache.AbstractStringCacheStore.jsonToCacheWrapper(AbstractStringCacheStore.java:22) ~[classes/:1.5.0-alpha.1]
	at run.halo.app.cache.LevelCacheStore.lambda$toMap$0(LevelCacheStore.java:127) ~[classes/:1.5.0-alpha.1]
	at java.base/java.lang.Iterable.forEach(Unknown Source) ~[na:na]
	at run.halo.app.cache.LevelCacheStore.toMap(LevelCacheStore.java:124) ~[classes/:1.5.0-alpha.1]
	at run.halo.app.service.impl.AuthorizationServiceImpl.doDeleteAuthorization(AuthorizationServiceImpl.java:67) ~[classes/:1.5.0-alpha.1]
	at run.halo.app.service.impl.AuthorizationServiceImpl.deleteCategoryAuthorization(AuthorizationServiceImpl.java:57) ~[classes/:1.5.0-alpha.1]
	at run.halo.app.service.impl.CategoryServiceImpl.update(CategoryServiceImpl.java:540) ~[classes/:1.5.0-alpha.1]
	at run.halo.app.service.impl.CategoryServiceImpl.update(CategoryServiceImpl.java:60) ~[classes/:1.5.0-alpha.1]
	at run.halo.app.service.impl.CategoryServiceImpl$$FastClassBySpringCGLIB$$816363be.invoke(<generated>) ~[classes/:1.5.0-alpha.1]
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.15.jar:5.3.15]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783) ~[spring-aop-5.3.15.jar:5.3.15]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.15.jar:5.3.15]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.15.jar:5.3.15]
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[spring-tx-5.3.15.jar:5.3.15]
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) ~[spring-tx-5.3.15.jar:5.3.15]
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-5.3.15.jar:5.3.15]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.15.jar:5.3.15]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.15.jar:5.3.15]
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698) ~[spring-aop-5.3.15.jar:5.3.15]
	at run.halo.app.service.impl.CategoryServiceImpl$$EnhancerBySpringCGLIB$$6c6facc7.update(<generated>) ~[classes/:1.5.0-alpha.1]
	at run.halo.app.controller.admin.api.CategoryController.updateBy(CategoryController.java:90) ~[classes/:1.5.0-alpha.1]
	at run.halo.app.controller.admin.api.CategoryController$$FastClassBySpringCGLIB$$93c205c3.invoke(<generated>) ~[classes/:1.5.0-alpha.1]
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.15.jar:5.3.15]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783) ~[spring-aop-5.3.15.jar:5.3.15]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.15.jar:5.3.15]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.15.jar:5.3.15]
	at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89) ~[spring-aop-5.3.15.jar:5.3.15]
	at run.halo.app.core.ControllerLogAop.controller(ControllerLogAop.java:48) ~[classes/:1.5.0-alpha.1]
	at jdk.internal.reflect.GeneratedMethodAccessor174.invoke(Unknown Source) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]

附加信息

No response

@rookiehander rookiehander added the kind/bug Categorizes issue or PR as related to a bug. label Feb 25, 2022
@ruibaby
Copy link
Member

ruibaby commented Feb 25, 2022

你好,请提供详细的复现步骤。

@ruibaby ruibaby added the needs more info Issue requires more information from poster label Feb 25, 2022
@halo-dev-bot
Copy link
Collaborator

感谢您创建了这个issue! 请提供更多的描述或错误日志以帮助我们理解您的问题。

@rookiehander
Copy link
Author

先创建一个分类:java
image
创建文章:选择分类:

image
报错500 Server Error

@rookiehander
Copy link
Author

image
报错信息

@JohnNiang
Copy link
Member

Hi @guqing ,可以帮忙看看这个问题么。这一块儿可能比较熟悉。

@ruibaby
Copy link
Member

ruibaby commented Feb 25, 2022

/assign @guqing

@ruibaby
Copy link
Member

ruibaby commented Feb 25, 2022

@rookiehander 请问你的部署或者升级流程是怎样的呢?因为看到你写的是 1.5.0-alpha.1,但是你截图的界面是 1.4.x 的版本。

@guqing
Copy link
Member

guqing commented Feb 25, 2022

Hi @guqing ,可以帮忙看看这个问题么。这一块儿可能比较熟悉。

好的 在排查 看到这块报错是在
image
这个方法 应该是缓存结构不对我问一下

@guqing
Copy link
Member

guqing commented Feb 25, 2022

@rookiehander 你的缓存使用的是什么呢
image
上述图片中的 cache 值是 memery 还是 level

@rookiehander
Copy link
Author

image
level

@guqing
Copy link
Member

guqing commented Feb 25, 2022

image level

@rookiehander 到 .halo目录下 删除 .leveldb 缓存目录 然后重新登录试一下

@rookiehander
Copy link
Author

没有这个文件。

@guqing
Copy link
Member

guqing commented Feb 25, 2022

是隐藏目录呢使用 ls -a 看一下.或者执行 rm -rf /root/.halo/.leveldb

@rookiehander
Copy link
Author

image
image
没啥用

@guqing
Copy link
Member

guqing commented Feb 25, 2022

那你是升级 还是全新安装呢,是否确定docker挂载的是你刚刚删除.leveldb的目录,可以进入docker容器内部检查一下

@rookiehander
Copy link
Author

image
哪个?

@guqing
Copy link
Member

guqing commented Feb 25, 2022

或者简单的方式 你将缓存配置 改为 memory 然后重启 halo
image

@guqing
Copy link
Member

guqing commented Feb 25, 2022

image 哪个?

在容器内部执行 rm -rf /root/.halo/.leveldb

@rookiehander
Copy link
Author

大致是你们哪个缓存问题,我修改缓存方式重启了之后没啥问题。

@guqing
Copy link
Member

guqing commented Feb 25, 2022

因为该日志说明问题是出在缓存上 初步判断是因为你使用了 leveldb 升级halo时 leveldb从持久化文件中恢复缓存到内存,但内存结构变了导致无法解析缓存,所以你可以尝试将配置文件中使用的缓存方式改为 memery然后重启服务

@guqing
Copy link
Member

guqing commented Feb 25, 2022

大致是你们哪个缓存问题,我修改缓存方式重启了之后没啥问题。

好的 没问题的话 那我就关闭此issue了

@guqing guqing added confirmed Issue has been confirmed by VS Code Team member resolved and removed kind/bug Categorizes issue or PR as related to a bug. confirmation-pending labels Feb 25, 2022
@JohnNiang
Copy link
Member

@guqing ,我们是不是需要处理一下解析失败的问题呢?比如解析失败就丢弃这个缓存。

@guqing guqing removed the needs more info Issue requires more information from poster label Feb 25, 2022
@ruibaby
Copy link
Member

ruibaby commented Feb 25, 2022

好的 没问题的话 那我就关闭此issue了

@guqing 需要创建一个 issue 来跟踪 leveldb 缓存的问题。

@rookiehander
Copy link
Author

我明白你的意思了,就是我使用了老版本的缓存服务跑在了本地,然后新的服务缓存处理方式不一样导致的问题吗?但是我只启动了一个服务就是新版本的。而且如果缓存实现建议丢弃就行了,不应该因为缓存失效导致功能无法使用。

@guqing
Copy link
Member

guqing commented Feb 25, 2022

我明白你的意思了,就是我使用了老版本的缓存服务跑在了本地,然后新的服务缓存处理方式不一样导致的问题吗?但是我只启动了一个服务就是新版本的。而且如果缓存实现建议丢弃就行了,不应该因为缓存失效导致功能无法使用。

是的

@rookiehander
Copy link
Author

那我关闭了,你们处理吧,哈哈哈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed Issue has been confirmed by VS Code Team member resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants