ARTIFACTORY: How to Increase the Maximum Allowed Character Length for AQL Queries
By default, JFrog Artifactory enforces a limit on the length of Artifactory Query Language (AQL) queries to ensure database stability and prevent memory exhaustion. The default limit is set to 6000 characters.
If a user or an automation script attempts to execute an AQL query that exceeds this limit, the request will fail:
$ curl -u <USERNAME>:<PASSWORD> -X POST "http://<ARTIFACTORY_URL>/artifactory/api/search/aql" \ -H "Content-Type: text/plain" \ -d "items.find(...)" AQL query is too long; please reduce the query length to less than 6000 chars
To change this behavior, it is required to define a specific system property in the Artifactory configuration file and restart the service.
Step-by-Step Instructions
- Log in to your Artifactory server via SSH.
- Navigate to the artifactory configuration directory. By default, this file is located at: #JFROG_HOME/artifactory/var/etc/artifactory/artifactory.system.properties
- Open the artifactory.system.properties file using a text editor (such as vi or nano) and append the following line:
artifactory.aql.search.query.size.limit=<DESIRED_LIMIT>
- Replace <DESIRED_LIMIT> with your required character count.
- Example: To increase the limit to 8,000 characters:
Propertiesartifactory.aql.search.query.size.limit=8000
- Replace <DESIRED_LIMIT> with your required character count.
- Save your changes and exit the text editor.
- For the system property to take effect, you must restart the Artifactory service.
For more information and limitations of the AQL, please refer to the following article.