Failed to create log.html and report.html in Jenkins job

2,823 views
Skip to first unread message

Thomas Maier

unread,
Jun 24, 2012, 10:11:00 AM6/24/12
to robotframe...@googlegroups.com
Hi,

I have the follow problem. There is RF suite running in separate Jenkins job.
The test pass successfully but failed to produce the log.html and report.html.
Or, to be more precise, it does produce them but both are empty.
Strangely - output.xml was created successfully.
The follow is the final part of the test output:

{{{
Jenkins :: Test Suite for the Jenkins job | PASS |
75 critical tests, 75 passed, 0 failed
75 tests total, 75 passed, 0 failed
==============================================================================
Output: /path/results/output.xml
[ ERROR ] Writing log file '/path/results/log.html' failed: No such
file or directory
[ ERROR ] Writing report file '/path/results/report.html' failed: No
such file or directory
Archiving artifacts
Recording fingerprints
Finished: SUCCESS
}}}

Any idea why it may happen?

Thanks ahead,
Thomas

Mikko Korpela

unread,
Jun 24, 2012, 11:08:11 AM6/24/12
to tho...@tonian.com, robotframe...@googlegroups.com
Hi Thomas,

There is most likely something wrong with the output.xml.

What version of Robot Framework are you using?

You could try to make the log and report with rebot tool from the output.xml.

--
Mikko Korpela
> --
> You received this message because you are subscribed to the Google Groups "robotframework-users" group.
> To post to this group, send email to robotframe...@googlegroups.com.
> To unsubscribe from this group, send email to robotframework-u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/robotframework-users?hl=en.
>

Pekka Klärck

unread,
Jun 24, 2012, 1:02:01 PM6/24/12
to mikko....@gmail.com, tho...@tonian.com, robotframe...@googlegroups.com
2012/6/24 Mikko Korpela <mikko....@gmail.com>:
>
> There is most likely something wrong with the output.xml.

Based on the error message it actually seems that opening log and
report files for writing fails. "No such file or directory" error
would indicate that the directory where to write these files wouldn't
exist, but it is pretty strange that those files end up being empty.

> What version of Robot Framework are you using?

Are you using Python or Jython? Which version?

Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

Thomas Maier

unread,
Jun 24, 2012, 2:29:28 PM6/24/12
to Pekka Klärck, mikko....@gmail.com, robotframe...@googlegroups.com
On Sun, Jun 24, 2012 at 8:02 PM, Pekka Klärck <pe...@iki.fi> wrote:
> 2012/6/24 Mikko Korpela <mikko....@gmail.com>:
>>
>> There is most likely something wrong with the output.xml.
At least xmllint shows that everything seems to be ok with this file.

>
> Based on the error message it actually seems that opening log and
> report files for writing fails. "No such file or directory" error
> would indicate that the directory where to write these files wouldn't
> exist, but it is pretty strange that those files end up being empty.
Also output.xml is written into the same directory.

>
>> What version of Robot Framework are you using?
2.7.3

>
> Are you using Python or Jython? Which version?
python 2.7.1 on fedora15

Mikko Korpela

unread,
Jun 25, 2012, 2:00:38 AM6/25/12
to Thomas Maier, Pekka Klärck, robotframe...@googlegroups.com
2012/6/24 Thomas Maier <tho...@tonian.com>:
> On Sun, Jun 24, 2012 at 8:02 PM, Pekka Klärck <pe...@iki.fi> wrote:
>> 2012/6/24 Mikko Korpela <mikko....@gmail.com>:
>>>
>>> There is most likely something wrong with the output.xml.
> At least xmllint shows that everything seems to be ok with this file.

I'm not suggesting that the xml syntax would be broken but that it could
have some parts that Robot Framework for some reason can not correctly parse.

try: "rebot output.xml"

>
>>
>> Based on the error message it actually seems that opening log and
>> report files for writing fails. "No such file or directory" error
>> would indicate that the directory where to write these files wouldn't
>> exist, but it is pretty strange that those files end up being empty.
> Also output.xml is written into the same directory.
>
>>
>>> What version of Robot Framework are you using?
> 2.7.3
>
>>
>> Are you using Python or Jython? Which version?
> python 2.7.1 on fedora15
>
>>
>> Cheers,
>>    .peke
>> --
>> Agile Tester/Developer/Consultant :: http://eliga.fi
>> Lead Developer of Robot Framework :: http://robotframework.org



--
Mikko Korpela

Thomas Maier

