Why is it important that the database configured with the Artifactory has to be Case Sensitive?
Case-sensitive databases consider "Sample.xml" and "sample.xml" as distinct entries, which helps to avoid conflicts and keep unique records.
Artifactory requires this in order to accurately manage artifacts, maintain data integrity, ensure distinct identification of artifacts therefore allowing multiple versions or similarly named entities. This approach enhances indexing, enforces constraints accurately, adheres to established standards while supporting flexible naming conventions in code and helps in accurate metadata referencing for dependencies. Together, these factors significantly enhance performance and user experience.
How to check the collation of the database?
It is necessary that the DB used by Artifactory is case sensitive. DB, like MySQL or MSSQL, is case insensitive by default.
To check the Database collation, perform the following command:
mysql> SELECT @@character_set_database, @@collation_database;
MSSQL> SELECT name, collation_name FROM sys.databases;
If the result has “ci” it means that it is case-insensitive. Below is the result for MySQL
| utf8 | utf8_general_ci |
The character encoding used in mysql and mssql is utf8 and Latin1 respectively.
Steps to be followed if the database is Case-Insensitive - To fix the conflicting paths/artifacts
- Make sure to take a backup of your database
In order to prepare for any failure that may require a roll-back, take a snapshot of the latest database by following the best practices. Or, you may make a backup using Artifactory without the binaries (System Export with “Exclude Content” option - https://www.jfrog.com/confluence/display/RTF/Importing+and+Exporting#ImportingandExporting-SystemImportandExport).
- Shut down all Artifactory nodes
- Change DB to be case sensitive by running following mysql query
MySQL:
ALTER DATABASE artdb CHARACTER SET utf8 COLLATE utf8_bin;
MSSQL: ALTER DATABASE artifactory COLLATE Latin1_General_CS_AI;
- Confirm the change
mysql> SELECT @@character_set_database, @@collation_database;
MSSQL> SELECT name, collation_name FROM sys.databases;
The result should show utf8_bin as COLLATE for Mysql and Latin1_general for MSSQL.
- Start Artifactory nodes
For any Maven local repositories, Suppress POM Consistency Checks (Admin => Local repositories => your maven repository => Basic => Enable "Suppress POM Consistency Checks")
- To Detect if there are any conflicts run the following REST API with dry run enabled for each local repository, whose output is basically all the conflicting paths present within each repository.
DataBases
Since: 3.0.5
Security: Requires admin privileges
Usage: POST /api/repairPaths/{path}[?dry=true]
Produces: application/json
Sample Output:
POST /api/repairPaths/libs-release-local?dry=false
{
"conflicts": [
{
"conflicts": [
"saxo-nuget-local:SampleLibrary.1.0.0.nupkg"
],
"path": "saxo-nuget-local:SampleLibrary.1.0.0.nupkg"
},
{
"conflicts": [
"saxo-nuget-local:sampleLibrary.1.0.0.nupkg"
],
"path": "saxo-nuget-local:sampleLibrary.1.0.0.nupkg"
},
],
"message": "Completed",
"numConflicts": 2,
"numRepaired": 2
}
Be sure to save the output to files so you do not need to run it again, it will take a while and have a medium impact on performance.
- To Fix the conflicts: run the same REST API as above with dry run disabled, for each local repositories
POST http://<your-host>/artifactory/api/repairPaths/<repo>?dry=false

- Verify the fix by running the following REST API (with dry run enabled) for each local repository
POST http://<your-host>/artifactory/api/repairPaths/<repo>?dry=true
POST http://<your-host>/artifactory/api/repairPaths/<repo>?dry=true
Re-enable POM Consistency Checkes (Admin => Local repositories => your maven repository => Basic => Uncheck "Suppress POM Consistency Checks")