Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upOSError: [Errno 9] Bad file descriptor #1021
Comments
This comment has been minimized.
This comment has been minimized.
|
The disconnect does work though, and I can reconnect again just fine... |
This comment has been minimized.
This comment has been minimized.
|
Nothing that OctoPrint can do anything about I fear. If it tries to close the serial line like it is supposed to and that causes an error, that's a problem on the operating system level, nothing I can handle in user space. I might be able to catch the error there and stop it from propagating, but I'm not sure if I should since it hints at a possible problem the user should investigate. |
This comment has been minimized.
This comment has been minimized.
|
It could be a user space error. It is saying self.fd is not a valid file On 11 August 2015 at 06:56, Gina Häußge notifications@github.com wrote:
|
This comment has been minimized.
This comment has been minimized.
|
Is there anything I can do to debug this or is it safe to just ignore? |
This comment has been minimized.
This comment has been minimized.
|
@nophead you are right, wrong perspective on my end. Still out of reach for OctoPrint though I fear, the error is raised within pyserial. @jminardi Can you reliably reproduce that? Or is that something that only happened once? If you can reliably reproduce it it might be worth looking further into what's causing that/under which specific circumstances it reproduces. Might make it easier to decide if action needs to be taken (in case of some timing issue) or not. In any case I'm still undecided on what the best course of action is here - should something like this be assumed "normal" and just logged within the closing function, or should it still raise that amount of noise. |
This comment has been minimized.
This comment has been minimized.
|
I can reliably reproduce it, happens every time I disconnect when using my mac laptop. I was not seeing the error on my raspi fwiw |
This comment has been minimized.
This comment has been minimized.
|
But only on the Mac? Hm... I have a Mac Mini here, I'll try to see if that behaves similar some time later this week (still working through the backlog from my two week vacation). |
This comment has been minimized.
This comment has been minimized.
|
Seems like it could be a race between the monitoring thread and another thread (api request perhaps)? It may only happen on a mac based on differences about when the library holds the lock. That code doesn't expect another thread to close and set _serial to None while this thread is in or returning from _readline. |
This comment has been minimized.
This comment has been minimized.
|
@markwal was right, it was a race condition that for whatever reason seems to be reliably reproducible on Macs and never said hello to me before on other systems. I introduced a new flag into the comm object that will now be set to True if the closing of the serial connection has been triggered and will prevent exceptions (that I can't prevent from occurring here since the I also added an error handler to the Fixed in |
Disconnecting from the printer
Printer to disconnect without error
printer disconnected with the error pasted below
Version: 1.3.0.dev179+g214b484 (HEAD branch)
also happens on latest master
(if applicable - always include if unsure):
Marlin Integration Branch
System running Browser (if applicable - always
include if unsure):
latest chrome on os x
(ALWAYS INCLUDE AND DO NOT TRUNCATE):
http://pastebin.com/UtZv4svz
gist.github.com or pastebin.com (if applicable - always
include if unsure or reporting communication issues AND
DO NOT TRUNCATE):
relevant error pasted below
on gist.github.com or pastebin.com or alternatively a
screenshot (if applicable - always include if unsure
or reporting UI issues):
n/a
include if unsure or reporting UI issues):
n/a
I have read the FAQ.
Error message: