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

Sonarr is trying to import from a non-existent directory #2571

Closed
MrDemocracy opened this issue May 16, 2018 · 6 comments
Closed

Sonarr is trying to import from a non-existent directory #2571

MrDemocracy opened this issue May 16, 2018 · 6 comments

Comments

@MrDemocracy
Copy link

Bug Report

I have to manually import almost everything I download because of the Import failed error message you can see in the screenshot below.
I have checked that the file/folder Sonarr is looking for, it doesn't exist. It imports correctly for some torrents, so I don't think It's because of incorrect folder permissions.

System Information/Logs

Sonarr Version:
2.0.0.5163

Operating System:
Windows 10

.net Framework (Windows) or mono (macOS/Linux) Version:
.net Framework v4.7.02556

Link to Log Files (debug or trace):

Sonarr log:

capture
Isn't there supposed to be a file extension at the end?

Folder in windows explorer:

capture

Additional Information

I think this happens because of the dn (Display Name) parameter in the magnet url.

Example:

magnet:?xt=urn:btih:c12fe1c06bba254a9dc9f519b335aa7c1367a88a&dn=(Series and episode name).1080p.AMZN.WEBRip.DDP5.1.x264-(Upload team)%5Brartv%5D

I'm using BiglyBT version 1.5.0.1_B05

@markus101
Copy link
Member

Link to Log Files (debug or trace):

Your screenshot isn't a debug or trace log... Need the actual log file, unaltered. We'll need trace logs, which include the queue response from your download client. This issue likely has to do with the download being listed as one thing in the client, but in a folder that doesn't match. From the code that deals with trying to figure out what path Vuze is returning (looks like BiglyBT is based on Vuze):

// Vuze has similar behavior as uTorrent:
// - A multi-file torrent is downloaded in a job folder and 'outputPath' points to that directory directly.
// - A single-file torrent is downloaded in the root folder and 'outputPath' poinst to that root folder.
// We have to make sure the return value points to the job folder OR file.

That means if the torrent name doesn't match the folder things aren't going to work. If there is something else that Vuze/BiglyBT returns (which is why we'll need trace logs) then we can make a change otherwise it's out of our hands.

@MrDemocracy
Copy link
Author

Here is the log files.

@markus101
Copy link
Member

Thanks for the logs.

@Taloth this is what we get back for a torrent from Vuze/Bigly:

{
  "downloadDir": "D:\\Filmer & Serier\\.Filmer Downloads\\Mr.Pickles.S03E08.Bullies.1080p.WEB-DL.DD5.1.H264-BTN[rarbg]",
  "errorString": "",
  "eta": -1,
  "hashString": "CA9007A77AC07C3B6FB81511F1C05BA03191DBE4",
  "id": 34128,
  "isFinished": false,
  "leftUntilDone": 0,
  "name": "Mr.Pickles.S03E08.Bullies.1080p.WEB-DL.DD5.1.H264-BTN[rartv]",
  "status": 6,
  "totalSize": 468843324
}

And for a single file it'll look like so:

{
  "downloadDir": "C:\\Users\\Mark\\Documents\\Vuze Downloads",
  "errorString": "",
  "eta": -1,
  "hashString": "DDEE5CB75C12F3165EF79A12A5CD6158BEF029AD",
  "id": 1,
  "isFinished": false,
  "leftUntilDone": 662700032,
  "name": "ubuntu-18.04-live-server-amd64.iso",
  "status": 0,
  "totalSize": 845152256
}

Unless we parse the downloadDir to try and determine that the final folder is a job folder I don't see a way we can improve this, thoughts?

@Taloth
Copy link
Member

Taloth commented May 20, 2018

@markus101 The difference between folder name and torrent name is what's causing issues.
Single file downloads should contain an extension, so it's possible to detect it, but i'm reluctant to reverse the logic. If we detect single files and assume folders otherwise we could get into some really nasty edge cases.
I'm not opposed to ignoring small changes in the directory name. But it might be better to investigate why the discrepancy between name and folder occurs and deal with that instead. My guess is torrent url query params determine the name and the torrent content determines the folder, and we can detect both.

@MrDemocracy
Copy link
Author

MrDemocracy commented Jul 13, 2018

So has this been fixed and been part of any recent update? I still experience the issue on version 2.0.0.5228.

@a-goonie
Copy link

a-goonie commented Nov 2, 2018

Any chance this has been resolved?

I'm seeing this issue with single files downloaded by Vuze, where Sonarr is attempting to import a single file using a path that contains the Name (or "Display Name") from Vuze, rather than the actual file name. As noted above, trouble arises as the "Display Name" doesn't always end with a file extension.

In Vuze, if I manually change the Display Name so that it ends with the file extension, then Sonarr is able to import. For example:

Display Name in Vuze: Torrent.mkv[eztv]
File Path: /Download_Dir/Torrent.mkv
Result: Import fails, because Sonarr attempts to import the file using the path /Download_Dir/Torrent.mkv[eztv]

Manually edited Display Name in Vuze: Torrent.mkv
File Path: /Download_Dir/Torrent.mkv
Result: Import succeeds, since the Display Name in Vuze reflects the actual file name, so the path isn't screwed up when Sonarr attempts to import.

Cheers

ta264 pushed a commit to ta264/Sonarr that referenced this issue Dec 5, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants