Deeply nested folder structure fail on component key validation due to 400 character limit

  • versions used: SonarQube Version 8.6 (build 39681)
  • error observed: Component key length (402) is longer than the maximum authorized (400)
  • steps to reproduce: Scan a project with a short name, but with a very deep nested directory structure causing a the full path name, when combined with the project name and a colon, to exceed the 400 character limit.

We are running a quite recent build - Version 8.6 (build 39681) and experience the same issue as reportedly fixed Component key length is longer than the maximum authorized (400).

The project name we use is quite short, but some projects have a very deeply nested directory structure causing a the full path name to exceed the 400 character limit (when combined with the project name and a colon).

We are using a naming convention for the project name, to keep it unique and allow reporting issues in separate branches. I was thinking of hashing that string to use as a project name, but it will still not overcome the issue of the pathname concatenation, for which I have no control (any developer can create arbitrary long path names).

Would it not be possible to store the hash of the folder structure, instead of the entire string, as the postfix of the component key?

What do you suggest would be a possible workaround for this?

2 Likes

hi,

We are facing this as well. Any update on the fix ?

I believe that the file-path length should atleast be on the same lines as what the operating system accepts.

We use Linux containers.

Hello @avri-schneider-zi ,

Unfortunately I don’t see any workaround for your issue, however I’ve created a ticket to address that: https://jira.sonarsource.com/browse/SONAR-14584

1 Like

Hello @jacek.poreda , thank you for confirming this as a bug and for creating a ticket to address this issue!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.