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
[ ERROR ] Unexpected error: IOError: [Errno 0] Error #2709
Comments
I have no idea idea what's causing this but quick googling showed that others have had similar errors. For example, this looks very similar: tartley/colorama#101 |
From time to time I have this same problem. |
This could be relevant: https://stackoverflow.com/questions/11176724/python-file-operations |
@flywojt have you found a solution to this issue? I'm having the same problem. |
I have just checked my error message is exactly the same as above. I too remember having updated windows 10 then I started to have problems. Does anyone think it has something to do with the win10 update? I tried everything & reinstalled all the components of Robot framework & still no luck. Noticed the extra text that appear while running the test in pycharm |
@ianlg no, I am not. This must be conected with windows or configuration because on iOS on MAC my tests works fine. |
@flywojt how did you manage to fix the issue you mentioned above? |
More and more people are reporting this issue when using ChromeDriver also on the Slack channel. Based on the accepted answer to the StackOverflow question I already mentioned, this weird Although it's unlikely that this problem is caused by Robot, we could possibly workaround it by using
right before the line causing the error help? |
Also, has someone encountered this problem without using ChromeDriver? If not, then the real problem clearly is in ChromeDriver or in Chrome itself. Those encountering the problem with ChromeDriver, do you remember which version started causing it, or could you downgrade to older versions to see when the problem starts appearing? That information could help reporting the problem to ChromeDrivers tracker. |
Hi, I also experienced the problem using firefox & edge |
Thanks for the commend @ianlg! It seems this isn't only an issue with Chrome(Driver) then. Has anyone encountered this when not using Selenium at all? Does it only occur on Windows? Finally, please test does the workaround in my comment above help! |
This bug occurs for every browser I used (chrome, ff and edge). On Mac and iOS my tests works fine so it looks like that this bug is connected with windows. |
Thanks for update @flywojt! Have you encountered the problem when not using Selenium? Can you test updating your Robot installation with the workaround I posted? |
I haven't tried run tests without selenium. I will try this workaround and give you feedback. |
@pekkaklarck The suggested solution doesn't work. File "C:\Python27\lib\site-packages\robot\output\console\highlighting.py", line 52, in write Has anyone found a working solution to this annoying issue? |
Can you show the full traceback? Have you redirected stdout to a file? Are you running tests locally or on CI? |
@pekkaklarck The tests are running locally. Please see full traceback below: |
In the above snippet you use |
Hi @pekkaklarck & @Zac4 hope this gets fixed soon. Appreciate your help. |
I cannot reproduce this problem and thus cannot do much to fix it. Getting it fixed very highly depends on users encountering debugging it themselves. I have asked has anyone encountered this without using Selenium but nobody has replied anything. I posted a possible workaround by adding If you don't know how to apply the workaround, here are instructions with some more additional debug logging enabled:
|
Some more questions to the users encountering this issue based on the new information in the vscode issue linked above:
|
Hi, I've done what you said:
but it gave the the error straight away when I ran the test. Using pycharm to run RF tests. |
Which error? What was written to the 'debug.output' file? |
HI, Here is the error in pycharm Traceback (most recent call last): Which directory can I find debug.output file? |
@ianlg the debug.output file should be automatically created within your IDE. The file gets created immediately you execute the command. |
Hi, Thanks for the info. Here is the text on the debug.output file
|
@ianlg try this, and let us know if it fixes it for you. Try number one first, then if doesn't work, try number two:
|
HI @Zac4 I tried both and they work fine, I didn't see any errors apart from the weird line of text that I mentioned above. |
Some notes related to questions and comments above:
|
Hi, self.stream.seek(0) & self.stream.seek(0, 0) both worked for me though on the test dialogue the extra lines of text are still there. I use pycharm IDE I reckon it has something to do with win10 update. Hope this helps. |
@pekkaklarck Also, @ianlg i am not sure if @pekkaklarck will find a solution to that extra DevTools that keeps using random port on each test case at the time of execution. but i know for definite that is annoyingly caused by recent Windows 10 updates. |
That DevTools thing is unlikely to have anything to do with this issue. It's probably a message logged by the Selenium browser driver you use. Could someone reliably reproducing this test does the problem occur also without using Selenium? Also, could someone test does |
As someone who works on the console in Windows, we're not actually aware of anything changing in regards to how colors are handled by external applications interfacing with the console subsystem. If you can help us identify which API call isn't working as it used to, we can investigate and work on a fix. Compatibility is very important to us. We're just having a hard time navigating the many levels of abstraction that are present in these scenarios to find the actual Win32 API call at the bottom that is acting differently. |
I ran another test run this time self.stream.seek(0) failed. Now trying self.stream.seek(0, 0) |
self.stream.seek(0, 0) resulted in a failure as well =( |
I can't run my tests anymore because this error happened frequently. Any fixing for this, anything news |
Which terminal do you use? The old command prompt, PowerShell, vscode, Git Bash, Cygwin, or something else? --> I'm using Pycharm Does the problem go away if you disable console colors by using --consolecolors off when starting test execution? --> no |
Hi, I did this: Find file robot/output/console/highlighting.py under your Robot Framework installation. You should find it under C:\Python27\Lib\site-packages or similar. Change the write method to contain this implementation: def write(self, text, flush=True): Tell what's written to the generated debug.output file. [1209/215700.260:ERROR:process_reader_win.cc(123)] NtOpenThread: {Access Denied} A process has requested access to an object, but has not been granted those access rights. (0xc0000022) In the Pycharm console: Traceback (most recent call last): |
This problem is most likely caused by the same change to Windows console that was behind microsoft/vscode#36630. The root cause to that issue is fixed, and apparently it should be in Windows Insider builds early next year. I don't know when normal users will get it, and obviously there's even a change that our bug is different. It seems that at least @LexiPham and @ianlg have encountered this issue when using PyCharm. Could you try running tests using the normal Windows console instead? |
I finally saw this problem myself when organizing a training in a classroom with Windows 10 machines. In my tests the problem only occurred when using PyCharm terminal (probably would have also occurred using VSCode) and not when using the standard Windows command prompt. Also on PyCharm it didn't occur always but annoyingly frequently (about every fourth time). Is this what others have noticed too? I was also able to create a workaround for the problem and committed it in 828c676. It would be great if users encountering this error could test the workaround. The easiest way to get it is installing the latest code directly using pip:
|
Hi @pekkaklarck , It works for me, don't see the error anymore. It has some weird lines that I haven't seen while running my tests before, but it didn't affect the test results so far. [10788:15320:1220/183512.412:ERROR:process_metrics.cc(105)] NOT IMPLEMENTED Thank you, |
Great that the workaround works! The weird lines you get on the console are most likely caused by the Selenium driver or browser you use. I've seen at least ChromeDriver/Chrome combo emitting such noise on Windows sometimes. |
I guess we can consider this issue resolved. Because the problem doesn't occur when using the normal command prompt, I don't consider this important enough to warrant an immediate bug fix release. If you need to get the fix ASAP, see my comment a bit above how to install the latest code using pip. |
Hi! I have run into this problem this week. I'm using windows 10 |
@shi-kk the bug itself is in the latest Windows versions. It's apparently already fixed but it takes some time before the fix is rolled out. For more details see microsoft/vscode#36630. For Robot Framework I've implemented a workaround that avoids the problem in commit 828c676. Something similar could be done with Behave as well. |
So we have tried running with the commit 828c676 and seems like its not helping on Windows 7 Enterprise, here is the traceback:
|
@jbub You are encountering some other problem. This issue only occurs with latest Windows 10 versions. |
Hy @pekkaklarck, |
Great that the fix works! It was included in RF 3.0.3, so nowadays the normal |
My tests starts to fall down. Everything worked fine until I update my Windows 10 two days ago. I downgrade windows but this doesn't help. I also tried to upgrade robot framework and selenium2library and this doesn't helped. This bug occurs for every browser I used (chrome, ff and edge).
[ ERROR ] Unexpected error: IOError: [Errno 0] Error
Traceback (most recent call last):
File "c:\python27\lib\site-packages\robot\utils\application.py", line 83, in _execute
rc = self.main(arguments, **options)
File "c:\python27\lib\site-packages\robot\run.py", line 445, in main
result = suite.run(settings)
File "c:\python27\lib\site-packages\robot\running\model.py", line 248, in run
self.visit(runner)
File "c:\python27\lib\site-packages\robot\model\testsuite.py", line 161, in visit
visitor.visit_suite(self)
File "c:\python27\lib\site-packages\robot\model\visitor.py", line 86, in visit_suite
suite.suites.visit(self)
File "c:\python27\lib\site-packages\robot\model\itemlist.py", line 76, in visit
item.visit(visitor)
File "c:\python27\lib\site-packages\robot\model\testsuite.py", line 161, in visit
visitor.visit_suite(self)
File "c:\python27\lib\site-packages\robot\model\visitor.py", line 87, in visit_suite
suite.tests.visit(self)
File "c:\python27\lib\site-packages\robot\model\itemlist.py", line 76, in visit
item.visit(visitor)
File "c:\python27\lib\site-packages\robot\model\testcase.py", line 74, in visit
visitor.visit_test(self)
File "c:\python27\lib\site-packages\robot\running\runner.py", line 159, in visit_test
self._output.end_test(ModelCombiner(test, result))
File "c:\python27\lib\site-packages\robot\output\output.py", line 59, in end_test
LOGGER.end_test(test)
File "c:\python27\lib\site-packages\robot\output\logger.py", line 183, in end_test
logger.end_test(test)
File "c:\python27\lib\site-packages\robot\output\console\verbose.py", line 51, in end_test
self._writer.status(test.status, clear=True)
File "c:\python27\lib\site-packages\robot\output\console\verbose.py", line 114, in status
self._clear_status()
File "c:\python27\lib\site-packages\robot\output\console\verbose.py", line 124, in _clear_status
self._write_info()
File "c:\python27\lib\site-packages\robot\output\console\verbose.py", line 90, in _write_info
self._stdout.write(self._last_info)
File "c:\python27\lib\site-packages\robot\output\console\highlighting.py", line 51, in write
self.stream.write(console_encode(text, stream=self.stream))
The text was updated successfully, but these errors were encountered: