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

Upload hanging or Device or Resource Busy on Linux #52

Closed
kusti8 opened this issue Feb 10, 2019 · 13 comments
Closed

Upload hanging or Device or Resource Busy on Linux #52

kusti8 opened this issue Feb 10, 2019 · 13 comments
Labels
bug Something isn't working needs reproduction The cause of this issue is still unknown, and/or the issue has not yet been reliably reproduced on hold This may be revisited in the future

Comments

@kusti8
Copy link

kusti8 commented Feb 10, 2019

Expected Behavior:

For pros to upload the project to the v5 brain.

Actual Behavior:

Sometimes, I get a Device or Resource Busy message or the upload just hangs at some random percentage and won't continue. Sometimes running udevadm trigger and unplugging and replugging works, but other times it just hangs.

I am part of the dialout group and this only happens occasionally. If I spin up a Windows VM right after it hangs, and connect that to the USB device, then the upload works without issue. If I reboot and try again, the problem persists.

Steps to reproduce:

  1. Plug in brain and try to upload with pros v5 u.

System information:

Operating System: Ubuntu

PROS Version: 3.1.3

Additional Information

Screenshots/Output Dumps/Stack Traces

make: Nothing to be done for 'quick'.
Uploading bin/output.bin to v5 device on /dev/ttyACM0 as States to slot 1
ERROR - pros.cli.upload:upload - [Errno 16] could not open port /dev/ttyACM0: [Errno 16] Device or resource busy: '/dev/ttyACM0'
  File "/home/kusti8/.local/lib/python3.6/site-packages/serial/serialposix.py", line 268, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 16] could not open port /dev/ttyACM0: [Errno 16] Device or resource busy: '/dev/ttyACM0'

After running udevadm trigger and replugging the wire, it hangs

make: Nothing to be done for 'quick'.
Uploading bin/output.bin to v5 device on /dev/ttyACM0 as States to slot 1
Uploading slot_1.ini [####################################] 100%
Uploading slot_1.bin (bin/output.bin) [##########--------------------------]  27%
@HotelCalifornia HotelCalifornia added bug Something isn't working duplicate This issue or pull request already exists labels Feb 17, 2019
@HotelCalifornia
Copy link
Contributor

closing as a duplicate of #45

@kusti8
Copy link
Author

kusti8 commented Feb 17, 2019

I saw the other issue, however mine seems to be slightly different. Mine hangs midway through downloading, and I do have permissions, and there are no other processes that are running as far as I can tell (I ran lsof and tried to kill any other python scripts).

@edjubuh
Copy link
Member

edjubuh commented Feb 17, 2019

Can you run prosv5 u --debug > debug.output.txt and share it via gist or pastebin or upload file?

@edjubuh edjubuh reopened this Feb 17, 2019
@HotelCalifornia HotelCalifornia added question Further information is requested and removed duplicate This issue or pull request already exists labels Feb 17, 2019
@kusti8
Copy link
Author

kusti8 commented Feb 17, 2019

@edjubuh
Copy link
Member

edjubuh commented Feb 17, 2019

🤔 you're on the develop branch now (instead of 3.1.3)? Just making sure we're on the same page

@kusti8
Copy link
Author

kusti8 commented Feb 17, 2019

I switched to the wireless upload branch to test that out, but the issue was the same on the master branch and the develop branch.

@edjubuh
Copy link
Member

edjubuh commented Feb 17, 2019

I might be able to patch something for this log, but I'm still not sure why it failed half-way through as you originally posted since the log you attached shows it failed at an earlier stage.

@edjubuh
Copy link
Member

edjubuh commented Feb 17, 2019

I've created a branch: hotfix/kusti8-debugging that has a potential patch for the log you sent.

@kusti8
Copy link
Author

kusti8 commented Feb 17, 2019

The point at which it fails is different every time, usually stopping earlier every time. I'll try out the fix, thanks.

@edjubuh
Copy link
Member

edjubuh commented Feb 17, 2019

I noticed you ctrl+c'd it out. You did say it was hanging, which is odd because we set timeout to something like 1 second with 3 retries of the same command, so it should never hang for more 3-ish seconds. I assume it hangs for 10+ seconds?

@kusti8
Copy link
Author

kusti8 commented Feb 17, 2019

Yeah it hangs for 10+ seconds. I had to Ctrl+c it.

@kusti8
Copy link
Author

kusti8 commented Feb 18, 2019

Hi, the patch prevents it from hanging. It still says device or resource busy, so I have to run udevadm trigger 1 or 2 times, but it works consistently after that.

@edjubuh
Copy link
Member

edjubuh commented Feb 18, 2019

Glad to hear it works. I'll close this issue for now unless you can determine a consistent workflow that causes the "device or resource busy" error. We'd probably have to report that to upstream pyserial.

@edjubuh edjubuh closed this as completed Feb 18, 2019
@HotelCalifornia HotelCalifornia added needs reproduction The cause of this issue is still unknown, and/or the issue has not yet been reliably reproduced on hold This may be revisited in the future and removed question Further information is requested labels Feb 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs reproduction The cause of this issue is still unknown, and/or the issue has not yet been reliably reproduced on hold This may be revisited in the future
Projects
None yet
Development

No branches or pull requests

3 participants