rogerfar / rdt-client

Real-Debrid Client Proxy
MIT License
835 stars 108 forks source link

Torrents get stuck at "Queued for unpacking" #38

Closed logtho closed 3 years ago

logtho commented 3 years ago

I have two movies that have finished downloading (both single .mp4 files) that have gotten stuck at "Queued for unpacking".

This is not the first time this has happened. This has also happened with two season packs before - in a weirder fashion. Some of the episodes were "Finished", some "Queued for downloading", and at least one "Queued for unpacking".

When this happens, it seems to hold up the rest of the torrents in the downloader. Nothing starts downloading. Currently there are only the two movies that say "Queued for unpacking" and everything else says "Queued for downloading".

Here are the settings I have: image

When checking the logs, I see this error spammed over and over, so hopefully it's relevant to this issue:

2021-03-22 15:39:00.443 +00:00 [ERR] Unexpected error occurred in TorrentDownloadManager.Tick
System.Exception: {
    "error": "hoster_unavailable",
    "error_code": 19
}
   at RDNET.RdNetClient.Post[T](String url, KeyValuePair`2[] data, Boolean repeatRequest)
   at RDNET.RdNetClient.UnrestrictLinkAsync(String link, String password, Boolean remote)
   at RdtClient.Service.Services.Torrents.UnrestrictLink(Guid downloadId) in C:\Projects\rdt-client\server\RdtClient.Service\Services\Torrents.cs:line 255
   at RdtClient.Service.Services.TorrentRunner.Tick() in C:\Projects\rdt-client\server\RdtClient.Service\Services\TorrentRunner.cs:line 222
   at RdtClient.Service.Services.TaskRunner.ExecuteAsync(CancellationToken stoppingToken) in C:\Projects\rdt-client\server\RdtClient.Service\Services\TaskRunner.cs:line 36
2021-03-22 15:39:04.471 +00:00 [ERR] Unexpected error occurred in TorrentDownloadManager.Tick
System.Exception: {
    "error": "hoster_unavailable",
    "error_code": 19
}
   at RDNET.RdNetClient.Post[T](String url, KeyValuePair`2[] data, Boolean repeatRequest)
   at RDNET.RdNetClient.UnrestrictLinkAsync(String link, String password, Boolean remote)
   at RdtClient.Service.Services.Torrents.UnrestrictLink(Guid downloadId) in C:\Projects\rdt-client\server\RdtClient.Service\Services\Torrents.cs:line 255
   at RdtClient.Service.Services.TorrentRunner.Tick() in C:\Projects\rdt-client\server\RdtClient.Service\Services\TorrentRunner.cs:line 222
   at RdtClient.Service.Services.TaskRunner.ExecuteAsync(CancellationToken stoppingToken) in C:\Projects\rdt-client\server\RdtClient.Service\Services\TaskRunner.cs:line 36
logtho commented 3 years ago

I forgot to mention, when manually removing the torrents (from the client) stuck at unpacking, this seems to fix the rest of the torrents in the queue and they start downloading.

For movies this isn't a huge issue as I can remove them from the client and then manually import them.

But for season packs or torrents with multiple files, this means that some or most of the files in the torrent don't get downloaded.

rogerfar commented 3 years ago

Can you confirm you are using the latest version? This was a bug that should be solved in the latest version.

logtho commented 3 years ago

I'm on version 1.6.3, which looks like the latest version.

logtho commented 3 years ago

when manually removing the torrents (from the client) stuck at unpacking, this seems to fix the rest of the torrents in the queue and they start downloading.

This didn't work this time. I removed those two torrents and the rest are still stuck at "Queued for downloading". Nothing is downloading - even after restarting the RealDebridClient service.

I just hit retry -> retry downloading locally on the lowest torrent and that seems to have fixed that problem though.

rogerfar commented 3 years ago

I'm not sure, but when it says "hoster_unavailable" its probably because the server the download link was generated on is not available. Retrying will generate a new download link.

Were those older torrents that took a long time to download? Or were they added before the 1.6.3 upgrade?

logtho commented 3 years ago

