Skip to content

increase VARCHAR size of message link column#530

Merged
danthe1st merged 1 commit intoJava-Discord:mainfrom
danthe1st:increase_attachment_link_column_size
Feb 4, 2026
Merged

increase VARCHAR size of message link column#530
danthe1st merged 1 commit intoJava-Discord:mainfrom
danthe1st:increase_attachment_link_column_size

Conversation

@danthe1st
Copy link
Member

When a message contains an attachment link that's too big, synchronizing the message cache may fail. This can result in the /redeploy command failing (resulting in the bot not being stopped) as well:

Feb 04 15:06:32 instance-20240715-2322 bash[1671881]: MERGE INTO message_cache_attachments (message_id, attachment_index, link) VALUES (?, ?, ?) [22001-232]
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:100)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:102)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1548)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:688)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:710)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:1042)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at net.discordjug.javabot.data.h2db.message_cache.dao.MessageCacheRepository.insertList(MessageCacheRepository.java:56)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at java.base@25.0.1/java.lang.reflect.Method.invoke(Method.java:565)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:359)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:158)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:135)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:719)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at net.discordjug.javabot.data.h2db.message_cache.dao.MessageCacheRepository$$SpringCGLIB$$0.insertList(<generated>)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at net.discordjug.javabot.data.h2db.message_cache.MessageCache.synchronizeNow(MessageCache.java:99)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at net.discordjug.javabot.systems.staff_commands.RedeployCommand.execute(RedeployCommand.java:66)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at xyz.dynxsty.dih4jda.InteractionHandler.handleSlashCommand(InteractionHandler.java:538)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at xyz.dynxsty.dih4jda.InteractionHandler.lambda$onSlashCommandInteraction$16(InteractionHandler.java:643)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at java.base@25.0.1/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1825)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at java.base@25.0.1/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1817)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at java.base@25.0.1/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:511)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at java.base@25.0.1/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1450)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at java.base@25.0.1/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2019)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at java.base@25.0.1/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:832)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:808)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]: Caused by: org.h2.jdbc.JdbcBatchUpdateException: Value too long for column "LINK CHARACTER VARYING(255)": "'https://cdn.discordapp.com/attachments/653632583594278923/1466419532
934414560/T... (268)"; SQL statement:
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]: MERGE INTO message_cache_attachments (message_id, attachment_index, link) VALUES (?, ?, ?) [22001-232]
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1277)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:128)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at org.springframework.jdbc.core.JdbcTemplate.lambda$getPreparedStatementCallback$0(JdbcTemplate.java:1608)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:669)
Feb 04 15:06:32 instance-20240715-2322 bash[1671881]:         ... 23 more

@danthe1st danthe1st requested a review from a team as a code owner February 4, 2026 16:38
@danthe1st danthe1st merged commit 16464c3 into Java-Discord:main Feb 4, 2026
2 checks passed
@danthe1st danthe1st deleted the increase_attachment_link_column_size branch February 4, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants