zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.2k stars 1.9k forks source link

HTML export results in an empty file #1081

Closed adityavm closed 2 years ago

adityavm commented 4 years ago

If I try to export some of my notes with its descendants, it results in an blank HTML file. When I try to open it in an editor to see what's in it, it reports it as a binary file.

However if I export the same note as a standalone export, I get the correct HTML file (without any attached images, etc. of course).

Screen Shot 2020-06-04 at 8 38 59 am

App version: 0.42.3 Log file: This is the log file generated from my session in which I exported the faulty notes. trilium-2020-06-04.log

zadam commented 4 years ago

Hello, when you export a note with a subtree, the result is not a HTML file, but a ZIP file containing the HTML files (and images etc.)

That might be the reason why it reports you the file is binary. Could you try to rename the exported .HTML file to .ZIP and open it using an archive tool?

adityavm commented 4 years ago

@zadam These are the files that I get when I try to export:

Screen Shot 2020-06-04 at 8 48 29 pm

I tried to rename the Banners.html to ZIP and unarchive it but I get an error saying it's an unsupported format.

idelem commented 4 years ago

@zadam Same issue here, still not fixed in 0.43.4. This is reproducible on mac but not on windows, and only occurs when there are UTF-8 characters

edit:

Solved.

The default mac unarchiver will not unarchive it. I used "the unarchiver" and everything works. On windows, Bandizip will report an error about the file size, but unarchives correctly. So I guess there is an issue with the .zip file.

edit 2:

Tried with bandizip again, it says the file size doesn't match that specified in the header

syzithryx commented 4 years ago

I'm on Ubuntu, having the same problem. I unzip the archive and the HTML files in it are completely empty. There's something wrong with the way these files are getting zipped, I think.

QuentinLeCaignec commented 3 years ago

Having the same issue here on Kubuntu, impossible to unzip the HTML .zip export. The root level of the archive (!!!meta.json, index.html, navigation.html and style.css) extract fine, but getting into the note content such as the .html file or a .js file hangs or tries uselessly forever.

This is very strange, I wish there a way to extract a note, unzip to be able to modify the files (or in my case make a git repository of a specific widget i've done) and zip it again to be able to import it (or give to other users so they can import it).

Any idea why the archive is impossible to extract ?

zadam commented 3 years ago

Hi, could you run the integrity check on the exported file and post here the results?

$ unzip -t export-test.zip 
QuentinLeCaignec commented 3 years ago

Hi, could you run the integrity check on the exported file and post here the results?

$ unzip -t export-test.zip 

I was about to make a long response about my findings and how it seemed like some specific notes would unzip and some wouldn't, but after trying the integrity check (and it shows all OK), I realized this is specifically a problem of my archive program (Ark), since unzip has absolutely not problem unzipping any of it.

Sorry for bumping this issue, it seems the real problem was Ark all along randomly being unable to unzip even simple notes with a single paragraph. Thanks for the suggestion, it made me realize the problem wasn't trilium!

zadam commented 3 years ago

Hmm, these compatibility issues are really weird. Similar ones have been reported in #1122 for (mainly) windows archive utilities ...

zadam commented 2 years ago

ZIP export issues should have been already resolved.