These torrents were added way after I upgraded to 1.6.3.

rogerfar commented 3 years ago

Ok strange then. If it happens again, can you upload the full log to pastebin?

CaffeineInfinity commented 3 years ago

I'm getting the same issue with different torrents, stuck in "Queued for unpacking". I'm using the multi part downloader.

Logs:

2021-03-24 10:03:33.155 +00:00 [ERR] Unexpected error occurred in TorrentDownloadManager.Tick
System.Exception: {
    "error": "parameter_missing",
    "error_details": "{link} is missing",
    "error_code": 1
}
   at RDNET.RdNetClient.Post[T](String url, KeyValuePair`2[] data, Boolean repeatRequest)
   at RDNET.RdNetClient.UnrestrictLinkAsync(String link, String password, Boolean remote)
   at RdtClient.Service.Services.Torrents.UnrestrictLink(Guid downloadId) in C:\Projects\rdt-client\server\RdtClient.Service\Services\Torrents.cs:line 255
   at RdtClient.Service.Services.TorrentRunner.Tick() in C:\Projects\rdt-client\server\RdtClient.Service\Services\TorrentRunner.cs:line 222
   at RdtClient.Service.Services.TaskRunner.ExecuteAsync(CancellationToken stoppingToken) in C:\Projects\rdt-client\server\RdtClient.Service\Services\TaskRunner.cs:line 36
2021-03-24 10:03:35.909 +00:00 [ERR] Unexpected error occurred in TorrentDownloadManager.Tick
System.Exception: {
    "error": "parameter_missing",
    "error_details": "{link} is missing",
    "error_code": 1
}
   at RDNET.RdNetClient.Post[T](String url, KeyValuePair`2[] data, Boolean repeatRequest)
   at RDNET.RdNetClient.UnrestrictLinkAsync(String link, String password, Boolean remote)
   at RdtClient.Service.Services.Torrents.UnrestrictLink(Guid downloadId) in C:\Projects\rdt-client\server\RdtClient.Service\Services\Torrents.cs:line 255
   at RdtClient.Service.Services.TorrentRunner.Tick() in C:\Projects\rdt-client\server\RdtClient.Service\Services\TorrentRunner.cs:line 222
   at RdtClient.Service.Services.TaskRunner.ExecuteAsync(CancellationToken stoppingToken) in C:\Projects\rdt-client\server\RdtClient.Service\Services\TaskRunner.cs:line 36
rogerfar commented 3 years ago

If you receive "link is missing" maybe just retry the torrent, see if that works.

logtho commented 3 years ago

I'm having the problem again. Here's a picture in case it helps you understand the issue any better: image

Here's the log file, as requested: rdtclient_010.log

If you receive "link is missing" maybe just retry the torrent, see if that works.

I don't see this error anywhere in the logs, so I believe the issue @CaffeineInfinity is having may be slightly different to mine. Especially as I am using the Simple Downloader while they are using the Multi Part Downloader.

logtho commented 3 years ago

I removed the above torrents from RD client and imported them manually. Then hit retry on the lowest one queued for downloading. That got another 2 downloading (since my limit is set to 2 downloads at a time), but when they finished they also got stuck at "queued for unpacking."

rogerfar commented 3 years ago

Can you send the full log again? Or at least the part after you hit retry?

logtho commented 3 years ago

I'm not sure how to tell when I hit retry (unless I'm supposed to check by time - but I'm not sure what time I did it) so I'll upload the full log again. Here it is: rdtclient_010.log

I do see some of those "link is missing" errors at the bottom so perhaps @CaffeineInfinity's problem isn't so different after all. However I'm not sure what's causing those errors because it seems like those errors occurred while things are downloading just fine.

rogerfar commented 3 years ago

Can you set the log level to Verbose first, then try again? I see a bunch of these errors:

System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
 ---> System.IO.IOException:  Received an unexpected EOF or 0 bytes from the transport stream.

This is when it's trying to unrestrict the link, you do have premium right?

logtho commented 3 years ago

Sure, I'll do that. I definitely have premium; I didn't think Real-Debrid even worked without premium lol.

