Device or resource busy

General support for problems installing or using Deluge
Azelphur
Member
Member
Posts: 10
Joined: Sun May 17, 2015 1:47 am

Device or resource busy

Post by Azelphur »

Hi,

I'm running deluge 2.0b2.dev43 on ArchLinux, inside a kvm virtual machine. I've mounted a nfs4 share, and deluge is downloading into that NFS share.

I can't seem to make it through downloading a single file. It'll download for a little while, then get thrown into the "Error" state. The deluge client doesn't seem to show any information about what causes the error, however, if I look in the WebUi, the torrents status is 'Device or resource busy'

Formerly I was using CIFS instead of NFS, and the setup worked fine. I can't seem to find anything wrong with the NFS server. Neither the server nor the client have any messages in dmesg. I have ran various tests on the NFS share such as running Bonnie++ (A file system benchmarking tool) and copying a 55GB file onto the share, which completed with an average speed of 104.84MB/sec. So it seems like nothing is actually wrong with the NFS share, and that something is wrong with the combination of deluge, and the NFS share.

Any suggestions would be very welcome at this point.
shamael
Compulsive Poster
Compulsive Poster
Posts: 667
Joined: Sat Oct 08, 2016 9:28 am

Re: Device or resource busy

Post by shamael »

https://unix.stackexchange.com/question ... ource-busy

In your setup, do you make any move of the file? (when completed or else)
If so please download to a folder in "download to" and untick 'move completed to"
Azelphur
Member
Member
Posts: 10
Joined: Sun May 17, 2015 1:47 am

Re: Device or resource busy

Post by Azelphur »

Hi, I do use the move completed feature.

However, I highly doubt that the issue you have found is the issue, torrents will fail long before they have finished downloading. Usually within the first couple of minutes (although sometimes longer) I have never had a fully downloaded torrent exhibit this issue.
shamael
Compulsive Poster
Compulsive Poster
Posts: 667
Joined: Sat Oct 08, 2016 9:28 am

Re: Device or resource busy

Post by shamael »

I agree it may not be the solution but a test is really simple to achieve ;)
Azelphur
Member
Member
Posts: 10
Joined: Sun May 17, 2015 1:47 am

Re: Device or resource busy

Post by Azelphur »

Suppose so, no harm in trying. I selected one of the torrents that was in error state, unticked "Move completed" and pressed apply, then resumed the torrent.

It started downloading, achieved a download speed of 1MB/sec for about 20 seconds, then went back to error state again.
Azelphur
Member
Member
Posts: 10
Joined: Sun May 17, 2015 1:47 am

Re: Device or resource busy

Post by Azelphur »

I'm starting to be fairly convinced that it is not the NFS share causing this.
I have done the following in deluges download directory, on the same VM that has deluge running on it:

Ran bonnie++, a filesystem benchmarking utility.
Copied a 55GB file, average speed 104MB/sec.
Using wget to download a 50GB test file (currently at 39%, no issues so far)
Using SabNZBD to download a 108GB test file (currently at 10%, no issues so far)
Ran `find . -type f -exec md5sum {} \;`

With deluge, I haven't made it past 500MB downloaded before the torrent goes into error state with Device or resource busy. No idea what's causing it, hopefully we can figure it out.
shamael
Compulsive Poster
Compulsive Poster
Posts: 667
Joined: Sat Oct 08, 2016 9:28 am

Re: Device or resource busy

Post by shamael »

You can dig around the forum for similar setup, I'd found https://bbs.archlinux.org/viewtopic.php?id=151093
but you seems to face it only with Deluge, weird.
mattbuford
New User
New User
Posts: 2
Joined: Thu Mar 08, 2018 4:21 am

Re: Device or resource busy

Post by mattbuford »

I'm running into the same issue. Downloading torrents randomly switch to error state with the "Device or resource busy" status. I'm also using Deluge running on Arch within a KVM VM mounting storage via NFS.

As a temporary hack, I used a shell command line to hit "resume" on my torrent every few minutes so that it would keep making progress while I sleep. Torrents that have had this error and are resumed typically end up stalled at the end where instead of "Downloading 99%" it switches to just "Downloading" with no percentage and stays like that forever. If I hit force recheck, it goes through the recheck and then immediately completes and goes to seeding.

I did a few basic tests and had no problem reading and writing from my torrent VM to the NFS mounted torrent storage. I also left a ping running from the VM to the NFS server while torrents were downloaded and errored repeatedly, and there were 0 packets lost. I have not rebooted the NFS/host OS, but I have shutdown and restarted the KVM deluge VM without resolving the issue.

Torrent VM is running Linux 4.14.13-1-ARCH. NFS server is running Linux 4.12.12-gentoo. The NFS/Gentoo system is the host OS for the Arch deluge VM, so it's happening all on a single machine. Deluge version is 1.3.15 with libtorrent 1.1.6.0.

Unfortunately, I download torrents sporadically so I'm not sure when this started, but it is pretty bad now for large torrents. I can't get more than maybe 300 MB before having to resume the torrent. My Internet connection is relatively slow at 15 Mbps, so writing of torrents to disk should be pretty mild.

I haven't exhausted all troubleshooting options yet, and to be honest I'm pretty busy for the next several weeks and probably won't have any time, but I wanted to at least get a "me too" reply so it's not thought of as just one user.
siddhartha
Member
Member
Posts: 13
Joined: Wed Dec 14, 2016 3:02 am

