"Invalid file name for use with -Xloggc" when starting Windows Service
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When the Windows Service is installed, either manually or due a Confluence upgrade, after trying to start the service, the following message is received:
Invalid file name for use with -Xloggc: Filename can only contain the characters [A-Z][a-z][0-9]-_.%[p|t] but it has been "<confluence-install-path>\logs\gc-%t.log"
Environment
Confluence running on a Windows OS.
Diagnosis
- Check the Windows Service Properties as well as the Windows Registry entry for the Confluence service, and look for the -Xloggc parameter
- Verify whether there are quotes around the path on this property, such as:
-Xloggc:"<confluence-install>\logs\gc-%t.log"
Cause
The -Xloggc parameter does not allow quotes around the defined path. Otherwise, it will throw the "Invalid file name for use with -Xloggc" error.
Solution
Remove any quotes from the path defined on the -Xloggc parameter. For example, change the following line:
-Xloggc:"<confluence-install>\logs\gc-%t.log"
To the one below:
-Xloggc:<confluence-install>\logs\gc-%t.log