unread,
Jun 25, 2012, 3:21:18 AM6/25/12
to Mikko Korpela, Pekka Klärck, robotframe...@googlegroups.com
On Mon 25 Jun 2012 09:00:38 AM IDT, Mikko Korpela wrote:
> 2012/6/24 Thomas Maier <tho...@tonian.com>:
>> On Sun, Jun 24, 2012 at 8:02 PM, Pekka Klärck <pe...@iki.fi> wrote:
>>> 2012/6/24 Mikko Korpela <mikko....@gmail.com>:
>>>>
>>>> There is most likely something wrong with the output.xml.
>> At least xmllint shows that everything seems to be ok with this file.
>
> I'm not suggesting that the xml syntax would be broken but that it could
> have some parts that Robot Framework for some reason can not correctly parse.
>
> try: "rebot output.xml"
I've got the same error.
How can I verify corectness of output.xml?

Pekka Klärck

unread,
Jun 25, 2012, 3:50:41 AM6/25/12
to Thomas Maier, Mikko Korpela, robotframework-users

25.6.2012 10.21 "Thomas Maier" <tho...@tonian.com> kirjoitti:
> On Mon 25 Jun 2012 09:00:38 AM IDT, Mikko Korpela wrote:
>
> > I'm not suggesting that the xml syntax would be broken but that it could
> > have some parts that Robot Framework for some reason can not correctly parse.
> >
> > try: "rebot output.xml"
>
> I've got the same error.
> How can I verify corectness of output.xml?

This is _really_ strange. The problem being easy to reproduce is good news, though.

If your test data doesn't contain confidential information, you could send it to Mikko and/or I for analysis. Alternatively we can try give you details how to debug the problem yourself.

Cheers,
     .peke

Mika Hänninen

unread,
Jun 25, 2012, 8:14:36 AM6/25/12
to robotframe...@googlegroups.com
I had similar problem earlier today.

The output.xml was created correctly,but HTML files were not created.The HTML file creation resulted in "Permission Denied" error and I did not find any additional information about the error (tried with DEBUG level logging).

My problem went away when I upgraded RF to version 2.7.3 from version 2.7.2

$ pybot --version
Robot Framework 2.7.3 (Python 2.7.3 on linux2)

Best Regards,
Mika

Pekka Klärck

unread,
Jun 25, 2012, 11:27:08 AM6/25/12
to tho...@tonian.com, robotframe...@googlegroups.com
2012/6/24 Thomas Maier <tho...@tonian.com>:
>
> I have the follow problem. There is RF suite running in separate Jenkins job.
> The test pass successfully but failed to produce the log.html and report.html.
> Or, to be more precise, it does produce them but both are empty.
> Strangely - output.xml was created successfully.
> The follow is the final part of the test output:
[snip]
> Output: /path/results/output.xml
> [ ERROR ] Writing log file '/path/results/log.html' failed: No such
> file or directory
> [ ERROR ] Writing report file '/path/results/report.html' failed: No
> such file or directory

I've looked at the code a bit more closely and these are my findings:

1) The place where the above errors can occur in the code is such
where XML has already been processed. The produced XML output file
should thus be fine. To verify that, you can try does this work
without problems:

rebot --log none --report none --output /tmp/output.xml
/path/results/output.xml

2) Because empty log and report files are generated, it is very
unlikely that writing these files themselves is the actual problem.

3) Most likely your `No such file or directory` error is caused by
some file needed in log/report generation missing. This generation
process needs template files that are located under
robot/htmldata/rebot directory. One of these files missing would cause
exactly this error.

4) The provided error message is obviously pretty bad as it doesn't
tell what exact file caused the problem. I submitted an issue about
this and have already enhanced the error message:
http://code.google.com/p/robotframework/issues/detail?id=1165

The issue also contains instructions how to enhance the error locally
before new Robot version is released. Any change you could try that? I
hope that would give us more information about your problem.

5) I don't know what could have caused the the underlying problem of
certain file missing. It is easier to investigate that once we know
what actual file was the culprit.

Pekka Klärck

unread,
Jun 25, 2012, 11:45:52 AM6/25/12
to mika.h...@gmail.com, robotframe...@googlegroups.com
2012/6/25 Mika Hänninen <mika.h...@gmail.com>:
> I had similar problem earlier today.
>
> The output.xml was created correctly,but HTML files were not created.The
> HTML file creation resulted in "Permission Denied" error and I did not find
> any additional information about the error (tried with DEBUG level logging).
>
> My problem went away when I upgraded RF to version 2.7.3 from version 2.7.2

Based on my analysis on my previous mail, it seems that your earlier
installation missed some template files needed for log/report
generation. Apparently the installation was fixed when you upgraded to
2.7.3. I still don't have any idea why those files would be missing,
though.

Thomas Maier