Re: Device or resource busy

Post by siddhartha »

Edit: SOLVED. See this post.

Just started getting this same error today on Debian 4.9.82-1+deb9u3 with deluged 1.3.13+git20161130.48cedf63-3

Edit: deluged 1.3.15-2 results in the same error. I've also tried copying a large 4 GB folder on the same mount as the torrent and everything seems to be okay during the copy process.

Edit: Although the torrent doesn't fail, the log file at debug logging is peppered with:

Code: Select all

[DEBUG   ] 08:12:15 alertmanager:124 file_error_alert:  read (/****.iso) error: Device or resource busy
[DEBUG   ] 08:12:15 torrentmanager:1204 on_alert_file_error:  read (/****.iso) error: Device or resource busy
Edit: The final log entry before failure:

Code: Select all

[DEBUG   ] 08:22:59 alertmanager:124 performance_alert: : performance warning: max outstanding piece requests reached
[DEBUG   ] 08:23:00 alertmanager:124 performance_alert: : performance warning: max outstanding piece requests reached
[DEBUG   ] 08:23:01 alertmanager:124 file_error_alert:  read (/***.iso) error: Device or resource busy
[DEBUG   ] 08:23:01 alertmanager:124 torrent_error_alert:  ERROR: Device or resource busy
[DEBUG   ] 08:23:01 alertmanager:124 tracker_announce_alert:  (udp://***) sending announce (stopped)
[DEBUG   ] 08:23:01 torrentmanager:1204 on_alert_file_error:  read (/***.iso) error: Device or resource busy
[DEBUG   ] 08:23:01 torrent:429 Using torrent state from lt: downloading, auto_managed: True, paused: True, session_paused: False
[DEBUG   ] 08:23:01 torrent:431 Torrent *** set from Downloading to Error: 'Device or resource busy: /***.iso'
[DEBUG   ] 08:23:01 rpcserver:469 intevents: {0: ['SessionPausedEvent', 'TorrentFileRenamedEvent', 'TorrentRemovedEvent', 'PluginDisabledEvent', 'SessionResumedEvent', 'TorrentStateChangedEvent', 'TorrentFinishedEvent', 'TorrentFolderRenamedEvent', 'NewVersionAvailableEvent', 'PluginEnabledEvent', 'TorrentResumedEvent', 'TorrentAddedEvent', 'TorrentQueueChangedEvent', 'ExecuteCommandRemovedEvent', 'ConfigValueChangedEvent', 'ExecuteCommandAddedEvent'], 2: ['SessionPausedEvent', 'TorrentFileRenamedEvent', 'TorrentRemovedEvent', 'PluginDisabledEvent', 'SessionResumedEvent', 'TorrentStateChangedEvent', 'TorrentFinishedEvent', 'TorrentFolderRenamedEvent', 'NewVersionAvailableEvent', 'PluginEnabledEvent', 'TorrentResumedEvent', 'TorrentAddedEvent', 'TorrentQueueChangedEvent', 'ExecuteCommandRemovedEvent', 'ConfigValueChangedEvent', 'ExecuteCommandAddedEvent']}
[DEBUG   ] 08:23:01 rpcserver:473 Emit Event: TorrentStateChangedEvent ['***', 'Error']
[DEBUG   ] 08:23:01 rpcserver:473 Emit Event: TorrentStateChangedEvent ['***', 'Error']
[DEBUG   ] 08:23:01 torrentmanager:1027 on_alert_tracker_announce
[DEBUG   ] 08:23:01 alertmanager:124 torrent_paused_alert:  paused
[DEBUG   ] 08:23:01 torrentmanager:973 on_alert_torrent_paused
Edit: My NFS is managed by OpenMediaVault, but here is the /etc/exports file on the NAS:

Code: Select all

/export/media 192.168.1.0/24(fsid=1,rw,no_subtree_check,secure,crossmnt,all_squash,anonuid=2001,anongid=1001,sync)
/export/datastore 192.168.1.10(fsid=2,rw,no_subtree_check,all_squash,secure,anonuid=0,anongid=0,crossmnt)
# NFSv4 - pseudo filesystem root
/export 192.168.1.0/24(ro,fsid=0,root_squash,no_subtree_check,hide)
/export 192.168.1.10(ro,fsid=0,root_squash,no_subtree_check,hide)
And here is my /etc/fstab on the download box:

Code: Select all

nas.local:/export/media/downloads /srv/downloads nfs auto,noatime,nodiratime
Last edited by siddhartha on Sat Mar 17, 2018 5:21 am, edited 2 times in total.
siddhartha
Member
Member
Posts: 13
Joined: Wed Dec 14, 2016 3:02 am

Re: Device or resource busy

Post by siddhartha »

Edit: SOLVED. See this post.

Upon further testing, it appears like download speed or write size has a big part to do with this. It will regularly fail every very hundred MB if I'm downloading at 2 MB/s or above. At 5 MB/s, it fails more frequently. I set my cache to 512 MB and a timeout of 120 seconds, and my download speeds dropped to about 200 KB/s and threw no errors.

No matter what the speed, large torrents 10 GB+ fail most frequently. Torrents less than 1 GB will not fail at all.

Furthermore, I can confirm that this problem is exclusive to Deluge, as any large file operations at the OS level throw no errors.
Last edited by siddhartha on Sat Mar 17, 2018 5:21 am, edited 1 time in total.
Post Reply