transgui icon indicating copy to clipboard operation
transgui copied to clipboard

error on torrent names with colons

Open ouroborus opened this issue 7 years ago • 23 comments

Shows error "invalid argument" and doesn't add torrent if magnet link is for a torrent whose name includes colons.

Windows 10 transgui 5.12

ouroborus avatar Dec 21 '17 17:12 ouroborus

Please post a example of torrent or magnet what give you this error. Thanks!

PD: your Transmission daemon (not TransGUI!) is running in Linux? because colons are illegal in folders/filenames in Windows. Quoted from Microsoft Site

Use any character in the current code page for a name, including Unicode characters and characters in the extended character set (128–255), except for the following:

The following reserved characters:
    < (less than)
    > (greater than)
    : (colon)
    " (double quote)
    / (forward slash)
    \ (backslash)
    | (vertical bar or pipe)
    ? (question mark)
    * (asterisk)

antekgla avatar Dec 29 '17 15:12 antekgla

@antekgla The daemon is indeed running on Linux. TransGUI is running on Windows.

However, AFAIK, the name in the magnet link doesn't matter as far as OS compatibility is concerned as it isn't used in naming the folder/files. The torrent file itself has the actual file/folder names and those are used.

magnet:?xt=urn:btih:ba1e75d3f1a44b41691bcdb8c897c081630ae653&dn=linuxmint%3A18.3%20mate%2064bit.iso

ouroborus avatar Dec 29 '17 16:12 ouroborus

@leonsoft-kras I think what this is related to the new function ExcludeInvalidChar This function remove the illegal characters in Windows, but in Linux that characters are valid. So maybe we would have to review its implementation.

However the error is fired for another reason related. #### Edited because the conclusion was wrong but not the origin ####

antekgla avatar Dec 29 '17 18:12 antekgla

I will look at the holidays ))

leonsoft-kras avatar Dec 30 '17 00:12 leonsoft-kras

I did it differently recently, but I'll try to see your version.

In general there was no time. I wanted to ask a question, but for now I'll look at your option.

leonsoft-kras avatar Dec 30 '17 00:12 leonsoft-kras

