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

FileNotFoundException (The filename, directory name, or volume label syntax is incorrect) #155

Closed
czerwinski1977 opened this issue May 5, 2017 · 9 comments

Comments

@czerwinski1977
Copy link

czerwinski1977 commented May 5, 2017

Hello,

Jenkins 2.53; cucumber-report plugin 3.7.0

I run in the problem that the reports cannot be generated. Jenkins output (project specific contents replaced by [...]):

[CucumberReport] JSON report directory is ""
[CucumberReport] Copied 4312 json files from workspace "C:\Program Files (x86)\Jenkins\[...]" to reports directory "C:\Program Files (x86)\Jenkins\jobs\[...]\builds\892\cucumber-html-reports\.cache"
[CucumberReport] Processing 3 json files:
[CucumberReport] C:\Program Files (x86)\Jenkins\jobs\[...]\builds\892\cucumber-html-reports\.cache\[...]\[...].protractor-report.json
[CucumberReport] C:\Program Files (x86)\Jenkins\jobs\[...]\builds\892\cucumber-html-reports\.cache\[...]\[...].protractor-report.json
[CucumberReport] C:\Program Files (x86)\Jenkins\jobs\[...]\builds\892\cucumber-html-reports\.cache\[...]\[...].protractor-report.json
[CucumberReport] Missing report result - report was not successfully completed
[CucumberReport] Build status is left unchanged

On the cucumber report page it says:

net.masterthought.cucumber.ValidationException: java.io.FileNotFoundException: C:\Program Files (x86)\Jenkins\jobs\[...]\builds\892\cucumber-html-reports\report-feature_[...dash-encoded path to a non-existent file...]-feature_1.html (The filename, directory name, or volume label syntax is incorrect)
	at net.masterthought.cucumber.generators.AbstractPage.generateReport(AbstractPage.java:78)
	at net.masterthought.cucumber.generators.AbstractPage.generatePage(AbstractPage.java:57)
	at net.masterthought.cucumber.ReportBuilder.generatePages(ReportBuilder.java:174)
	at net.masterthought.cucumber.ReportBuilder.generateReports(ReportBuilder.java:97)
	at net.masterthought.jenkins.CucumberReportPublisher.generateReport(CucumberReportPublisher.java:174)
	at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:112)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
	at hudson.model.Build$BuildExecution.post2(Build.java:186)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
	at hudson.model.Run.execute(Run.java:1760)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:405)
Caused by: java.io.FileNotFoundException: C:\Program Files (x86)\Jenkins\jobs\[...]\builds\892\cucumber-html-reports\report-feature_[...dash-encoded path to a non-existent file...]-feature_1.html (The filename, directory name, or volume label syntax is incorrect)
	at java.io.FileOutputStream.open0(Native Method)
	at java.io.FileOutputStream.open(Unknown Source)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at net.masterthought.cucumber.generators.AbstractPage.generateReport(AbstractPage.java:75)
	... 15 more

Can you help to solve that problem so the report is displayed?

Thank you!
Reinhard

@damianszczepanik
Copy link
Member

Attach json file. Error message does not look like we'll know issue.

@czerwinski1977
Copy link
Author

json-files.zip
json files attached. Thanks for your help!

@damianszczepanik
Copy link
Member

The problem is that Windows has file name limitation and yours already has break this limit. I'm talking about paths such as C:\\Program Files (x86)\\Jenkin...

@czerwinski1977
Copy link
Author

json-this-worked.zip
Curious, because these files used to work (see attached) -- I don't see the difference in the method here. Could you explain?
Thanks!

@damianszczepanik
Copy link
Member

The filename, directory name, or volume label syntax is incorrect is quite clear. It could not open such file so my suggestion is to shorten the path. You can use Silencio library

@czerwinski1977
Copy link
Author

@damianszczepanik , it appears you were right. We shortened the file names and now the files are found and analyzed. Thanks for your support!

@thefood
Copy link

thefood commented Jan 26, 2019

@damianszczepanik, how to shorten the file path?

@damianszczepanik
Copy link
Member

Upgrade the plugin

@lo-rodriguez
Copy link

This is very rare, to say the least.

I have my configuration like this

$ {LOG_DIR} \ appLog.log " Then when you start the application throw the following exception:

-ERROR in ch.qos.logback.core.rolling.RollingFileAppender [FILE] - openFile (c: logssolicitudesRepare \ appLog.log ", true) call failed. Java.io.FileNotFoundException: c: logssolicitudesRecamb \ appLog.log"

I don't understand why logback removes '' from the file path.
Now if I put '\' let me take one and but it also sends me the same exception, Again I change the value of the configuration to:

The same happens.
Could you tell me what file format works.
These are the Maven dependencies:

ch.qos.logback
logback-core
1.2.3


org.slf4j
slf4j-api
1.7.26
compile


ch.qos.logback
logback-classic
1.2.3

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