CaffeineInfinity commented 3 years ago

I think I figured out the problem. When you get "https://real-debrid.com/d/XXXXXXXX: hoster_unavailable" from real-debrid the rdt client gets stuck in Queued for unpacking. This is a problem if you are downloading a group of files.

logtho commented 3 years ago

I think I figured out the problem. When you get "https://real-debrid.com/d/XXXXXXXX: hoster_unavailable" from real-debrid the rdt client gets stuck in Queued for unpacking. This is a problem if you are downloading a group of files.

I'm not sure exactly what this means. Is there any way to fix this? Or is it literally just something on RD's end?

Can you set the log level to Verbose first, then try again?

I'm currently trying to download a torrent of 390 files (50.25GBs) but it seems impossible as it downloads a few files and then says "Queued for unpacking" which holds up that download as well as anything else in the queue.

I had logging set to verbose so hopefully this log file can be a little more helpful: rdtclient_679.log

rogerfar commented 3 years ago

Unfortunately the log doesn't show any errors, but I do see this a lot: Torrent UYEMXEQRH53CG starting download 019121f5-b46d-4675-b047-464baf5d0530.

Can you put the torrent in a pastebin so I can see if I can reproduce it?

logtho commented 3 years ago

Sure. I've downloaded this torrent to Real-Debrid 2-3 times now however. Every time I put this link in RD, it insists on re-downloading the entire torrent regardless of which files are selected. I'm not sure if that's an issue with the torrent or something with RD though.

Here's a Pastebin with the magnet link: https://pastebin.com/eYGU1Hi9

jschmaltz69 commented 3 years ago

I've been experiencing this issue as well on the simple downloader. I don't have any logs to provide at the moment, but using the "retry" options to re-download all of that particular torrent's files from real-debrid seems to clear things up (including "un-jamming" other torrents that are held up in the queue) It's also a bit strange in that MKV files get "queued for unpacking", which I don't think is intended behavior. RD might be sending bad data or something (complete speculation).

logtho commented 3 years ago

but using the "retry" options to re-download all of that particular torrent's files from real-debrid seems to clear things up

This unfortunately doesn't work for me - at least not for torrents with a large amount of files. I hit retry and it'll seem to have fixed it but it'll end up stuck at "queued for unpacking" again. I've been trying to download the same torrent for the past 2 days or so with no luck lol.

It's also a bit strange in that MKV files get "queued for unpacking", which I don't think is intended behavior.

I thought this was weird too - but wasn't sure if it was intentional or not. I thought maybe this meant it was checking if it needs to be unpacked or something like that.

jschmaltz69 commented 3 years ago

Noted. I had a "stubborn" torrent that did this as well, and when I opted to download it the "old way" (copy the generated links from RD to jDownloader) it turned out there was one file that wasn't downloaded (I got the invalid link error both in jDownloader and on the RD page). I had to manually add the torrent (again) to specifically download the missing file. This seems to be happening in RD even on "freshly downloaded" torrents, so this problem may be coming from the RD backend.

rogerfar commented 3 years ago

That's interesting. So even though it says it's available it's not? And even after forcing to download it again in RD it still didn't work?

jschmaltz69 commented 3 years ago

It seems like forcing a full re-download in the client "sometimes" works, while in other cases it seems RD is not generating the link properly and you have to muck around to download the offending file manually.

logtho commented 3 years ago

For a few torrents, I've had one or two files say "error" (I can't remember the exact error but if it happens again I'll let you know) but the rest of the files download just fine. It just means Sonarr doesn't import it automatically, I assume since RDClient marks the entire torrent as "Error", so I import it myself and then manually download the missing file(s).

I'm not sure if this is related or if it's a completely separate issue, but I thought I'd mention it in-case it helps.

rogerfar commented 3 years ago

I added a retry mechanism for failed downloads, it will retry up to 3 times. When it retries it will unrestrict the link again so hopefully you get a fresh download.

If it is stuck in Queued for unpacking can you send me the logs on the Verbose setting?

rogerfar commented 3 years ago

I'm going to close this issue as it doesn't seem to be a problem anymore.