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

Error: Unable to save resume file: File name too long #122

Closed
one-quaker opened this issue Dec 19, 2016 · 77 comments
Closed

Error: Unable to save resume file: File name too long #122

one-quaker opened this issue Dec 19, 2016 · 77 comments

Comments

@one-quaker
Copy link

one-quaker commented Dec 19, 2016

If I try add magnet link via transmission-daemon web-interface - I got error "Error: Unable to save resume file: File name too long".
If I add torrent file, all ok.
Deluge torrent client works fine with same magnet link.
I think problem in long name of temporary torrent file, who made from magnet link.

OS: Linux (raspbian arm32), Transmission-2.92 (2.84 have same problem), FS: Ext4

[censored]

Magnet link for test: [censored]

@one-quaker
Copy link
Author

How you can reproduce bug if magnet link deleted?

@mikedld
Copy link
Member

mikedld commented Jan 2, 2017

That's a good question. Suppose the link should've pointed to legal content in the first place...

@cfpp2p
Copy link

cfpp2p commented Jan 4, 2017

magnet:?xt=urn:btih:0403fb4728bd788fbcb67e87d6feb241ef38c75a&dn=ubuntu-16.10-desktop-amd64.iso-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long-this-name-is-too-long&tr=http%3A%2F%2Ftorrent.ubuntu.com%3A6969%2Fannounce&tr=http%3A%2F%2Fipv6.torrent.ubuntu.com%3A6969%2Fannounce

@one-quaker
Copy link
Author

one-quaker commented Jan 4, 2017

This magnet link have same problem. Thank you cfpp2p
screenshot

@coffebar
Copy link

coffebar commented Jan 7, 2017

"Error: Unable to save resume file: File name too long" is a popular problem for me.
I can't download some files with transmission, but with utorrent I can download same files to the same location (via virtual machine with windows and shared folder).

Will be fixed?

@coffebar
Copy link

coffebar commented Jan 16, 2017

What tool? How to use?
uTorrent saves this file in windows to same location without any problems, why transmission can't?

@one-quaker
Copy link
Author

And deluge saves without any problems. Why transmission? - it's a good question

@cfpp2p
Copy link

cfpp2p commented Jan 16, 2017

