rndusr / stig

TUI and CLI for the BitTorrent client Transmission
GNU General Public License v3.0
554 stars 24 forks source link

Invalid RPC response: Invalid argument when trying to rename a specific torrent #174

Open Soundtoxin opened 4 years ago

Soundtoxin commented 4 years ago

No matter what I rename Man.of.Steel.2013.1080p.BluRay.DTS.x264-HDMaNiAcS. it fails with the above error. I tried removing and re-adding it. I tried removing the id from the command. I tried renaming with a name filter instead of an id.

The only weird thing I notice about the name is that there's a dot at the end, but when viewing the file list, the . isn't shown at the end. I've tried single quotes and double quotes. I've tried no quotes. I search opened and closed issues and didn't see this exact issue. The id is 627 if it matters, but I suspect its id changed when re-adding it anyway.

rndusr commented 4 years ago

Does stig crash or does it just display the error in the TUI?

If it does crash, can you post the full traceback?

Does renaming other torrents work as expected?

Soundtoxin commented 4 years ago

There is no crash, it just displays the error in the TUI. Renaming other torrents still works fine.

rndusr commented 4 years ago

I have no idea where this error is coming from. The error message (or various parts of it) doesn't even exist anywhere in the code.

Please post the output of "stig --version".

Please make a list of steps I can do on my computer to get the same error.

Soundtoxin commented 4 years ago

Here is my version, from the stig-git package in the AUR

stig version 0.11.2a0

Please make a list of steps I can do on my computer to get the same error.

Sorry to say, I cannot do this exactly, but here's a generalized version. 1) copy torrent url 2) switch to stig and do :add -p 'path' -s URLHERE 3) while on the new torrent, press tn to rename it and make any change, then press enter 4) the error occurs, the name does not change

The torrent in question is private and I'm unable to share the URL. I can say that it was able to be renamed via deluge in the past. I can't recall if I used deluge-gtk or deluge-console to do it. I was just moving some old torrents over to stig/transmission and had to change the names of them after adding them to match the local copy so it could verify contents and seed files I already had.

In the end I decided to just remove the torrent if I can't rename it. I haven't managed to run into this issue with any other torrent so far, and I have over 600 in this transmission instance. I realize this puts you in a tough position if you can't really debug it. I'm not sure that a real unsolved issue like this should be closed, but maybe marked low priority until someone manages to run into it again.

Soundtoxin commented 4 years ago

Apologies, made some typo in the stig command I use. I edited it, but since you post from email you might not see it. The fixed version is here also:

2) switch to stig and do :add -p 'path' -s URLHERE

rndusr commented 4 years ago

I had to remove the -p option because that specifies the download path, but aside from that, everything works as expected.

Unfortunately, the Transmission RPC interface doesn't really report errors. Maybe something went wrong with the renaming and stig didn't know what was going on.

What's really weird thing is that the word "trying" only exists in comments, one debug message and the description of the "tracker" filter. It shouldn't appear in any exception.

It would've been interesting to see transmission-daemon's debugging output or what happens when you try to rename the torrent with transmission-remote.

Soundtoxin commented 3 years ago

I just hit this issue again. trying to rename [Asakura] Maou Gakuin no Futekigousha [Web 1080p] to Maou Gakuin no Futekigousha: Shijou Saikyou no Maou no Shiso, Tensei shite Shison-tachi no Gakkou e Kayou

It's a public torrent this time, so here it is if you want to test on your own machine. https://nyaa.si/view/1284598

Same as before, basically. I was doing :add -p '/storage/anime/' -s MAGNETLINKHERE then tn to rename, deleted the current name between the single quotes, pasted in the replacement name. The name I want to give it is a directory I already have, I want to verify the 8/12 files I already have before it downloads what's missing, and I want to use the "proper" name as storage location.

Soundtoxin commented 3 years ago

Important update: I can't rename it at all, I forgot this was also what happened last time. I tried just removing the brackets + the text inside them on both ends to clean up the name and that fails too.

Soundtoxin commented 3 years ago

Another update: (sorry, should've messed around more before posting maybe), I changed storage location to /tmp, started the torrent, and once it had downloaded some data, I was able to rename it to whatever I wanted, so now I can hopefully just move it to where I really want it. I'm unsure if it'll try to overwrite my complete files with partial ones if I do a move, so I'm gonna copy them to where it is in /tmp, do a verification, then when it's done I'll move it. Actually, just realized every single ep I had now has a v2 so I have to redownload it all anyway.

Hopefully some of this info can clue you in to the nature of the issue.

rndusr commented 3 years ago

I'm getting a different error:

Invalid RPC response: Invalid argument

But only with the magnet link. Renaming works for me if I add the torrent file.

I don't think changing the storage location has anything to do with it, but "downloading some data" might be the reason why it eventually worked for you. (Can't confirm this because I don't want to download for legal reasons.)

The RPC request is identical with torrent file and magnet link, so it looks like it's an issue with Transmission. The unhelpful "Invalid argument" is coming directly from the RPC response.

Soundtoxin commented 3 years ago

Should this issue be closed then if it's an issue with transmission and not stig?

rndusr commented 3 years ago

I'm not entirely sure it's a Transmission issue. Let's leave it open for now.

Soundtoxin commented 1 year ago

I may have just hit this with another torrent (or maybe just a similar issue) 06:09:46 x4 rename: Invalid RPC response: Invalid argument It's a season torrent for a show I already have the files for, so I set the location and then I was going to rename it to match the directory name of my existing one, and finally verify the files so it should detect all I have and be seedable right away, but for some reason it won't let me rename it at all.

Soundtoxin commented 1 year ago

I spoke with the uploader of this particular torrent and he suspected it was a forbidden character causing the problem. He re-uploaded the torrent with a different name and then it worked. From what I can tell he just removed a colon, but I'm using ext4 on this server so colons are allowed in filenames, and I even add them when renaming torrents all the time, including this one just now, which worked. Is transmission itself causing a problem here? Or maybe stig, not sure.

rndusr commented 1 year ago

Is transmission itself causing a problem here? Or maybe stig, not sure.

Can you do what you want with transmission-remote?

Either way, I'm probably not going to fix this, because whatever little time I can spare for stig is going into the reboot.

Soundtoxin commented 1 year ago

The torrent that was a problem this time was taken down and replaced, so I wasn't able to test, unfortunately. I will try to remember to test with transmission-remote next time, and if it doesn't work there either then I'll know to report to the transmission people. Thanks for the idea, and good luck on the reboot. I think I'll close this issue now since there's not much actionable to do and you are rewriting stig anyway.

Soundtoxin commented 1 year ago

I've hit another torrent with this issue now (private). It appears there's a space at the start of the torrent name, not sure why that would cause an issue, but I think last time there was something similar going on. I frequently add a space when renaming stuff, but maybe having one from the start doesn't work well. I'm looking at the transmission-remote man page and I don't see how to rename a torrent with it.

rndusr commented 1 year ago

This might be relevant: https://blog.libtorrent.org/2014/12/filenames/

"Invalid argument" sounds like something Transmission would say if you want to rename something to a path it considers unsafe or invalid.

At least in Transmission 4.0, transmission-remote has a --rename option. But I don't know exactly how it works.