"报错显示: [ERROR]-[2019-05-12 22:43:30]-[org.b3log.solo.service.ArticleMgmtService:210]: Updates github repos option failed org.b3log.latke.service.ServiceException .."

Solo 点击“我的开源”返回 404 错误

报错显示:

[ERROR]-[2019-05-12 22:43:30]-[org.b3log.solo.service.ArticleMgmtService:210]: Updates github repos option failed
org.b3log.latke.service.ServiceException: org.b3log.latke.repository.RepositoryException: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x92\xBE\xE7\xAE...' for column 'optionValue' at row 1
	at org.b3log.solo.service.OptionMgmtService.addOrUpdateOption(OptionMgmtService.java:82)
	at org.b3log.solo.service.OptionMgmtService_$$_jvstfc3_6._d0addOrUpdateOption(OptionMgmtService_$$_jvstfc3_6.java)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.b3log.latke.ioc.JavassistMethodHandler.invoke(JavassistMethodHandler.java:116)
	at org.b3log.solo.service.OptionMgmtService_$$_jvstfc3_6.addOrUpdateOption(OptionMgmtService_$$_jvstfc3_6.java)
	at org.b3log.solo.service.ArticleMgmtService.refreshGitHub(ArticleMgmtService.java:208)
	at org.b3log.solo.service.ArticleMgmtService_$$_jvstfc3_1c._d12refreshGitHub(ArticleMgmtService_$$_jvstfc3_1c.java)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.b3log.latke.ioc.JavassistMethodHandler.invoke(JavassistMethodHandler.java:116)
	at org.b3log.solo.service.ArticleMgmtService_$$_jvstfc3_1c.refreshGitHub(ArticleMgmtService_$$_jvstfc3_1c.java)
	at org.b3log.solo.service.CronMgmtService.lambda$start$1(CronMgmtService.java:99)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.b3log.latke.repository.RepositoryException: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x92\xBE\xE7\xAE...' for column 'optionValue' at row 1
	at org.b3log.latke.repository.jdbc.JdbcRepository.add(JdbcRepository.java:155)
	at org.b3log.latke.repository.AbstractRepository.add(AbstractRepository.java:100)
	at org.b3log.solo.service.OptionMgmtService.addOrUpdateOption(OptionMgmtService.java:65)
	... 22 more
Caused by: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x92\xBE\xE7\xAE...' for column 'optionValue' at row 1
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:975)
	at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:392)
	at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
	at org.b3log.latke.repository.jdbc.util.JdbcUtil.executeSql(JdbcUtil.java:91)
	at org.b3log.latke.repository.jdbc.JdbcRepository.add(JdbcRepository.java:150)
	... 24 more

感觉不像是数据库编码的问题,白天还正常能用

  • Solo

    Solo 是一款小而美的开源博客系统,专为程序员设计。

    Solo 有着非常活跃的社区,可将文章作为帖子推送到社区,来自社区的回帖将作为博客评论进行联动。

    这是一种全新的网络社区体验,让热爱记录和分享的你不再感到孤单!
    具体细节请浏览 B3log 构思

    647 引用 • 4968 回帖 • 714 关注
  • Q&A

    提问之前请先看一下这篇文章 《提问的智慧》精读注解版,好的问题比好的答案更有价值。

    1036 引用 • 6615 回帖 • 598 关注
被采纳的回答
  • 88250    

    文本、字符类型字段必须使用 utf8mb4 字符集。

5 回帖   
请输入回帖内容...
  • AdlerED  

    补一条关键报错:

    [ERROR]-[2019-05-12 22:43:30]-[org.b3log.latke.repository.jdbc.JdbcRepository:153]: Add failed
    

    源码位置:

        public String add(JSONObject jsonObject) throws RepositoryException {
            if (!this.isWritable()) {
                throw new RepositoryException("The repository [name=" + this.getName() + "] is not writable at present");
            } else {
                Repositories.check(this.getName(), jsonObject, new String[]{Keys.OBJECT_ID});
                return this.repository.add(jsonObject);
            }
        }
    
  • AdlerED  

    @88250 求助 ~

  • 88250

    文本、字符类型字段必须使用 utf8mb4 字符集。

  • zhuzizzb  

    一样的问题,求解大家是肿么解决的

    1 回复
  • 88250      

    1. 手动调整一下数据库表中的文本、字符类型列使用 utf8mb4 字符集
    2. 如果是 docker 部署的话 pull 最新镜像重启即可;如果是 war 部署的话等 v3.6.3 发布或者参考这里进行修复