As in my example above (#122 (comment)) you could just text edit manually the name portion of any magnet (begins with &dn=) down to a short(er) length. Or you can patch metainfo.c at maybe get the display name. It's only a temporary display name until the real metadata is acquired.

          /* maybe get the display name */
          if (tr_variantDictFindStr (d, TR_KEY_display_name, &str, &len))
            {
              tr_free (inf->name);
              tr_free (inf->originalName);
              if (len > 50)
                {
                  inf->name = tr_strndup (str, 50);
                  inf->originalName = tr_strndup (str, 50);
                }
              else
                {
                 inf->name = tr_strndup (str, len);
                 inf->originalName = tr_strndup (str, len);
                }
            }

ref: cfpp2p/transmission@bf1d8bb#diff-d54a64807eeb84d2c1ffec36a2dd76c1

@v6
Copy link

v6 commented Mar 4, 2017

// , I can confirm I have this, too.

image

@pik
Copy link

pik commented Apr 29, 2017

Same issue, I don't seem to be able to rename the file on opening a magnet-link (properly this error should prompt for a rename or something of the like?)

@v6
Copy link

v6 commented May 1, 2017

// , Has anyone tested the work around that @cfpp2p proposed?

@cfpp2p
Copy link

cfpp2p commented May 8, 2017

@v6 It is and has been working perfectly for me without issue.

@pabloab
Copy link

pabloab commented Jun 5, 2017

I'm wrong or this bug was here since 2011?

@pik
Copy link

pik commented Jun 5, 2017

I believe this might happen due to use of non-standar encodings such as KOI8R in the torrent name.

@apolukhin
Copy link

This issue happens annoyingly often. Are there any plans to fix it?

@v6
Copy link

v6 commented Jul 7, 2017 via email

@kov-serg
Copy link

kov-serg commented Jul 24, 2017

I have the same problem today on my Ubuntu 14.04.
I have to find out reason. So get source
mkdir tr && cd tr
apt-get source transmission-gtk
And find error grep 'Unable to save resume file' -R .
Error message is in transmission-2.82/libtransmission/resume.c

  filename = getResumeFilename (tor);
  if ((err = tr_variantToFile (&top, TR_VARIANT_FMT_BENC, filename)))
    tr_torrentSetLocalError (tor, "Unable to save resume file: %s", tr_strerror (err));

It calls getResumeFilename from the same file

static char*
getResumeFilename (const tr_torrent * tor)
{
  char * base = tr_metainfoGetBasename (tr_torrentInfo (tor));
  char * filename = tr_strdup_printf ("%s" TR_PATH_DELIMITER_STR "%s.resume",
                                      tr_getResumeDir (tor->session), base);
  tr_free (base);
  return filename;
}

So the solution is to modify tr_metainfoGetBasename

let modify file transmission-2.82/libtransmission/metainfo.c
from

char*
tr_metainfoGetBasename (const tr_info * inf)
{
  size_t i;
  const char * name = inf->originalName;
  const size_t name_len = strlen (name);
  char * ret = tr_strdup_printf ("%s.%16.16s", name, inf->hashString);

  for (i=0; i<name_len; ++i)
    if (ret[i] == '/')
      ret[i] = '_';

  return ret;
}

to

char*
tr_metainfoGetBasename (const tr_info * inf)
{
  size_t i;
  enum { name_max=32 }; char name[name_max+1];
  const char * full_name;
  size_t name_len;
  char *ret;
  
  full_name = inf->originalName;
  name_len = 0;

  for(i=0;;i++) {
  	char c=full_name[i]; if (!c) { if (i<=name_max) name_len=i; break; }
  	if ((c&0xC0)==0xC0 || ((c&0x80)==0)) { if (i>name_max) break; name_len=i; }
  }
  memcpy(name,full_name,name_len);name[name_len]=0;

  ret = tr_strdup_printf ("%s.%16.16s", name, inf->hashString);

  for (i=0; i<name_len; ++i)
    if (ret[i] == '/')
      ret[i] = '_';

  return ret;
}

I assume utf8 encoding. This limit internal names to 32+17 chars or about. Limit is defined in name_max constant.
then ./configure && make
You can test it running from transmission-2.82/gtk/transmission-gtk
But you have to remove ~/.config/transmission directory or convert names into new scheeme.
Now it downloads any file without problems.

@pabloab
Copy link

pabloab commented Jul 24, 2017

Hi @kov-serg,
v2.82 of Ubuntu 14.04 is pretty old. Seems you are talking about this lines on master branch. Could you please made a pull request against current source code? Or at least attach a patch file to this issue. Probably this could improve chances of having tested and added to the main source branch.
Thanks!

@kov-serg
Copy link

kov-serg commented Jul 24, 2017

Ununtu 14.04 is work well and I see no reasons to change it on something else.
Here is git diff

diff --git a/libtransmission/metainfo.c b/libtransmission/metainfo.c
index 51b0659..df2b6e7 100644
--- a/libtransmission/metainfo.c
+++ b/libtransmission/metainfo.c
@@ -38,11 +38,24 @@ static inline bool char_is_path_separator(char c)
 
 char* tr_metainfoGetBasename(tr_info const* inf)
 {
-    char const* name = inf->originalName;
-    size_t const name_len = strlen(name);
-    char* ret = tr_strdup_printf("%s.%16.16s", name, inf->hashString);
+    size_t i;
+    enum { name_max=32 }; char name[name_max+1];
+    const char * full_name;
+    size_t name_len;
+    char *ret;
+
+    full_name = inf->originalName;
+    name_len = 0;
+
+    for(i=0;;i++) {
+        char c=full_name[i]; if (!c) { if (i<=name_max) name_len=i; break; }
+        if ((c&0xC0)==0xC0 || ((c&0x80)==0)) { if (i>name_max) break; name_len=i; }
+    }
+    memcpy(name,full_name,name_len);name[name_len]=0;
+
+    ret = tr_strdup_printf ("%s.%16.16s", name, inf->hashString);
 
-    for (size_t i = 0; i < name_len; ++i)
+    for (i = 0; i < name_len; ++i)
     {
         if (char_is_path_separator(ret[i]))
         {

I have no idea how to make pull request without forking
Script to get patch and build transmission from source https://pastebin.com/raw/EWFiuv23
It takes one minute and about 96Mb to build.
Here is link to torrent file that cause the problem ( original http://nnm-club.name/forum/viewtopic.php?p=6130608 copy https://cloud.mail.ru/public/FNV1/zNzh1ncJJ )
It could be used for testing.

ps: Updated build script https://pastebin.com/raw/kGH8UFHi
It takes 37 seconds and 88Mb to build and fetch version with fixed date Jul 22, 2017.

@kov-serg
Copy link

kov-serg commented Jul 24, 2017

here is script to convert old ~/.config/transmission files
In ~/.config/transmission directory
conv.lua

#!/usr/bin/lua

function short_name(fn)
	local function short(s,n)
		local i,j,c
		j=1 i=1 while i<=#s do c=s:byte(i)
			if c<128 or c>=192 then if i-1>n then break end j=i end
			i=i+1
		end
		if i>#s then j=i end
		return s:sub(1,j-1)
	end
	local path,name,hash_ext = fn:match "^(.*/)([^/]*)(%.%x+%.%w+)$"
	if not path then return fn end
	name=short(name,32)
	return path..name..hash_ext
end

function safe(s) return s:gsub('[`"]','\\%1') end

while true do
	local name=io.read() if not name then break end
	local short=short_name(name)
	if name~=short then 
		print('mv "'..safe(name)..'" "'..safe(short)..'"') 
	end
end
find | lua conv.lua > rename-script.sh

and then bash rename-script.sh

@cfpp2p
Copy link

cfpp2p commented Jul 25, 2017

We don't need to filter the torrent name for Cyrillic characters or such. The name length should only be limited to 255. This way we won't need to convert .config files. Tested with @kov-serg Zelezko2009.torrent (and others).

#define MAX_NAME_LENGTH 219
// 219 + 36 = 255
// . + 16_byte_hash + .torrent + .tmp.XXXXXX = 36 bytes
// . + 16_byte_hash + .resume + .tmp.XXXXXX = 35 bytes
// see tr_variantToFile() for more explanation

char* tr_metainfoGetBasename(tr_info const* inf)
{
    char const* name = inf->originalName;
    char* shortName;

    if (!strlen(name))
    {
        // allow empty name -- substitute
        shortName = tr_strdup("Hash-Name-");
    }
    else if (strlen(name) <= MAX_NAME_LENGTH)
    {
        shortName = tr_strdup(name);
    }
    else
    {
        // truncate
        shortName = tr_strndup(name, MAX_NAME_LENGTH);
    }

    char* ret = tr_strdup_printf("%s.%16.16s", shortName, inf->hashString);
    size_t const name_len = strlen(shortName);
    tr_free(shortName);

    for (size_t i = 0; i < name_len; ++i)
    {
        if (char_is_path_separator(ret[i]))
        {
            ret[i] = '_';
        }
    }

    return ret;
}

@kov-serg
Copy link

kov-serg commented Jul 25, 2017

Yes you need or it could split unicode symbol that presented with several bytes. Not only cyrilic (кирилица) but also japanise (日本語の文字) characters could be in names especially in anime torrents. So you have to split symbols correctly. For example single character 本 represented by 3 bytes (0xE6,0x9C,0xAC) and if you get only 2 bytes you will have invalid utf8 string. https://pastebin.com/raw/mLzvjtDn ( man 7 utf-8 )

You can set name_max to 219 but I see no reason to have such long names. I use 32 because it looks sufficient in mc.
There is a hash and name could be removed at all. But it could help if you try to find something by hands (but I see no one try). You may create special function to shorten names and convert them into something short but you have create something to migrate from old version to new and backward.

cfpp2p pushed a commit to cfpp2p/transmission that referenced this issue Jul 25, 2017
cfpp2p pushed a commit to cfpp2p/transmission that referenced this issue Jul 25, 2017
@cfpp2p
Copy link

cfpp2p commented Jul 25, 2017

Truncating like this may not display as pretty as it could, but there will only be a single split symbol just before the hash string for the both the .resume file and transmission's internal .torrent copy. Transmission will process these torrents without issue. We don't need to convert because the only torrents truncated are those that wouldn't have saved .torrent or .resume previously because of the file-name too long issue.

@kov-serg
Copy link

kov-serg commented Jul 25, 2017

Why you don't want to split correctly. It will work with transmission but may cause problems in other applications. Do you really want this?

@cfpp2p
Copy link

cfpp2p commented Jul 26, 2017

@kov-serg OK with you?, tr_utf8clean(). Set the MAX_NAME_LENGTH as you wish. Please test for your liking.

#define MAX_NAME_LENGTH 219
// 219 + 36 = 255
// . + 16_byte_hash + .torrent + .tmp.XXXXXX = 36 bytes
// . + 16_byte_hash + .resume + .tmp.XXXXXX = 35 bytes
// see tr_variantToFile() for more explanation

char* tr_metainfoGetBasename(tr_info const* inf)
{
    char const* name = inf->originalName;
    char* shortName;
    char* cleanName;

    if (!strlen(name))
    {
        // allow empty name -- substitute
        cleanName = tr_strdup("Hash-Name-");
    }
    else if (strlen(name) <= MAX_NAME_LENGTH)
    {
        cleanName = tr_strdup(name);
    }
    else
    {
        // truncate
        shortName = tr_strndup(name, MAX_NAME_LENGTH);
        cleanName = tr_utf8clean(shortName, -1);
    }
    tr_free(shortName);

    char* ret = tr_strdup_printf("%s.%16.16s", cleanName, inf->hashString);
    size_t const name_len = strlen(cleanName);
    tr_free(cleanName);

    for (size_t i = 0; i < name_len; ++i)
    {
        if (char_is_path_separator(ret[i]))
        {
            ret[i] = '_';
        }
    }

    return ret;
}

@smopucilowski
Copy link

Hit this bug last night.

@kov-serg
Copy link

kov-serg commented Aug 2, 2019

What transmission version? And what files in names in config dir
linux: find ~/.config/transmission
windows: dir /s /b "%appdata%/transmission"

@pgorod
Copy link

pgorod commented Aug 2, 2019

This magnet link fails for me on Windows with version 2.94

magnet:?xt=urn:btih:8ED644946AA19DFB4E4DC58C407B2B0CAA24D82B&dn=%5Bzooqle.com%5D%20Avengers%3A%20Endgame%20%282019%29%20%5BBluRay%5D%20%5B1080p%5D%20%5BYTS.LT%5D&tr=http://explodie.org:6969/announce&tr=http://announce.xxx-tracker.com:2710/announce&tr=https://bigfoot1942.sektori.org/announce&tr=https://bigfoot1942.sektori.org:443/announce&tr=http://open.acgtracker.com:1096/announce&xl=1686660690&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=http%3A%2F%2Fannounce.xxx-tracker.com%3A2710%2Fannounce&tr=http%3A%2F%2Fexplodie.org%3A6969%2Fannounce&tr=https%3A%2F%2Fbigfoot1942.sektori.org%2Fannounce&tr=https%3A%2F%2Fbigfoot1942.sektori.org%3A443%2Fannounce

I guess it's the colon in the name...

I saw a zero-length file in AppData\Local\transmission\Torrents called [zooqle.com] Avengers. The same filename is found in the resume directory, also with 0 bytes.

The error message on the UI said Error: Unable to save resume file: unknown error

I hope this helps debugging. Thanks.

@kov-serg
Copy link

kov-serg commented Aug 3, 2019

It is simple in 2.9x branch no fix applied https://github.com/transmission/transmission/blob/2.9x/libtransmission/metainfo.c or https://github.com/transmission/transmission-releases/raw/master/transmission-2.94.tar.xz
char* tr_metainfoGetBasename (const tr_info * inf) - is unchanged and contains this problem.

Why version with this problem is default for download this is the question.

So you have to use night build. https://build.transmissionbt.com/job/trunk-win32/
There is new version with char* tr_metainfoGetBasename(tr_info const* inf, enum tr_metainfo_basename_format format)

@Queuecumber
Copy link

It looks like the 3.0 release will probably never happen, is anyone even maintaining this anymore?

@dausruddin
Copy link

@Queuecumber maybe they are busy.
I compiled the program by myself and included some PR.
Currently it is running well excep that I have to use Web-UI from 2.94 because Web-Ui from 3.00 due to bugs.

At this point I would probably migrate to qBittorrent.

@gomera
Copy link

gomera commented Nov 5, 2019

@Queuecumber maybe they are busy.
I compiled the program by myself and included some PR.
Currently it is running well excep that I have to use Web-UI from 2.94 because Web-Ui from 3.00 due to bugs.

At this point I would probably migrate to qBittorrent.

@dausruddin I've been using qBittorrent for the last 3 months and I am more than happy with it. Who knows, maybe in the future I will give transmission another chance.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jul 13, 2020
### All Platforms
- Allow the RPC server to listen on an IPv6 address ([#161](transmission/transmission#161))
- Change `TR_CURL_SSL_VERIFY` to `TR_CURL_SSL_NO_VERIFY` and enable verification by default ([#334](transmission/transmission#334))
- Go back to using hash as base name for resume and torrent files (those stored in configuration directory) ([#122](transmission/transmission#122))
- Handle "fields" argument in "session-get" RPC request; if "fields" array is present in arguments, only return session fields specified; otherwise return all the fields as before
- Limit the number of incorrect authentication attempts in embedded web server to 100 to prevent brute-force attacks ([#371](transmission/transmission#371))
- Set idle seed limit range to 1..40320 (4 weeks tops) in all clients ([#212](transmission/transmission#212))
- Add Peer ID for Xfplay, PicoTorrent, Free Download Manager, Folx, Baidu Netdisk torrent clients ([#256](transmission/transmission#256), [#285](transmission/transmission#285), [#355](transmission/transmission#355), [#363](transmission/transmission#363), [#386](transmission/transmission#386))
- Announce `INT64_MAX` as size left if the value is unknown (helps with e.g. Amazon S3 trackers) ([#250](transmission/transmission#250))
- Add `TCP_FASTOPEN` support (should result in slight speedup) ([#184](transmission/transmission#184))
- Improve ToS handling on IPv6 connections ([#128](transmission/transmission#128), [#341](transmission/transmission#341), [#360](transmission/transmission#360), [#692](transmission/transmission#692), [#737](transmission/transmission#737))
- Abort handshake if establishing DH shared secret fails (leads to crash) ([#27](transmission/transmission#27))
- Don't switch trackers while announcing (leads to crash) ([#297](transmission/transmission#297))
- Improve completion scripts execution and error handling; add support for .cmd and .bat files on Windows ([#405](transmission/transmission#405))
- Maintain a "session ID" file (in temporary directory) to better detect whether session is local or remote; return the ID as part of "session-get" response (TRAC-5348, [#861](transmission/transmission#861))
- Change torrent location even if no data move is needed ([#35](transmission/transmission#35))
- Support CIDR-notated blocklists ([#230](transmission/transmission#230), [#741](transmission/transmission#741))
- Update the resume file before running scripts ([#825](transmission/transmission#825))
- Make multiscrape limits adaptive ([#837](transmission/transmission#837))
- Add labels support to libtransmission and transmission-remote ([#822](transmission/transmission#822))
- Parse `session-id` header case-insensitively ([#765](transmission/transmission#765))
- Sanitize suspicious path components instead of rejecting them ([#62](transmission/transmission#62), [#294](transmission/transmission#294))
- Load CA certs from system store on Windows / OpenSSL ([#446](transmission/transmission#446))
- Add support for mbedtls (formely polarssl) and wolfssl (formely cyassl), LibreSSL ([#115](transmission/transmission#115), [#116](transmission/transmission#116), [#284](transmission/transmission#284), [#486](transmission/transmission#486), [#524](transmission/transmission#524), [#570](transmission/transmission#570))
- Fix building against OpenSSL 1.1.0+ ([#24](transmission/transmission#24))
- Fix quota support for uClibc-ng 1.0.18+ and DragonFly BSD ([#42](transmission/transmission#42), [#58](transmission/transmission#58), [#312](transmission/transmission#312))
- Fix a number of memory leaks (magnet loading, session shutdown, bencoded data parsing) ([#56](transmission/transmission#56))
- Bump miniupnpc version to 2.0.20170509 ([#347](transmission/transmission#347))
- CMake-related improvements (Ninja generator, libappindicator, systemd, Solaris and macOS) ([#72](transmission/transmission#72), [#96](transmission/transmission#96), [#117](transmission/transmission#117), [#118](transmission/transmission#118), [#133](transmission/transmission#133), [#191](transmission/transmission#191))
- Switch to submodules to manage (most of) third-party dependencies
- Fail installation on Windows if UCRT is not installed

### Mac Client
- Bump minimum macOS version to 10.10
- Dark Mode support ([#644](transmission/transmission#644), [#722](transmission/transmission#722), [#757](transmission/transmission#757), [#779](transmission/transmission#779), [#788](transmission/transmission#788))
- Remove Growl support, notification center is always used ([#387](transmission/transmission#387))
- Fix autoupdate on High Sierra and up by bumping the Sparkle version ([#121](transmission/transmission#121), [#600](transmission/transmission#600))
- Transition to ARC ([#336](transmission/transmission#336))
- Use proper UTF-8 encoding (with macOS-specific normalization) when setting download/incomplete directory and completion script paths ([#11](transmission/transmission#11))
- Fix uncaught exception when dragging multiple items between groups ([#51](transmission/transmission#51))
- Add flat variants of status icons for message log ([#134](transmission/transmission#134))
- Optimize image resources size ([#304](transmission/transmission#304), [#429](transmission/transmission#429))
- Update file icon when file name changes ([#37](transmission/transmission#37))
- Update translations

### GTK+ Client
- Add queue up/down hotkeys ([#158](transmission/transmission#158))
- Modernize the .desktop file ([#162](transmission/transmission#162))
- Add AppData file ([#224](transmission/transmission#224))
- Add symbolic icon variant for the Gnome top bar and when the high contrast theme is in use ([#414](transmission/transmission#414), [#449](transmission/transmission#449))
- Update file icon when its name changes ([#37](transmission/transmission#37))
- Switch from intltool to gettext for translations ([#584](transmission/transmission#584), [#647](transmission/transmission#647))
- Update translations, add new translations for Portuguese (Portugal)

### Qt Client
- Bump minimum Qt version to 5.2
- Fix dropping .torrent files into main window on Windows ([#269](transmission/transmission#269))
- Fix prepending of drive letter to various user-selected paths on Windows ([#236](transmission/transmission#236), [#307](transmission/transmission#307), [#404](transmission/transmission#404), [#437](transmission/transmission#437), [#699](transmission/transmission#699), [#723](transmission/transmission#723), [#877](transmission/transmission#877))
- Fix sorting by progress in presence of magnet transfers ([#234](transmission/transmission#234))
- Fix .torrent file trashing upon addition ([#262](transmission/transmission#262))
- Add queue up/down hotkeys ([#158](transmission/transmission#158))
- Reduce torrent properties (file tree) memory usage
- Display tooltips in torrent properties (file tree) in case the names don't fit ([#411](transmission/transmission#411))
- Improve UI look on hi-dpi displays (YMMV)
- Use session ID (if available) to check if session is local or not ([#861](transmission/transmission#861))
- Use default (instead of system) locale to be more flexible ([#130](transmission/transmission#130))
- Modernize the .desktop file ([#162](transmission/transmission#162))
- Update translations, add new translations for Afrikaans, Catalan, Danish, Greek, Norwegian Bokmål, Slovenian

### Daemon
- Use libsystemd instead of libsystemd-daemon (TRAC-5921)
- Harden transmission-daemon.service by disallowing privileges elevation ([#795](transmission/transmission#795))
- Fix exit code to be zero when dumping settings ([#487](transmission/transmission#487))

### Web Client
- Fix tracker error XSS in inspector (CVE-?)
- Fix performance issues due to improper use of `setInterval()` for UI refresh (TRAC-6031)
- Fix recognition of `https://` links in comments field ([#41](transmission/transmission#41), [#180](transmission/transmission#180))
- Fix torrent list style in Google Chrome 59+ ([#384](transmission/transmission#384))
- Show ETA in compact view on non-mobile devices ([#146](transmission/transmission#146))
- Show upload file button on mobile devices ([#320](transmission/transmission#320), [#431](transmission/transmission#431), [#956](transmission/transmission#956))
- Add keyboard hotkeys for web interface ([#351](transmission/transmission#351))
- Disable autocompletion in torrent URL field ([#367](transmission/transmission#367))

### Utils
- Prevent crash in transmission-show displaying torrents with invalid creation date ([#609](transmission/transmission#609))
- Handle IPv6 RPC addresses in transmission-remote ([#247](transmission/transmission#247))
- Add `--unsorted` option to transmission-show ([#767](transmission/transmission#767))
- Widen the torrent-id column in transmission-remote for cleaner formatting ([#840](transmission/transmission#840))
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Aug 3, 2020
net/transmission-gtk: security update
net/transmission-qt: security update
net/transmission: security update

Revisions pulled up:
- net/transmission-gtk/Makefile                                 1.46
- net/transmission-gtk/PLIST                                    1.2
- net/transmission-qt/Makefile                                  1.54
- net/transmission/Makefile                                     1.27
- net/transmission/Makefile.common                              1.10
- net/transmission/PLIST                                        1.4
- net/transmission/distinfo                                     1.16
- net/transmission/patches/patch-qt_qtr.pro                     1.7

-------------------------------------------------------------------
   Module Name:	pkgsrc
   Committed By:	wiz
   Date:		Mon Jul 13 13:01:02 UTC 2020

   Modified Files:
   	pkgsrc/net/transmission: Makefile Makefile.common PLIST distinfo
   	pkgsrc/net/transmission-gtk: Makefile PLIST
   	pkgsrc/net/transmission-qt: Makefile
   	pkgsrc/net/transmission/patches: patch-qt_qtr.pro

   Log Message:
   transmission*: update to 3.00

   ### All Platforms
   - Allow the RPC server to listen on an IPv6 address ([#161](transmission/transmission#161))
   - Change `TR_CURL_SSL_VERIFY` to `TR_CURL_SSL_NO_VERIFY` and enable verification by default ([#334](transmission/transmission#334))
   - Go back to using hash as base name for resume and torrent files (those stored in configuration directory) ([#122](transmission/transmission#122))
   - Handle "fields" argument in "session-get" RPC request; if "fields" array is present in arguments, only return session fields specified; otherwise return all the fields as before
   - Limit the number of incorrect authentication attempts in embedded web server to 100 to prevent brute-force attacks ([#371](transmission/transmission#371))
   - Set idle seed limit range to 1..40320 (4 weeks tops) in all clients ([#212](transmission/transmission#212))
   - Add Peer ID for Xfplay, PicoTorrent, Free Download Manager, Folx, Baidu Netdisk torrent clients ([#256](transmission/transmission#256), [#285](transmission/transmission#285), [#355](transmission/transmission#355), [#363](transmission/transmission#363), [#386](transmission/transmission#386))
   - Announce `INT64_MAX` as size left if the value is unknown (helps with e.g. Amazon S3 trackers) ([#250](transmission/transmission#250))
   - Add `TCP_FASTOPEN` support (should result in slight speedup) ([#184](transmission/transmission#184))
   - Improve ToS handling on IPv6 connections ([#128](transmission/transmission#128), [#341](transmission/transmission#341), [#360](transmission/transmission#360), [#692](transmission/transmission#692), [#737](transmission/transmission#737))
   - Abort handshake if establishing DH shared secret fails (leads to crash) ([#27](transmission/transmission#27))
   - Don't switch trackers while announcing (leads to crash) ([#297](transmission/transmission#297))
   - Improve completion scripts execution and error handling; add support for .cmd and .bat files on Windows ([#405](transmission/transmission#405))
   - Maintain a "session ID" file (in temporary directory) to better detect whether session is local or remote; return the ID as part of "session-get" response (TRAC-5348, [#861](transmission/transmission#861))
   - Change torrent location even if no data move is needed ([#35](transmission/transmission#35))
   - Support CIDR-notated blocklists ([#230](transmission/transmission#230), [#741](transmission/transmission#741))
   - Update the resume file before running scripts ([#825](transmission/transmission#825))
   - Make multiscrape limits adaptive ([#837](transmission/transmission#837))
   - Add labels support to libtransmission and transmission-remote ([#822](transmission/transmission#822))
   - Parse `session-id` header case-insensitively ([#765](transmission/transmission#765))
   - Sanitize suspicious path components instead of rejecting them ([#62](transmission/transmission#62), [#294](transmission/transmission#294))
   - Load CA certs from system store on Windows / OpenSSL ([#446](transmission/transmission#446))
   - Add support for mbedtls (formely polarssl) and wolfssl (formely cyassl), LibreSSL ([#115](transmission/transmission#115), [#116](transmission/transmission#116), [#284](transmission/transmission#284), [#486](transmission/transmission#486), [#524](transmission/transmission#524), [#570](transmission/transmission#570))
   - Fix building against OpenSSL 1.1.0+ ([#24](transmission/transmission#24))
   - Fix quota support for uClibc-ng 1.0.18+ and DragonFly BSD ([#42](transmission/transmission#42), [#58](transmission/transmission#58), [#312](transmission/transmission#312))
   - Fix a number of memory leaks (magnet loading, session shutdown, bencoded data parsing) ([#56](transmission/transmission#56))
   - Bump miniupnpc version to 2.0.20170509 ([#347](transmission/transmission#347))
   - CMake-related improvements (Ninja generator, libappindicator, systemd, Solaris and macOS) ([#72](transmission/transmission#72), [#96](transmission/transmission#96), [#117](transmission/transmission#117), [#118](transmission/transmission#118), [#133](transmission/transmission#133), [#191](transmission/transmission#191))
   - Switch to submodules to manage (most of) third-party dependencies
   - Fail installation on Windows if UCRT is not installed

   ### Mac Client
   - Bump minimum macOS version to 10.10
   - Dark Mode support ([#644](transmission/transmission#644), [#722](transmission/transmission#722), [#757](transmission/transmission#757), [#779](transmission/transmission#779), [#788](transmission/transmission#788))
   - Remove Growl support, notification center is always used ([#387](transmission/transmission#387))
   - Fix autoupdate on High Sierra and up by bumping the Sparkle version ([#121](transmission/transmission#121), [#600](transmission/transmission#600))
   - Transition to ARC ([#336](transmission/transmission#336))
   - Use proper UTF-8 encoding (with macOS-specific normalization) when setting download/incomplete directory and completion script paths ([#11](transmission/transmission#11))
   - Fix uncaught exception when dragging multiple items between groups ([#51](transmission/transmission#51))
   - Add flat variants of status icons for message log ([#134](transmission/transmission#134))
   - Optimize image resources size ([#304](transmission/transmission#304), [#429](transmission/transmission#429))
   - Update file icon when file name changes ([#37](transmission/transmission#37))
   - Update translations

   ### GTK+ Client
   - Add queue up/down hotkeys ([#158](transmission/transmission#158))
   - Modernize the .desktop file ([#162](transmission/transmission#162))
   - Add AppData file ([#224](transmission/transmission#224))
   - Add symbolic icon variant for the Gnome top bar and when the high contrast theme is in use ([#414](transmission/transmission#414), [#449](transmission/transmission#449))
   - Update file icon when its name changes ([#37](transmission/transmission#37))
   - Switch from intltool to gettext for translations ([#584](transmission/transmission#584), [#647](transmission/transmission#647))
   - Update translations, add new translations for Portuguese (Portugal)

   ### Qt Client
   - Bump minimum Qt version to 5.2
   - Fix dropping .torrent files into main window on Windows ([#269](transmission/transmission#269))
   - Fix prepending of drive letter to various user-selected paths on Windows ([#236](transmission/transmission#236), [#307](transmission/transmission#307), [#404](transmission/transmission#404), [#437](transmission/transmission#437), [#699](transmission/transmission#699), [#723](transmission/transmission#723), [#877](transmission/transmission#877))
   - Fix sorting by progress in presence of magnet transfers ([#234](transmission/transmission#234))
   - Fix .torrent file trashing upon addition ([#262](transmission/transmission#262))
   - Add queue up/down hotkeys ([#158](transmission/transmission#158))
   - Reduce torrent properties (file tree) memory usage
   - Display tooltips in torrent properties (file tree) in case the names don't fit ([#411](transmission/transmission#411))
   - Improve UI look on hi-dpi displays (YMMV)
   - Use session ID (if available) to check if session is local or not ([#861](transmission/transmission#861))
   - Use default (instead of system) locale to be more flexible ([#130](transmission/transmission#130))
   - Modernize the .desktop file ([#162](transmission/transmission#162))
   - Update translations, add new translations for Afrikaans, Catalan, Danish, Greek, Norwegian Bokmål, Slovenian

   ### Daemon
   - Use libsystemd instead of libsystemd-daemon (TRAC-5921)
   - Harden transmission-daemon.service by disallowing privileges elevation ([#795](transmission/transmission#795))
   - Fix exit code to be zero when dumping settings ([#487](transmission/transmission#487))

   ### Web Client
   - Fix tracker error XSS in inspector (CVE-?)
   - Fix performance issues due to improper use of `setInterval()` for UI refresh (TRAC-6031)
   - Fix recognition of `https://` links in comments field ([#41](transmission/transmission#41), [#180](transmission/transmission#180))
   - Fix torrent list style in Google Chrome 59+ ([#384](transmission/transmission#384))
   - Show ETA in compact view on non-mobile devices ([#146](transmission/transmission#146))
   - Show upload file button on mobile devices ([#320](transmission/transmission#320), [#431](transmission/transmission#431), [#956](transmission/transmission#956))
   - Add keyboard hotkeys for web interface ([#351](transmission/transmission#351))
   - Disable autocompletion in torrent URL field ([#367](transmission/transmission#367))

   ### Utils
   - Prevent crash in transmission-show displaying torrents with invalid creation date ([#609](transmission/transmission#609))
   - Handle IPv6 RPC addresses in transmission-remote ([#247](transmission/transmission#247))
   - Add `--unsorted` option to transmission-show ([#767](transmission/transmission#767))
   - Widen the torrent-id column in transmission-remote for cleaner formatting ([#840](transmission/transmission#840))


   To generate a diff of this commit:
   cvs rdiff -u -r1.26 -r1.27 pkgsrc/net/transmission/Makefile
   cvs rdiff -u -r1.9 -r1.10 pkgsrc/net/transmission/Makefile.common
   cvs rdiff -u -r1.3 -r1.4 pkgsrc/net/transmission/PLIST
   cvs rdiff -u -r1.15 -r1.16 pkgsrc/net/transmission/distinfo
   cvs rdiff -u -r1.45 -r1.46 pkgsrc/net/transmission-gtk/Makefile
   cvs rdiff -u -r1.1 -r1.2 pkgsrc/net/transmission-gtk/PLIST
   cvs rdiff -u -r1.52 -r1.53 pkgsrc/net/transmission-qt/Makefile
   cvs rdiff -u -r1.6 -r1.7 pkgsrc/net/transmission/patches/patch-qt_qtr.pro
-------------------------------------------------------------------
   Module Name:    pkgsrc
   Committed By:   wiz
   Date:           Sat Jul 25 20:20:05 UTC 2020

   Modified Files:
           pkgsrc/net/transmission-qt: Makefile

   Log Message:
   transmission-qt: needs gcc 7.x (for <optional>)

   Reported and tested by spz.


   To generate a diff of this commit:
   cvs rdiff -u -r1.53 -r1.54 pkgsrc/net/transmission-qt/Makefile
@diman82
Copy link

diman82 commented Sep 5, 2020

As in my example above (#122 (comment)) you could just text edit manually the name portion of any magnet (begins with &dn=) down to a short(er) length. Or you can patch metainfo.c at maybe get the display name. It's only a temporary display name until the real metadata is acquired.

          /* maybe get the display name */
          if (tr_variantDictFindStr (d, TR_KEY_display_name, &str, &len))
            {
              tr_free (inf->name);
              tr_free (inf->originalName);
              if (len > 50)
                {
                  inf->name = tr_strndup (str, 50);
                  inf->originalName = tr_strndup (str, 50);
                }
              else
                {
                 inf->name = tr_strndup (str, len);
                 inf->originalName = tr_strndup (str, len);
                }
            }

ref: cfpp2p/transmission@bf1d8bb#diff-d54a64807eeb84d2c1ffec36a2dd76c1

Worked like a charm (problem is due to a very long Cyrillic description)

@luntik2012
Copy link

luntik2012 commented Jun 25, 2021

the same issue in 3.00 with magnet and torrent file

@appotry
Copy link

appotry commented Jul 23, 2021

this bug is not fixed!

Please fixed this bug!

master/libtransmission/metainfo.c

static char* metainfoGetBasenameNameAndPartialHash(tr_info const* inf)
{
    char const* name = inf->originalName;
    size_t const name_len = strlen(name);
    char* ret = tr_strdup_printf("%s.%16.16s", name, inf->hashString);

    for (size_t i = 0; i < name_len; ++i)
    {
        if (char_is_path_separator(ret[i]))
        {
            ret[i] = '_';
        }
    }

    return ret;
}

@ldesousa
Copy link

Having this issue with transmission-daemon 2.94 on Ubuntu 20.04. The issue was closed in 2017, prior to the 2.94 release. Was the fix not included in that release? Could someone please clarify? Thank you.

FYI @mikedld

@mikedld
Copy link
Member

mikedld commented Aug 12, 2021

@ldesousa, milestone is set to 3.00.

@ldesousa
Copy link

@mikedld I just upgraded transmission-daemon to release 3.00. However the error remains and transmission is still unable to resume the download. I installed from the transmission PPA for Ubuntu:

$ apt policy transmission-daemon
transmission-daemon:
  Installed: 3.00-1ubuntu1~20.04.1
  Candidate: 3.00-1ubuntu1~20.04.1
  Version table:
 *** 3.00-1ubuntu1~20.04.1 500
        500 http://ppa.launchpad.net/transmissionbt/ppa/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status
     2.94-2ubuntu3 500
        500 http://fr.archive.ubuntu.com/ubuntu focal/universe amd64 Packages

Could there be something wrong with the release available from this PPA?

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Oct 14, 2021
net/transmission-gtk: security update
net/transmission-qt: security update
net/transmission: security update

Revisions pulled up:
- net/transmission-gtk/Makefile                                 1.46
- net/transmission-gtk/PLIST                                    1.2
- net/transmission-qt/Makefile                                  1.54
- net/transmission/Makefile                                     1.27
- net/transmission/Makefile.common                              1.10
- net/transmission/PLIST                                        1.4
- net/transmission/distinfo                                     1.16
- net/transmission/patches/patch-qt_qtr.pro                     1.7

-------------------------------------------------------------------
   Module Name:	pkgsrc
   Committed By:	wiz
   Date:		Mon Jul 13 13:01:02 UTC 2020

   Modified Files:
   	pkgsrc/net/transmission: Makefile Makefile.common PLIST distinfo
   	pkgsrc/net/transmission-gtk: Makefile PLIST
   	pkgsrc/net/transmission-qt: Makefile
   	pkgsrc/net/transmission/patches: patch-qt_qtr.pro

   Log Message:
   transmission*: update to 3.00

   ### All Platforms
   - Allow the RPC server to listen on an IPv6 address ([#161](transmission/transmission#161))
   - Change `TR_CURL_SSL_VERIFY` to `TR_CURL_SSL_NO_VERIFY` and enable verification by default ([#334](transmission/transmission#334))
   - Go back to using hash as base name for resume and torrent files (those stored in configuration directory) ([#122](transmission/transmission#122))
   - Handle "fields" argument in "session-get" RPC request; if "fields" array is present in arguments, only return session fields specified; otherwise return all the fields as before
   - Limit the number of incorrect authentication attempts in embedded web server to 100 to prevent brute-force attacks ([#371](transmission/transmission#371))
   - Set idle seed limit range to 1..40320 (4 weeks tops) in all clients ([#212](transmission/transmission#212))
   - Add Peer ID for Xfplay, PicoTorrent, Free Download Manager, Folx, Baidu Netdisk torrent clients ([#256](transmission/transmission#256), [#285](transmission/transmission#285), [#355](transmission/transmission#355), [#363](transmission/transmission#363), [#386](transmission/transmission#386))
   - Announce `INT64_MAX` as size left if the value is unknown (helps with e.g. Amazon S3 trackers) ([#250](transmission/transmission#250))
   - Add `TCP_FASTOPEN` support (should result in slight speedup) ([#184](transmission/transmission#184))
   - Improve ToS handling on IPv6 connections ([#128](transmission/transmission#128), [#341](transmission/transmission#341), [#360](transmission/transmission#360), [#692](transmission/transmission#692), [#737](transmission/transmission#737))
   - Abort handshake if establishing DH shared secret fails (leads to crash) ([#27](transmission/transmission#27))
   - Don't switch trackers while announcing (leads to crash) ([#297](transmission/transmission#297))
   - Improve completion scripts execution and error handling; add support for .cmd and .bat files on Windows ([#405](transmission/transmission#405))
   - Maintain a "session ID" file (in temporary directory) to better detect whether session is local or remote; return the ID as part of "session-get" response (TRAC-5348, [#861](transmission/transmission#861))
   - Change torrent location even if no data move is needed ([#35](transmission/transmission#35))
   - Support CIDR-notated blocklists ([#230](transmission/transmission#230), [#741](transmission/transmission#741))
   - Update the resume file before running scripts ([#825](transmission/transmission#825))
   - Make multiscrape limits adaptive ([#837](transmission/transmission#837))
   - Add labels support to libtransmission and transmission-remote ([#822](transmission/transmission#822))
   - Parse `session-id` header case-insensitively ([#765](transmission/transmission#765))
   - Sanitize suspicious path components instead of rejecting them ([#62](transmission/transmission#62), [#294](transmission/transmission#294))
   - Load CA certs from system store on Windows / OpenSSL ([#446](transmission/transmission#446))
   - Add support for mbedtls (formely polarssl) and wolfssl (formely cyassl), LibreSSL ([#115](transmission/transmission#115), [#116](transmission/transmission#116), [#284](transmission/transmission#284), [#486](transmission/transmission#486), [#524](transmission/transmission#524), [#570](transmission/transmission#570))
   - Fix building against OpenSSL 1.1.0+ ([#24](transmission/transmission#24))
   - Fix quota support for uClibc-ng 1.0.18+ and DragonFly BSD ([#42](transmission/transmission#42), [#58](transmission/transmission#58), [#312](transmission/transmission#312))
   - Fix a number of memory leaks (magnet loading, session shutdown, bencoded data parsing) ([#56](transmission/transmission#56))
   - Bump miniupnpc version to 2.0.20170509 ([#347](transmission/transmission#347))
   - CMake-related improvements (Ninja generator, libappindicator, systemd, Solaris and macOS) ([#72](transmission/transmission#72), [#96](transmission/transmission#96), [#117](transmission/transmission#117), [#118](transmission/transmission#118), [#133](transmission/transmission#133), [#191](transmission/transmission#191))
   - Switch to submodules to manage (most of) third-party dependencies
   - Fail installation on Windows if UCRT is not installed

   ### Mac Client
   - Bump minimum macOS version to 10.10
   - Dark Mode support ([#644](transmission/transmission#644), [#722](transmission/transmission#722), [#757](transmission/transmission#757), [#779](transmission/transmission#779), [#788](transmission/transmission#788))
   - Remove Growl support, notification center is always used ([#387](transmission/transmission#387))
   - Fix autoupdate on High Sierra and up by bumping the Sparkle version ([#121](transmission/transmission#121), [#600](transmission/transmission#600))
   - Transition to ARC ([#336](transmission/transmission#336))
   - Use proper UTF-8 encoding (with macOS-specific normalization) when setting download/incomplete directory and completion script paths ([#11](transmission/transmission#11))
   - Fix uncaught exception when dragging multiple items between groups ([#51](transmission/transmission#51))
   - Add flat variants of status icons for message log ([#134](transmission/transmission#134))
   - Optimize image resources size ([#304](transmission/transmission#304), [#429](transmission/transmission#429))
   - Update file icon when file name changes ([#37](transmission/transmission#37))
   - Update translations

   ### GTK+ Client
   - Add queue up/down hotkeys ([#158](transmission/transmission#158))
   - Modernize the .desktop file ([#162](transmission/transmission#162))
   - Add AppData file ([#224](transmission/transmission#224))
   - Add symbolic icon variant for the Gnome top bar and when the high contrast theme is in use ([#414](transmission/transmission#414), [#449](transmission/transmission#449))
   - Update file icon when its name changes ([#37](transmission/transmission#37))
   - Switch from intltool to gettext for translations ([#584](transmission/transmission#584), [#647](transmission/transmission#647))
   - Update translations, add new translations for Portuguese (Portugal)

   ### Qt Client
   - Bump minimum Qt version to 5.2
   - Fix dropping .torrent files into main window on Windows ([#269](transmission/transmission#269))
   - Fix prepending of drive letter to various user-selected paths on Windows ([#236](transmission/transmission#236), [#307](transmission/transmission#307), [#404](transmission/transmission#404), [#437](transmission/transmission#437), [#699](transmission/transmission#699), [#723](transmission/transmission#723), [#877](transmission/transmission#877))
   - Fix sorting by progress in presence of magnet transfers ([#234](transmission/transmission#234))
   - Fix .torrent file trashing upon addition ([#262](transmission/transmission#262))
   - Add queue up/down hotkeys ([#158](transmission/transmission#158))
   - Reduce torrent properties (file tree) memory usage
   - Display tooltips in torrent properties (file tree) in case the names don't fit ([#411](transmission/transmission#411))
   - Improve UI look on hi-dpi displays (YMMV)
   - Use session ID (if available) to check if session is local or not ([#861](transmission/transmission#861))
   - Use default (instead of system) locale to be more flexible ([#130](transmission/transmission#130))
   - Modernize the .desktop file ([#162](transmission/transmission#162))
   - Update translations, add new translations for Afrikaans, Catalan, Danish, Greek, Norwegian Bokmål, Slovenian

   ### Daemon
   - Use libsystemd instead of libsystemd-daemon (TRAC-5921)
   - Harden transmission-daemon.service by disallowing privileges elevation ([#795](transmission/transmission#795))
   - Fix exit code to be zero when dumping settings ([#487](transmission/transmission#487))

   ### Web Client
   - Fix tracker error XSS in inspector (CVE-?)
   - Fix performance issues due to improper use of `setInterval()` for UI refresh (TRAC-6031)
   - Fix recognition of `https://` links in comments field ([#41](transmission/transmission#41), [#180](transmission/transmission#180))
   - Fix torrent list style in Google Chrome 59+ ([#384](transmission/transmission#384))
   - Show ETA in compact view on non-mobile devices ([#146](transmission/transmission#146))
   - Show upload file button on mobile devices ([#320](transmission/transmission#320), [#431](transmission/transmission#431), [#956](transmission/transmission#956))
   - Add keyboard hotkeys for web interface ([#351](transmission/transmission#351))
   - Disable autocompletion in torrent URL field ([#367](transmission/transmission#367))

   ### Utils
   - Prevent crash in transmission-show displaying torrents with invalid creation date ([#609](transmission/transmission#609))
   - Handle IPv6 RPC addresses in transmission-remote ([#247](transmission/transmission#247))
   - Add `--unsorted` option to transmission-show ([#767](transmission/transmission#767))
   - Widen the torrent-id column in transmission-remote for cleaner formatting ([#840](transmission/transmission#840))


   To generate a diff of this commit:
   cvs rdiff -u -r1.26 -r1.27 pkgsrc/net/transmission/Makefile
   cvs rdiff -u -r1.9 -r1.10 pkgsrc/net/transmission/Makefile.common
   cvs rdiff -u -r1.3 -r1.4 pkgsrc/net/transmission/PLIST
   cvs rdiff -u -r1.15 -r1.16 pkgsrc/net/transmission/distinfo
   cvs rdiff -u -r1.45 -r1.46 pkgsrc/net/transmission-gtk/Makefile
   cvs rdiff -u -r1.1 -r1.2 pkgsrc/net/transmission-gtk/PLIST
   cvs rdiff -u -r1.52 -r1.53 pkgsrc/net/transmission-qt/Makefile
   cvs rdiff -u -r1.6 -r1.7 pkgsrc/net/transmission/patches/patch-qt_qtr.pro
-------------------------------------------------------------------
   Module Name:    pkgsrc
   Committed By:   wiz
   Date:           Sat Jul 25 20:20:05 UTC 2020

   Modified Files:
           pkgsrc/net/transmission-qt: Makefile

   Log Message:
   transmission-qt: needs gcc 7.x (for <optional>)

   Reported and tested by spz.


   To generate a diff of this commit:
   cvs rdiff -u -r1.53 -r1.54 pkgsrc/net/transmission-qt/Makefile
@imkyaky
Copy link

imkyaky commented Dec 30, 2021

after 5 years , problem still exists. Transmission 3.00 (bb6b5a0)
The real issue is about unicode converted length

image

@kov-serg
Copy link

kov-serg commented Jan 4, 2022

It's funny. I think it because there is no tests for this issue.
https://github.com/transmission/transmission/blob/3.00/libtransmission/metainfo.c#L39
it should be changed to something like this:

static char* metainfoGetBasenameNameAndPartialHash(tr_info const* inf)
{
    enum { name_length_limit=64 }; // 219
    char *shortName, *cleanName, *ret, *p;
    char const* name = inf->originalName;
    size_t const name_len = strlen(name);

    shortName = tr_strndup(name, name_length_limit);
    cleanName = tr_utf8clean(shortName, -1);
    ret = tr_strdup_printf("%s.%16.16s", cleanName, inf->hashString);
    tr_free(shortName);

    for(p=ret;*p;p++)
    {
        if (char_is_path_separator(*p))
        {
            *p = '_';
        }
    }

    return ret;
}

@antivirtel
Copy link

@mikedld can you please reopen the ticket at least? I see you closed it, but it's clearly not fixed in 3.0 either.

@gilad905
Copy link

gilad905 commented Mar 25, 2022

As in my example above (#122 (comment)) you could just text edit manually the name portion of any magnet (begins with &dn=) down to a short(er) length.

@cfpp2p
Note on this - I've tried manually shortening the value of dn in the magnet link and adding the torrent via the webUI, it still doesn't help.
After fetching metadata for the torrent, torrent name (in webUI) changes to the original dn value. On pausing the torrent, File name too long still pops up.
I'm on v2.94

@mikedld
Copy link
Member

mikedld commented Jul 27, 2022

@gelin, milestone for this issue is set to 3.00.

@transmission transmission deleted a comment from gelin Jul 27, 2022
@vird
Copy link

vird commented Jul 7, 2023

Partially helps
~/.config/transmission/settings.json
rename-partial-files:false

@pugzly
Copy link

pugzly commented Sep 21, 2023

It's strange ~7 years later Transmission still struggles with long file names.
Due to my partition being encrypted, length of file names is limited. Renaming torrents (files, and directories) helps only partially to shorten those, download usually still fails after first few megabytes downloaded, with error message:
"Error: Unable to save resume file: File name too long"
And I need to manually force it to resume, again and again, every few megabytes. Seems like the only viable workaround is to use Deluge.

@kov-serg
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests