[Linux] NZBDrone stalls and can't be killed

Hey, Love the app but have found an issue on Linux I’m hoping you can fix.

I noticed some parts of the webapp just stalling rather than loading (Series page was totally fine, and Settings page seemed to stall after an initial load (maybe waiting for something ajaxy). I checked the logs and it looks to my uneducated eye, that it ran into some issue reading the filesize of an episode (likely more a mono issue than a NzbDrone one) - I’m hoping you can add some logic to catch this error and handle it gracefully.

After it stalled I tried to “kill -9” the process id but it refused to die:

user 4712 1895 1 Jan07 ? 00:38:18 [mono]

just going “defunct” which requires a reboot to fix. (again I think this might just be a mono thing, but maybe others will see this post and know they’re not alone)

[Edit] Found a Trello card, for the not stopping

Thanks,
Erolosty

System.Net.WebException: An error occurred performing a WebClient request. —> System.Net.ProtocolViolationException: The number of bytes to be written is greater than the specified ContentLength.
at System.Net.WebConnectionStream.CheckWriteOverflow (Int64 contentLength, Int64 totalWritten, Int64 size) [0x00000] in :0
at System.Net.WebConnectionStream.BeginWrite (System.Byte[] buffer, Int32 offset, Int32 size, System.AsyncCallback cb, System.Object state) [0x00000] in :0
at System.Net.WebConnectionStream.Write (System.Byte[] buffer, Int32 offset, Int32 size) [0x00000] in :0
at System.Net.WebClient.UploadDataCore (System.Uri address, System.String method, System.Byte[] data, System.Object userToken) [0x00000] in :0
at System.Net.WebClient.UploadData (System.Uri address, System.String method, System.Byte[] data) [0x00000] in :0
— End of inner exception stack trace —
at System.Net.WebClient.UploadData (System.Uri address, System.String method, System.Byte[] data) [0x00000] in :0
at System.Net.WebClient.UploadData (System.String address, System.String method, System.Byte[] data) [0x00000] in :0
at (wrapper remoting-invoke-with-check) System.Net.WebClient:UploadData (string,string,byte[])
at NzbDrone.Common.HttpProvider.PostCommand (System.String address, System.String username, System.String password, System.String command) [0x00000] in :0
at NzbDrone.Core.Notifications.Xbmc.JsonApiProvider.Notify (NzbDrone.Core.Notifications.Xbmc.XbmcSettings settings, System.String title, System.String message) [0x00000] in :0
at NzbDrone.Core.Notifications.Xbmc.XbmcService.Notify (NzbDrone.Core.Notifications.Xbmc.XbmcSettings settings, System.String title, System.String message) [0x00000] in :0
at NzbDrone.Core.Notifications.Xbmc.Xbmc.OnGrab (System.String message) [0x00000] in :0
at NzbDrone.Core.Notifications.NotificationService.Handle (NzbDrone.Core.Download.EpisodeGrabbedEvent message) [0x00000] in :0

14-1-7 23:38:21.0|Info|RssSyncService|RSS Sync Completed. Reports found: 400, Reports downloaded: 1
14-1-7 23:49:07.0|Warn|ImportApprovedEpisodes|Couldn’t import episode /blah.ts

System.IO.IOException: Win32 IO returned ERROR_GEN_FAILURE. Path:
at System.IO.File.Move (System.String sourceFileName, System.String destFileName) [0x00000] in :0
at NzbDrone.Common.DiskProvider.MoveFile (System.String source, System.String destination) [0x00000] in :0
at NzbDrone.Core.MediaFiles.EpisodeFileMovingService.MoveFile (NzbDrone.Core.MediaFiles.EpisodeFile episodeFile, NzbDrone.Core.Tv.Series series, System.String destinationFilename) [0x00000] in :0
at NzbDrone.Core.MediaFiles.EpisodeFileMovingService.MoveEpisodeFile (NzbDrone.Core.MediaFiles.EpisodeFile episodeFile, NzbDrone.Core.Parser.Model.LocalEpisode localEpisode) [0x00000] in :0
at NzbDrone.Core.MediaFiles.UpgradeMediaFileService.UpgradeEpisodeFile (NzbDrone.Core.MediaFiles.EpisodeFile episodeFile, NzbDrone.Core.Parser.Model.LocalEpisode localEpisode) [0x00000] in :0
at NzbDrone.Core.MediaFiles.EpisodeImport.ImportApprovedEpisodes.Import (System.Collections.Generic.List`1 decisions, Boolean newDownload) [0x00000] in :0

There error on Trello is related to ctrl+c not exiting, I’ve never experienced a case where kill did not work, kill -9 starves the process of resources in hopes it will terminate.

The error I’m interested in is the ERROR_GEN_FAILURE, I have not seen that before.

What flavour and version of linux are you using?
What version of mono are you using?

Can you run mono --debug NzbDrone.exe and pastebin (forums cause display issues for the logs) the end of the log file when it hangs, please?

For killing, try killing the mono process?

Hi Markus - got a stack this time (I’ve actually got this a couple of times now with the same stack)

Got into the same thing again, have to reboot machine to sort it out - Really hoping you can add something to handle the error below.

Thanks

System.IO.IOException: Lock violation on path /tvDir/blah.avi
at System.IO.File.Delete (System.String path) [0x00000] in :0
at NzbDrone.Common.DiskProvider.DeleteFile (System.String path) [0x00000] in :0
at NzbDrone.Core.MediaFiles.RecycleBinProvider.DeleteFile (System.String path) [0x00000] in :0
at NzbDrone.Core.MediaFiles.UpgradeMediaFileService.UpgradeEpisodeFile (NzbDrone.Core.MediaFiles.EpisodeFile episodeFile, NzbDrone.Core.Parser.Model.LocalEpisode localEpisode) [0x00000] in :0
at NzbDrone.Core.MediaFiles.EpisodeImport.ImportApprovedEpisodes.Import (System.Collections.Generic.List`1 decisions, Boolean newDownload) [0x00000] in :0

14-1-25 22:35:45.5|Info|RecycleBinProvider|Recycling Bin has not been configured, deleting permanently.
14-1-25 22:36:48.2|Warn|ImportApprovedEpisodes|Couldn’t import episode /Downloads/blah.avi

System.IO.IOException: Lock violation on path /tvDir/blah.avi
at System.IO.File.Delete (System.String path) [0x00000] in :0
at NzbDrone.Common.DiskProvider.DeleteFile (System.String path) [0x00000] in :0
at NzbDrone.Core.MediaFiles.RecycleBinProvider.DeleteFile (System.String path) [0x00000] in :0
at NzbDrone.Core.MediaFiles.UpgradeMediaFileService.UpgradeEpisodeFile (NzbDrone.Core.MediaFiles.EpisodeFile episodeFile, NzbDrone.Core.Parser.Model.LocalEpisode localEpisode) [0x00000] in :0
at NzbDrone.Core.MediaFiles.EpisodeImport.ImportApprovedEpisodes.Import (System.Collections.Generic.List`1 decisions, Boolean newDownload) [0x00000] in :0

14-1-25 22:36:53.2|Info|RecycleBinProvider|Recycling Bin has not been configured, deleting permanently.

@erolosty something is preventing the file from being deleted, if it can’t be deleted the new episode can’t be imported. Could be permissions or the file is in use… If you run drone with mono --debug NzbDrone.exe it should have some more information that might help.

Are you able to delete the same episode file through the drone UI (clicking on the corresponding episode will let you delete the file).

What OS/version are you on?
What version of mono?

When you get this error it hangs drone and you need to reboot to fix it? kill -9 doesn’t work?
Does drone have write permissions on the file?