Wait, A further look debugging I can say what I was wrong... The torrent is added with the illegal character (I was confused because in the Add form the illegal chars are removed, running a second copy of transgui while the main was paused I can see what the torrent is added with the illegal chars. Sorry about the confusion. 😢

I think what I know the problem, forget my previous long post, it is totally wrong. I edited that post because cause confussion.

antekgla avatar Dec 30 '17 00:12 antekgla

@ouroborus please write here the transmission daemon version (it is in the statusbar first panel) Thanks!

antekgla avatar Dec 30 '17 00:12 antekgla

I have not added the torrent either. it is necessary to look.

leonsoft-kras avatar Dec 30 '17 00:12 leonsoft-kras

The problem I think (I need what @ouroborus confirm) his (and mine) Transmission Daemon is prior to 2.80 (mine is 2.61) so dont accept method:

torrent-rename-path

introduced in Transmission 2.80 so when TransGUI try to rename the torrent without illegal chars, fires the error "invalid argument"

I check this: I have 2 NAS. One with Transmission 2.61 (dont accept rename) and other with Transmission 2.84 (accept rename). When I add that magnet in 2.61 fires the error. When I add in Transmission 2.84 no error at all.

If you use original TransGUI 5.01 in 2.61 no error, because the ExcludeInvalidChar function dont exist and how daemon is in Linux the colon are accepted character. Maybe prior to use

torrent-rename-path

we need to check RPC-version.

antekgla avatar Dec 30 '17 01:12 antekgla

I fixed the problem 50/50 (excluded symbol ":").

The torrent was invented by a strange person. It does contain invalid characters, in particular ":". Another strange thing is that after adding a torrent in a few seconds, the name is replaced with ":" and a space for the "-" character.

The original name: linuxmint:18.3 mate 64bit.iso The final name after the start torrent: linuxmint-18.3-mate-64bit.iso

I checked the function "torrent-rename-path" on another torrent file. It works successfully. The file is renamed without errors. My version of the transmission (on Zyxel Keenetic) 2.84 (14307)

leonsoft-kras avatar Jan 02 '18 11:01 leonsoft-kras

I checked the function "torrent-rename-path" on another torrent file. It works successfully. The file is renamed without errors. My version of the transmission (on Zyxel Keenetic) 2.84 (14307)

Thats is because the version 2.84 supports renaming a torrent/file but in versions prior to 2.80 that method not exist. TransGUI dont show the Rename menu option in RPC<15. The problem here is what the user is adding a torrent but (because the illegal chars) TransGUI is executing rename anyway. Try to add this torrent in Transmission < 2.80 and you get the error.

antekgla avatar Jan 02 '18 14:01 antekgla

Why do check RPC if I have the latest 2.84 and the error is with this torrent happens.

leonsoft-kras avatar Jan 02 '18 15:01 leonsoft-kras

@antekgla TransGUI says "Transmission 2.92 (14714)" though the package name on the server says it's "2.84-3ubuntu3"

ouroborus avatar Jan 02 '18 17:01 ouroborus

The torrent was invented by a strange person. It does contain invalid characters, in particular ":". Another strange thing is that after adding a torrent in a few seconds, the name is replaced with ":" and a space for the "-" character.

@leonsoft-kras While the name in the magnet link and the name in the torrent usually match, they aren't required to match. The name in the magnet link can be considered to be advisory while the name in the torrent can be considered to be canonical.

ouroborus avatar Jan 02 '18 17:01 ouroborus

Why do check RPC if I have the latest 2.84 and the error is with this torrent happens.

@antekgla TransGUI says "Transmission 2.92 (14714)" though the package name on the server says it's "2.84-3ubuntu3"

Thats is strange because I have a Transmission 2.84 running in a NAS (Linux) and that magnet is added without errors.

antekgla avatar Jan 02 '18 17:01 antekgla

Please post a example of torrent or magnet what give you this error. Thanks!

magnet:?xt=urn:btih:051612342099c4a1fde2092f878b6b7dc3e7a61a&dn=%5BCleo%5D%20Suzumiya%20Haruhi%20no%20Yuuutsu%20%7C%20The%20Melancholy%20of%20Haruhi%20Suzumiya%20%5BDual%20Audio%2010bit%20BD1080p%5D%5BHEVC-x265%5D&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%2Ftracker.coppersurfer.tk%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969%2Fannounce

I'm running transmission 2.94 on my Gentoo Linux server and client is transmission-remote-gui 5.15.4 (I did encounter this error on somewhere about 5.10.* first time).

skobkin avatar Sep 12 '18 17:09 skobkin

This is a daemon threading problem that results from renaming a torrent while still in a magnet state. The rpc method when sent to the daemon has an immediate or not flag. Not immediate and the method function is threaded in a callback. Therefor, there's no guarantee that the rename will take place at any given time. The daemon's rename function can return error = EINVAL (invalid argument) in certain cases due to the non immediate flags of torrent-add and torrent-rename-path conflicting. For Transmission Remote GUI to guarantee magnet renaming always functions correctly, the data in the actual magnet text would need to be changed prior to torrent-add, not by rpc rename because of the timing problems. For Windows daemon I used a patched daemon version where cleanFilename() is used for the displayName of the magnet link so that any remote client doesn't need to do it.


static struct method
{
    char const* name;
    bool immediate;
    handler func;
}
methods[] =
{
    { "port-test", false, portTest },
    { "blocklist-update", false, blocklistUpdate },
    { "free-space", true, freeSpace },
    { "session-close", true, sessionClose },
    { "session-get", true, sessionGet },
    { "session-set", true, sessionSet },
    { "session-stats", true, sessionStats },
    { "torrent-add", false, torrentAdd },
    { "torrent-get", true, torrentGet },
    { "torrent-remove", true, torrentRemove },
    { "torrent-rename-path", false, torrentRenamePath },
    { "torrent-set", true, torrentSet },
    { "torrent-set-location", true, torrentSetLocation },
    { "torrent-start", true, torrentStart },
    { "torrent-start-now", true, torrentStartNow },
    { "torrent-stop", true, torrentStop },
    { "torrent-verify", true, torrentVerify },
    { "torrent-reannounce", true, torrentReannounce },
    { "queue-move-top", true, queueMoveTop },
    { "queue-move-up", true, queueMoveUp },
    { "queue-move-down", true, queueMoveDown },
    { "queue-move-bottom", true, queueMoveBottom }
};

cfpp2p avatar Sep 14 '18 20:09 cfpp2p

Also have this issue. I can't download any magnet link from site: http://rutor.is magnet:?xt=urn:btih:1f1504c1e121f95777f9b8d166b2f7a6980a8a5f&dn=rutor.info_%D0%9C%D1%81%D1%82%D0%B8%D1%82%D0%B5%D0%BB%D0%B8%3A+%D0%92%D0%BE%D0%B9%D0%BD%D0%B0+%D0%B1%D0%B5%D1%81%D0%BA%D0%BE%D0%BD%D0%B5%D1%87%D0%BD%D0%BE%D1%81%D1%82%D0%B8+%2F+Avengers%3A+Infinity+War+%282018%29+BDRip+720p+%D0%BE%D1%82+Scarabey+%7C+%D0%9B%D0%B8%D1%86%D0%B5%D0%BD%D0%B7%D0%B8%D1%8F&tr=udp://opentor.org:2710&tr=udp://opentor.org:2710&tr=http://retracker.local/announce

I get error: Invalid argument

JajaComp avatar Sep 20 '18 23:09 JajaComp

@JajaComp what version of TRGUI?

leonsoft-kras avatar Sep 21 '18 14:09 leonsoft-kras

@JajaComp what version of TRGUI?

5.15.4 Build 16fe466 Tramsmission version: 2.94

JajaComp avatar Sep 21 '18 14:09 JajaComp

Yes, that's right. I have a newer version. Your problem is gone. We need to build version 5.15

leonsoft-kras avatar Sep 21 '18 14:09 leonsoft-kras

Yes, that's right. I have a newer version. Your problem is gone. We need to build version 5.15

When release?

JajaComp avatar Sep 21 '18 14:09 JajaComp

So, I'm unsure if this represents the same issue, but creating a torrent, and then seeding from my own files, caused an error not reading filenames with a : This is in a daemon-gui setup where both are Archlinux (actually same machine), I can't tell if just an gui error, but the torrent ended up being incomplete.

Gfurst avatar Dec 03 '20 18:12 Gfurst