Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long paths in nested folders / files can result in a "File name too long" error #135

Open
christian-roggia opened this issue Mar 9, 2022 · 3 comments

Comments

@christian-roggia
Copy link

christian-roggia commented Mar 9, 2022

Jenkins and plugins versions report

Environment Cobertura Jenkins Plugin version: 1.17

What Operating System are you using (both controller, and any agents involved in the problem)?

GKE - Kubernetes - Linux

Anything else?

The method IOUtil.sanitizeFilename is not safe for very nested folders / files.
The method allows for filenames longer than 255 characters to be generated which will result in a "File name too long" error.

This issue was encountered in our Jenkins environment as paths can be longer than 255 characters but single file names can't.

https://github.com/jenkinsci/cobertura-plugin/blob/master/src/main/java/hudson/plugins/cobertura/IOUtils.java#L36-L46

@moppetit
Copy link

Also encountering this in our linux Jenkins environment with plugin v1.17 where generated file names are over 255 chars resulting in File name too long errors being thrown when attempting to publish the report.

@christian-roggia did you resolve or workaround this?

@glechev
Copy link

glechev commented Dec 2, 2022

This is a regression in plugin 1.17 caused by this commit https://github.com/jenkinsci/cobertura-plugin/pull/130/files#diff-9c649eb6c5c9591cd38e9957dbd1d0d95d0542750395e19daf0a71d79734f54bL139

Previously this error was handled - it's still failing with 1.16, but it only prints the exception in the logs. In 1.17, the build step fails.

@sq33G
Copy link

sq33G commented Aug 14, 2023

Does anyone have a workaround for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants