rogerfar / rdt-client

Real-Debrid Client Proxy
MIT License
880 stars 111 forks source link

[BUG] Internal error - Torrent doesn't get started automatically since 12/07/2024 #536

Closed shulymn closed 1 month ago

shulymn commented 3 months ago

What version are you using? 2.0.79 (also tried downgrading to 2.0.78 no success) What OS are you running? UnRAID Are you using Docker or as a service? Docker Which debrid provider are you using? Real-debrid Which downloader are you using? Aria2c Please attach a log file here with the log setting set to debug

[19:06:34 DBG] Adding 6D8DED46C0800ECE3BFB485BBDC6A9DF01956B8D magnet link magnet:?xt=urn:btih:6d8ded46c0800ece3bfb485bbdc6a9df01956b8d&dn=%5BTrix%5D%20Yaneura%20no%20Rudger%20%282023%29%20%28BD%202160p%204K%20HDR%20AV1%29%20%7C%20The%20Imaginary%20%E5%B1%8B%E6%A0%B9%E8%A3%8F%E3%81%AE%E3%83%A9%E3%82%B8%E3%83%A3%E3%83%BC&tr=http%3A%2F%2Fnyaa.tracker.wf%3A7777%2Fannounce&tr=udp%3A%2F%2Fopen.stealth.si%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Fexodus.desync.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce for torrent  (7K3BBJFKNALES -  %) (1204fee9-fcb1-41b5-b828-b3edb0b843eb)
[19:06:34 DBG] Processing 1 torrents
[19:06:34 DBG] Currently 0 queued downloads and 0 total active downloads for torrent  (7K3BBJFKNALES -  %) (1204fee9-fcb1-41b5-b828-b3edb0b843eb)
[19:06:34 DBG] Processing for torrent  (7K3BBJFKNALES -  %) (1204fee9-fcb1-41b5-b828-b3edb0b843eb)
[19:06:34 DBG] TorrentRunner Tick End (took 15798ms)
[19:06:35 DBG] Updating torrent info from debrid provider
[19:06:35 DBG] Processing 1 torrents
[19:06:35 DBG] Currently 0 queued downloads and 0 total active downloads for torrent  (7K3BBJFKNALES -  %) (1204fee9-fcb1-41b5-b828-b3edb0b843eb)
[19:06:35 DBG] Processing for torrent  (7K3BBJFKNALES -  %) (1204fee9-fcb1-41b5-b828-b3edb0b843eb)
[19:06:36 DBG] Processing 1 torrents
[...] (spams this message like 10 times or so)

[19:06:51 DBG] Currently 0 queued downloads and 0 total active downloads for torrent [Trix] Yaneura no Rudger (2023) (BD 2160p HDR AV1) [FE75E651].mkv (7K3BBJFKNALES - waiting_files_selection 0%) (1204fee9-fcb1-41b5-b828-b3edb0b843eb)
[19:06:51 DBG] Processing for torrent [Trix] Yaneura no Rudger (2023) (BD 2160p HDR AV1) [FE75E651].mkv (7K3BBJFKNALES - waiting_files_selection 0%) (1204fee9-fcb1-41b5-b828-b3edb0b843eb)
[19:06:51 DBG] Selecting files for torrent [Trix] Yaneura no Rudger (2023) (BD 2160p HDR AV1) [FE75E651].mkv (7K3BBJFKNALES - waiting_files_selection 0%) (1204fee9-fcb1-41b5-b828-b3edb0b843eb)
[19:06:51 DBG] Seleting files for torrent [Trix] Yaneura no Rudger (2023) (BD 2160p HDR AV1) [FE75E651].mkv (7K3BBJFKNALES - waiting_files_selection 0%) (1204fee9-fcb1-41b5-b828-b3edb0b843eb)
[19:06:51 DBG] Determining which files are already available on RealDebrid for torrent [Trix] Yaneura no Rudger (2023) (BD 2160p HDR AV1) [FE75E651].mkv (7K3BBJFKNALES - waiting_files_selection 0%) (1204fee9-fcb1-41b5-b828-b3edb0b843eb)
[19:06:51 DBG] Found 1/1 available files on RealDebrid for torrent [Trix] Yaneura no Rudger (2023) (BD 2160p HDR AV1) [FE75E651].mkv (7K3BBJFKNALES - waiting_files_selection 0%) (1204fee9-fcb1-41b5-b828-b3edb0b843eb)
[19:06:51 DBG] Selecting 0/1 files for torrent [Trix] Yaneura no Rudger (2023) (BD 2160p HDR AV1) [FE75E651].mkv (7K3BBJFKNALES - waiting_files_selection 0%) (1204fee9-fcb1-41b5-b828-b3edb0b843eb)
[19:06:51 DBG] Filtered all files out! Downloading ALL files instead! for torrent [Trix] Yaneura no Rudger (2023) (BD 2160p HDR AV1) [FE75E651].mkv (7K3BBJFKNALES - waiting_files_selection 0%) (1204fee9-fcb1-41b5-b828-b3edb0b843eb)
[19:06:51 DBG] Selecting files:
[19:06:51 DBG] 1: /[Trix] Yaneura no Rudger (2023) (BD 2160p HDR AV1) [FE75E651].mkv (1494445031b)
[19:06:51 DBG]  for torrent [Trix] Yaneura no Rudger (2023) (BD 2160p HDR AV1) [FE75E651].mkv (7K3BBJFKNALES - waiting_files_selection 0%) (1204fee9-fcb1-41b5-b828-b3edb0b843eb)
[19:06:51 ERR] Internal error

This is what I get when I add any torrent, either manually, or using sonarr or radarr. This wasn't happening yesterday, last download I successfuly did was yesterday 11/07/2024 14:41:32 Nothing changed on my side since yesterday, I reinstalled rdtclient entirely just to see if it fixed it but nothing. This happens because the torrent doesn't get automatically started on real-debrid, when i go to the page of real-debrid, it asks me to select the files and gets stuck here. If I select files and accept, the torrent starts downloading on rdtclient. Something might have changed on real-debrid APi, maybe. Here are some more screenshots :

Before starting the torrent manually on real debrid : image image After clicking "start my torrent" on real-debrid : image

Thanks for your help and your work.

shulymn commented 3 months ago

Sorry posting right after my initial post but I wanna add an important detail :

I switched to alldebrid temporarily and everything works fine, the problem most likely comes from real-debrid, as i said probably a change in their API?

That's a temporary solution, ideally i'd like to use Real-debrid back if possible

Thank you.

Edit :

image Found this on twitter

EsmailELBoBDev2 commented 3 months ago

yeah this change some of their api endpoints seems like RDT client need to use these new ones? not sure

shulymn commented 3 months ago

yeah this change some of their api endpoints seems like RDT client need to use these new ones? not sure

Yes the api endpoints need to be changed. The default settings of rdtclient are pretty light (3 to 6 requests per hour) so I doubt rdtclient is a problem and needs to change anything on this side. Just the api endpoints should be enough

gaston-arg commented 3 months ago

I was just about to post the same. Same "internal error" here...

Rodmodrtf commented 3 months ago

Same issue

EsmailELBoBDev2 commented 3 months ago

my torrents disappeared in RDTClient too

cchance27 commented 3 months ago

Pretty sure the dev also will need to add a 1 second delay between calls especially for getting the links, as it can trigger a fair_usage violation it seems like if it pounds the server for all the files at once.

honestly just needs to have some logic added to deal with the new api limits ASAP.

EsmailELBoBDev2 commented 3 months ago

same I hope the dev is already working on it, everything is stopped and I cant do anything

hornofabraxas commented 3 months ago

I was previously getting this "Internal Error", and I could Start Torrent on real-debrid's site, and it would download.

However, I just sent a couple more files through on Radarr since I saw the real-debrid team just said they're fully functional - both files worked.

Maybe the RD api just wasn't fully functional yet? Can anyone else confirm if theirs are working again? I don't know how rdt-client interacts with the torrents api and if we should expect it to be broken or not.

shulymn commented 3 months ago

Now it gets stuck into "Torrent waiting for file selection" Sometimes it switches to "Too many requests" It eventually ends up downloading though !

A fix is probably needed in the number of requests and delay between them or something as well, but yeah it works again

b4154 commented 3 months ago

+1 My torrents are disappearing. It doesn't seem to be handling the rate limit correctly.

hornofabraxas commented 3 months ago

Again I don't know how this works exactly but if you don't need your torrents stored in RD, it might be worth clearing them if you're being rate limited, and see if that helps until rdtclient is updated. I previously received a rate error (that also eventually did download) - but after I cleared my torrents list in RD, no errors, straight to downloading after file selection.

For example, perhaps rdtclient pulls all /torrent api results, hitting a 250/s rate limit on rd, and if your RD /torrents was flushed, perhaps that would be fixed (until you hit another 250 cached)

If you're using something like Debrid Media Manager, this might not be feasible, but if you just use torrents for one-off downloads like RDT-Client > Radarr, maybe it is.

shulymn commented 3 months ago

I don't know how it works either but I think it's a good idea to not keep torrents on real-debrid for that issue, it was always setup like this for me anyway. I think my "too many requests" came from the fact that I was trying different torrents at that moment. Since yesterday, it downloaded what sonarr sent without any issues

richardgetz commented 3 months ago

+1 My torrents are disappearing. It doesn't seem to be handling the rate limit correctly.

I am seeing this too. I turned on debug logs. Looks like it could be on RD side:

System.Exception: Unable to deserialize Real Debrid API response to List1. Response was: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Temporarily Down For Maintenance...`
PrevotYann commented 3 months ago

Seems like it stucks at "Torrent finished, waiting for download links", so it doesn't tell Radar/Sonarr that files are present because they're not added into the symlink folder after the download.

Indeed, the /torrent endpoint changed on RD API side, let's see if this can be fixed anytime soon here :D

drizzt09 commented 3 months ago

Has anyone tagged @rogerfar so he is aware of the potential change requirements set by RD

rogerfar commented 3 months ago

I'll have a look later today

rogerfar commented 3 months ago

I saw on X that everything should be back to normal right now, is that the case?

joshk6656 commented 3 months ago

I saw on X that everything should be back to normal right now, is that the case?

A few endpoint responses changed and rate limits were introduced on the API, but I don't think any that impacts the functionality of rdt-client.

If people are having issues, they are likely rate limited due to how they are mounting their drives.

It probably wouldn't hurt for people to raise their "Check Interval" within rdt-client, but I don't believe rdt-client polls nearly enough to trigger the limits on its own.

rogerfar commented 3 months ago

I tried to make some changes to RDT to not keep calling the /torrents/{id} endpoint for each torrent, by just using the /torrents endpoint and use that data for processing. Issue is that the status field isn't updated until you call the /torrents/{id} endpoint, so you have to keep polling.

What I can do is simply ignore torrents that are completed to limit the amount of requests.

rogerfar commented 3 months ago

I pushed 2.0.80 to should fix those issues.

drizzt09 commented 3 months ago

I pushed 2.0.80 to should fix those issues.

I checked portal and get warning I am running .79 and .80 exists. I forced a docker compose rebuild update and on portal it doesn't tell me I have an update anymore but help screen still shows .79

richardgetz commented 3 months ago

I pushed 2.0.80 to should fix those issues.

I checked portal and get warning I am running .79 and .80 exists. I forced a docker compose rebuild update and on portal it doesn't tell me I have an update anymore but help screen still shows .79

Mine works without issue after update and doesn't show the mismatched version number as described. Recommend checking again making sure you're running the correct image.

EsmailELBoBDev2 commented 3 months ago

@rogerfar Hi, I know this is off topic but when using zurg nightly with RDT client is there any hope that I can download music? I know real debrid rar it but according to zurg they unrar it so can rdt client use symlink downloader after that?

hmhm03 commented 3 months ago

@rogerfar After updating to 2.0.80, I am able to download again, but have an issue with the GUI. The Torrents tab shows what I'm guessing is all past download links as "unknown status" with the current download showing at the very bottom (see attached picture). The page usually locks up and crashes. Also, I no longer see a progress bar in radarr/sonarr while a file is downloaded.

Screenshot 2024-07-14 095450

Below are the container logs. The "out of memory" exceptions and "time-out" exceptions begin once a file is selected in radarr/sonarr. I've never had a memory issue for this vm until these recent rd changes.

[15:23:50 WRN] Starting host on version 2.0.80.0 [15:23:52 INF] TaskRunner started. [15:23:52 INF] ProviderUpdater started. [15:23:54 INF] UpdateChecker started, currently on version v2.0.80. [15:23:54 INF] WatchFolderChecker started. [15:24:16 WRN] 304: /index.html [15:24:17 WRN] 101: /hub [15:24:26 WRN] 304: /index.html [15:26:10 WRN] 304: /index.html [15:26:17 WRN] 101: /hub [15:26:31 WRN] 101: /hub [15:27:12 ERR] Exception of type 'System.OutOfMemoryException' was thrown. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.GC.AllocateNewArray(IntPtr typeHandle, Int32 length, GC_ALLOC_FLAGS flags) at System.Buffers.SharedArrayPool1.Rent(Int32 minimumLength) at DownloaderNET.Downloader.Download(Int64 thread, Chunk chunk, CancellationToken cancellationToken) [15:27:20 ERR] Exception of type 'System.OutOfMemoryException' was thrown. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.GC.AllocateNewArray(IntPtr typeHandle, Int32 length, GC_ALLOC_FLAGS flags) at System.Buffers.SharedArrayPool1.Rent(Int32 minimumLength) at DownloaderNET.Downloader.Download(Int64 thread, Chunk chunk, CancellationToken cancellationToken) [15:27:20 ERR] Exception of type 'System.OutOfMemoryException' was thrown. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.GC.AllocateNewArray(IntPtr typeHandle, Int32 length, GC_ALLOC_FLAGS flags) at System.Buffers.SharedArrayPool`1.Rent(Int32 minimumLength) at DownloaderNET.Downloader.Download(Int64 thread, Chunk chunk, CancellationToken cancellationToken)

[...]

[15:27:31 ERR] Exception of type 'System.OutOfMemoryException' was thrown. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.GC.AllocateNewArray(IntPtr typeHandle, Int32 length, GC_ALLOC_FLAGS flags) at System.Buffers.SharedArrayPool`1.Rent(Int32 minimumLength) at DownloaderNET.Downloader.Download(Int64 thread, Chunk chunk, CancellationToken cancellationToken) [15:28:01 ERR] The operation has timed out. System.TimeoutException: The operation has timed out. at DownloaderNET.Downloader.Download(Int64 thread, Chunk chunk, CancellationToken cancellationToken) [15:28:13 ERR] The operation has timed out. System.TimeoutException: The operation has timed out. at DownloaderNET.Downloader.Download(Int64 thread, Chunk chunk, CancellationToken cancellationToken) [15:28:13 ERR] The operation has timed out. System.TimeoutException: The operation has timed out. at DownloaderNET.Downloader.Download(Int64 thread, Chunk chunk, CancellationToken cancellationToken) [15:28:13 ERR] The operation has timed out. System.TimeoutException: The operation has timed out. at DownloaderNET.Downloader.Download(Int64 thread, Chunk chunk, CancellationToken cancellationToken)

PrevotYann commented 3 months ago

On my side still on 2.0.80, auto downloading doesnt seem to work anymore, I have to manually start the torrents from RD.

Also, while completed, torrents get stuck on : "Torrent finished, waiting for download links", so my -arr apps aren't processing the complete download.

joshk6656 commented 3 months ago

Could you tell more about your setup? How are you mounting your drive? rclone_rd or zurg? It's likely something else is flooding RD's API and the selection API calls are getting rate limited.

PrevotYann commented 3 months ago

Could you tell more about your setup? How are you mounting your drive? rclone_rd or zurg? It's likely something else is flooding RD's API and the selection API calls are getting rate limited.

Yeah i'm using zurg since the api changes.

I set limits on zurg config.yml tho ! Is there a setting that I can setup on rdt side also ?

shulymn commented 3 months ago

It works fine for me since the update, here are the settings i'm using :

image image image

Also make sure your torrent list is empty on real-debrid side, i don't know if that changes anything but that's how it is for mine.

PrevotYann commented 3 months ago

I got the same as yours, even put a bigger check interval, and files are still not selected nor the torrent set as compelted and stuck on "waiting for the download links".

fungos commented 3 months ago

I had similar issues since RD issues, latest update was still having weird issues, like the eternal long white page of checkboxes. Finally I found it was caused by the .db which was broken, which notmally is a few KBs it was 80MBs, with lots of dead or repeated torrents. Deleting the db and starting clean fixed all issues.

Which brings one point, maybe settings should be saved in a text file to avoid losing configs when the db is corrupted, broken or deleted.

shulymn commented 3 months ago

I had similar issues since RD issues, latest update was still having weird issues, like the eternal long white page of checkboxes. Finally I found it was caused by the .db which was broken, which notmally is a few KBs it was 80MBs, with lots of dead or repeated torrents. Deleting the db and starting clean fixed all issues.

Which brings one point, maybe settings should be saved in a text file to avoid losing configs when the db is corrupted, broken or deleted.

Might help then, I reinstalled rdt client entirely when I started having the issue, so that might help

rogerfar commented 2 months ago

I will add another check to force update torrent data when no filename is found in the DB. This should solve that issue.

rogerfar commented 1 month ago

Seems that this is pretty stable now.