Illegal character in path with Git Submodules

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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

Symptoms

After making changes to the .gitmodules file, the following appears in the atlassian-bitbucket.log:

1 2 3 4 5 2014-09-03 10:49:12,833 ERROR [http-bio-7990-exec-45624] tiecimov @SCSPXTx649x2753980x1 1dxhfwc 10.4.148.55,10.100.5.155 "GET /projects/MCU32_REPOS/repos/p015_platform_alta/browse/mod HTTP/1.1" c.a.s.i.w.HandlerExceptionResolverImpl An error occurred while executing an external process: Illegal character in path at index 33: ../../folder/file.git track = master com.atlassian.bitbucket.exception.ServerException: An error occurred while executing an external process: Illegal character in path at index 33: ../../folder/file.git track = master at com.atlassian.bitbucket.scm.git.common.command.GitCommandExitHandler.evaluateThrowable(GitCommandExitHandler.java:104) ~[na:na]

Cause

This is caused by the line endings of the .gitmodules file not being in the correct format and is likely because Windows style line endings were committed to the repository.

Resolution

  1. Use dos2unix to convert the line endings to the correct format:

    1 dos2unix .gitmodules
  2. Commit the file and push it back to the Bitbucket Server instance.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.