ARTIFACTORY: How to solve the Artifacts-Repository-Folder-treebrowser failing to load

ARTIFACTORY: How to solve the Artifacts-Repository-Folder-treebrowser failing to load

AuthorFullName__c
Jian Sun
articleNumber
000006179
ft:sourceType
Salesforce
FirstPublishedDate
2024-09-05T10:44:38Z
lastModifiedDate
2024-09-05
VersionNumber
2
Introduction

When using ArtifactoryUI, you might encounter an issue where a specific directory tree fails to open, and you receive an error message from artifactory-service.log similar to the following:
org.artifactory.storage.StorageException: Failed to load tasks of type 'INDEX' : Query result set is too large
        at org.artifactory.storage.db.fs.service.TasksServiceImpl.getIndexTasks(TasksServiceImpl.java:59)
        at sun.reflect.GeneratedMethodAccessor845.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:206)
        at com.sun.proxy.$Proxy259.getIndexTasks(Unknown Source)
        at org.artifactory.search.archive.ArchiveIndexerImpl.triggerQueueIndexing(ArchiveIndexerImpl.java:183)
        at sun.reflect.GeneratedMethodAccessor843.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:206)
        at com.sun.proxy.$Proxy302.triggerQueueIndexing(Unknown Source)
        at org.artifactory.search.archive.ArchiveIndexerImpl$ArchiveIndexJob.onExecute(ArchiveIndexerImpl.java:321)
        at org.artifactory.schedule.quartz.QuartzCommand.execute(QuartzCommand.java:48)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
        at org.artifactory.concurrent.ArtifactoryRunnable.run(ArtifactoryRunnable.java:50)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: Query result set is too large
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3933)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3869)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2675)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2465)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1912)
        at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2020)
        at org.jfrog.storage.JdbcHelper.executeSelect(JdbcHelper.java:184)
        at org.jfrog.storage.JdbcHelper.executeSelect(JdbcHelper.java:152)
        at org.artifactory.storage.db.fs.dao.TasksDao.load(TasksDao.java:65)
        at org.artifactory.storage.db.fs.dao.TasksDao.load(TasksDao.java:52)
        at org.artifactory.storage.db.fs.service.TasksServiceImpl.getIndexTasks(TasksServiceImpl.java:56)

User-added image

This issue typically occurs because the result set from a MySQL query is too large, exceeding the server's default configuration, which prevents the ArtifactoryUI from properly loading the directory tree.


Resolution

To resolve this issue, you need to increase the max_allowed_packet parameter in MySQL. Follow these steps:
1. Log in to the MySQL Console
Access your MySQL database server using a MySQL client or SSH.
2. Set the max_allowed_packet Parameter
In the MySQL console, execute the following command to increase the `max_allowed_packet` value to 256MB (you can adjust this value as needed):
SET GLOBAL max_allowed_packet = 256 * 1024 * 1024;
3. Verify the Setting
Use the following command to check the current value of max_allowed_packet and ensure it has been updated:
SHOW VARIABLES LIKE 'max_allowed_packet';
4. Reload the Directory Tree
Reopen the ArtifactoryUI and check if the directory tree loads correctly.

Important Notes
After increasing the max_allowed_packet parameter, monitor your database performance to ensure that the larger packet size does not negatively impact server stability.