unread,
Jun 26, 2012, 6:36:00 AM6/26/12
to Pekka Klärck, robotframe...@googlegroups.com
I've tried that with the follow results:
{{{
Output: /path/results/output.xml
[ ERROR ] Writing log file '/path/results/log.html' failed: No such file or directory: /path/piplib/lib/python2.7/site-packages/robot/htmldata/rebot/log.html
[ ERROR ] Writing report file '/path/results/report.html' failed: No such file or directory: /path/robot/htmldata/rebot/report.html
Archiving artifacts

Recording fingerprints
Finished: SUCCESS
}}}

And bingo!!
This new error handling help me to find immediately the real problem. It was not
related to RF at all. I'll shortly explain what happen. Maybe it will help other people
who are (ob)using git not to fall into this trap.
I keep RF together with all tests in my local git repository. The idea was
that whoever will like to run some test, will just clone this
repository and start to use RF on it's own station. No hassle with RF
installation and etc`. But previous to the initial commit of RF, I've create
.gitignore file which includes the follow entry:

{{{
log.html
report.html
}}}

I've done that, to avoid from git to bother me about the local ./log.html and
./report.html each time I'm running test locally.
Of course this way, git will ignore all log.html and report.html in the whole
repository and not only in the root directory of the repository.
Nevertheless, everything worked fine until I've started with Jenkins.
Jenkins is cloning my repo before it's running the test.
Sadly, in the cloned repo, both files were missing. To solve this
.gitignore was fixed like this:
{{{
/log.html
/report.html
}}}
and finally, both file were committed.

Thank you very,very much for such a prompt response and solution.
Thomas

Pekka Klärck

unread,
Jun 26, 2012, 9:15:27 AM6/26/12
to Thomas Maier, robotframe...@googlegroups.com
2012/6/26 Thomas Maier <tho...@tonian.com>:
> On 06/25/2012 06:27 PM, Pekka Klärck wrote:
>> 4) The provided error message is obviously pretty bad as it doesn't
>> tell what exact file caused the problem. I submitted an issue about
>> this and have already enhanced the error message:
>> http://code.google.com/p/robotframework/issues/detail?id=1165
>>
>> The issue also contains instructions how to enhance the error locally
>> before new Robot version is released. Any change you could try that? I
>> hope that would give us more information about your problem.
>
> I've tried that with the follow results:
> {{{
> Output:  /path/results/output.xml
> [ ERROR ] Writing log file '/path/results/log.html' failed: No such file or directory: /path/piplib/lib/python2.7/site-packages/robot/htmldata/rebot/log.html
> [ ERROR ] Writing report file '/path/results/report.html' failed: No such file or directory: /path/robot/htmldata/rebot/report.html
> Archiving artifacts
>
> Recording fingerprints
> Finished: SUCCESS
> }}}
>
> And bingo!!
> This new error handling help me to find immediately the real problem. It was not
> related to RF at all.

Awesome! Great to hear you got your problem solved and great that the
underlying issue wasn't a bug in Robot. The really bad error message
definitely was a bug and it's good that it got fixed in the process.

Mika Hänninen

unread,
Jun 26, 2012, 10:01:01 AM6/26/12
to robotframe...@googlegroups.com, Pekka Klärck
I still would not rule out RF from the blame list ;)

My environment did not have any git repositories, but I still ended up with similar error situation.

My environment was VirtualBox installation of Ubuntu and RF was installed using pip (also upgraded with pip).

BR,
Mika

On Tuesday, June 26, 2012 1:36:00 PM UTC+3, hayzer wrote:

Ek

unread,
Jan 13, 2016, 4:12:05 PM1/13/16
to robotframework-users, tho...@tonian.com
To whom it may concern I faced the same and managed to solve - I would like to share maybe it will help someone:
 I faced a similar problem:  [ ERROR ] Writing log file 'C:\Jenkins\workspace\TestSuite\\default\robotfromworkresults\372\log.html' failed: No such file or directory: V:\TEST_FOLDER\PYTHON_EXTERNALS\robotframework-2.9-py2.7.egg\robot\htmldata\rebot\log.html , I got same error for the report.html .
from Pekka help on its searching for files an it can't find it\access it - I assumed that having robot framework installed as egg file is a bad idea - when I extracted the egg to folder and re-run then all of the html reports were created successfully --> this issue occurred when running standalone and when running by Jenkins once I did my solution i both standalone and Jenkins started working.
There is a problem when trying to access the required files to generate report when robot is installed as egg(zip) file\package and not as flat folder.
not sure if this is going to be fixed or if that it is as design!

ชุม คงมณี

unread,
Mar 28, 2016, 4:35:13 AM3/28/16
to robotframework-users, tho...@tonian.com

มีวิธีแก้เปล่าครับ Output: D:\Robot\result\output.xml

[ ERROR ] Reading XML source 'D:\Robot\result\output.xml' failed: ParseError: not well-formed (invalid token): line 37, column 2 

Reply all
Reply to author
Forward
0 new messages