trilium icon indicating copy to clipboard operation
trilium copied to clipboard

(Bug report) Long note names are all truncated in the exports

Open gerroon opened this issue 1 year ago • 11 comments
trafficstars

Trilium Version

0.62.3

What operating system are you using?

Windows

What is your setup?

Local (no sync)

Operating System Version

Windows 11

Description

It looks like Trilium trims all the long files during exports leads to all broken exports, unfortunately. the pdf files are missing .pdf extensions, it might be related to long file names issue.

I checked both md and html exports and that seems to be the case

Error logs

No response

gerroon avatar Dec 01 '23 02:12 gerroon

No one has this issue? This is a bummer because the files with truncated names cant be found or linked in the exported files :(

gerroon avatar Jan 13 '24 23:01 gerroon

It might just be a Windows limitation - there could be a path size limit

sigaloid avatar Jan 13 '24 23:01 sigaloid

I am really not sure, the files are truncated already in the zip files.

gerroon avatar Jan 14 '24 00:01 gerroon

How long are the note names? Can you share one?

meichthys avatar Jan 14 '24 01:01 meichthys

Look at this image, you can see they are cut off and they have no file extension either. I think this is Trilium's exporting bug or something along those lines.

image

Same with the html export. As you files with shorters names have proper file extentions

image

And this is the actual inside of the zip. They seem truncated inside

image

gerroon avatar Jan 14 '24 03:01 gerroon

Here is the actual content in Trilium, as you see the images are there.

This is just one sample I found quickly. I had many other instances in this export so this is not the only page I have this issue.

image

image

gerroon avatar Jan 14 '24 03:01 gerroon

Yes, long names are truncated mostly because of the Windows path length limitation. If the filenames were too long, it would be impossible to extract the ZIP file, so Trilium is being conservative.

The full filenames are preserved in the !!!meta.json file, so when importing into Trilium there's no loss.

zadam avatar Jan 21 '24 09:01 zadam

That is fine, but that renders the exported repo totally useless give I now have half the stuff broken :( Is there a solution to this without going to the whole repo and manually fixing every file and where they are linked which is a super complicated task for a human.

gerroon avatar Jan 21 '24 17:01 gerroon

@zadam

Why not offer tar or another format that does not truncate long files? Also most of these files with long names were created by the Trilium Webclipper, at least in my case the user is not at fault.

gerroon avatar Mar 20 '24 03:03 gerroon

While Trilium may have the capability to export TAR files, extracting them on a Windows machine remains challenging due to system limitations. However, you can attempt to overcome this obstacle by adjusting your Windows configuration settings. Refer to Microsoft's documentation on modifying Windows configurations to address file path limitations for guidance: link.

Nriver avatar Mar 20 '24 04:03 Nriver

7Z perfectly opens tar files, I do not see why Tar is not a solution. As of now the exports are crippled for given conditions, and it seems like a better approach then asking people to mess with windows and the registry.

Btw most people won't even realize that their exports might be broken due to this until they try to open these files. So really this is a big user hindrance in my view

gerroon avatar Mar 21 '24 03:03 gerroon