-
Notifications
You must be signed in to change notification settings - Fork 19
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
writing code.py causes: OSError: [Errno 5] Input/output error #229
Comments
Thanks, I'll look into this today. |
I wasn't able to exactly fix the issue, but did find a similar issue in the process and have slowly been working it out of the system. After that, I'll try the exact reproduction steps. |
Oh, I just realized it didn't happen on all boards. Will try on a RP2040 after I get the issue I notice worked out. |
Just tested on the Feather RP2040 running CP 9.1.1 on my system locally and did not experience the error, so perhaps it's fixed now. After I finish #230, I'll submit a PR. |
This should now be fixed via #231. |
I'm able to re-create this issue reliably as well. Browser: I've seen the same issue with a MEMENTO 9.1.1 and a Feather RP2040 9.0.4 and 9.1.1, it doesn't appear to be tied to a specific device or version that I can tell. Here is a screen recording of one of occurrences on the MEMENTO I found that when the device is in the state where it's always getting the Input/Output error I can press the disconnect button at the top, and then re-connect and upon re-connecting open the serial and use ctrl-c / ctrl-d to run code.py and it does execute without the error as long as I do not change the code again before running. I have noticed what I think is an unrelated issue where disconnect / re-connecting to a device without reloading the page causes serial input and outputs to be duplicated, i'll create a seperate issue for that. Since it works after disconnect / reconnecting it seems to me that this issue is tied specifically to when it saves the code.py content and then tries to run it afterward. The actual content of the file seems to get saved correctly because it works without any further changes after the disconnect / reconnect. |
I wonder if the issue is only appearing on linux. I'm trying with Mac OS and still unable to produce issue, but have a linux computer (running Linux Mint) I can try it on. I believe Dan was probably also trying on Linux. |
Yes, I only tested on Linux. |
First of all, it worked fine for me on linux. However, I may have an idea about what is happening. For the RP2040, there should be a CIRCUITPY drive that you need to grant permission to. If it is trying to go through the REPL (because maybe it detects the file system isn't read only), then I think that's why it is encountering the error. Getting down a bit deeper, I remembered that in order to make it Micropython compatible, I have it attempting to check if the file system is read only and if there are any errors it assumes that it isn't read-only. I think I need to make it more specific to an import error. |
Ok, am trying the memento and noticing weirdness (code timeouts, slowness, not connecting with File System API, etc). Hopefully getting it working will iron out the issue. I think the weirdness is causing it to think it should do file ops through the REPL and then it can't write to a read-only file system. |
Ok, good news is same board works much better after trying on my local system (which only assumes not read-only on import error instead of all errors). I think I can improve the connection speed/weirdness though and can call this good. |
I just noticed in Dan's log:
This means that it is connecting through the File System API, which is correct. So, I don't think my hypothesis is correct. |
CircuitPython Version
Workflow(s)
USB in code-beta.circuitpython.org on 2024-08-07, 2019 ET
Browser(s)
Console Log
Steps
storage.erase_filesystem()
done, so CIRCUITPY is in good shape.code.py
and another anotherprint()
statement. Note that saving code.py does NOT cause an auto-reloadThe
OSError
is new. It did not show up if I did ctrl-D before editing the file.Description
No response
Additional information
This does not seem to reflect a corrupted CIRCUITPY. Instead, it is some other I/O error, maybe due to something being done via serial. If I disconnect from web-editor and just connect via a terminal program, without resetting, and do a ctrl-D, I do not see the
OSError
.The text was updated successfully, but these errors were encountered: