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

"File bookmarks_all_xxx.html has an unknown file format. Nothing was imported" #969

Closed
TheNomad11 opened this issue Sep 17, 2017 · 8 comments
Labels
server support installation and configuration issues tools developer tools

Comments

@TheNomad11
Copy link

I exported my bookmarks from shaarli (newest version) and tried to import it in another shaarli instance. Then I got this error message

"File bookmarks_all_20170917_231302.html (1139620 bytes) has an unknown file format. Nothing was imported".

The file is 1,1 MB big.

I then made the file smaller, including only one entry. Then the import worked fine.

Are there issues with larger files? Why do I get an error message about the file format being invalid?

@virtualtam
Copy link
Member

Hi @TheNomad11 !

What are the respective Shaarli versions and HTTP server configurations?

Also, are the HTTP server and PHP properly configured to allow uploading files >= 1 MiB?

@virtualtam virtualtam added server support installation and configuration issues tools developer tools labels Sep 18, 2017
@izumitelj
Copy link

Hi @virtualtam I think I have the same problem.

My original file is 1072 KB, exported from Diigo. When importing I got the same message File xyz.html (1097148 bytes) has an unknown file format. Nothing was imported

After trimming the file (while trying to figure if this is the problem with syntax or specific characters) I've found that the problem is really in file size. File trimmed to 100221 bytes imports OK while file with
100222 bytes throws the error.

My server configuration:

Apache Version  2.4.25
PHP Version     5.6.30
Architecture    x86_64
Operating System    linux

Some of my PHP settings:

max_execution_time   90 
max_input_time   60 
memory_limit   128M 
upload_max_filesize   2M

I'm not administrator of this server but I can ask for changes if that is the problem.

@virtualtam
Copy link
Member

Hi @izumitelj !

What is the value for the PHP post_max_size setting?

@izumitelj
Copy link

izumitelj commented Oct 1, 2017

@virtualtam here it is:

post_max_size  64M
upload_max_filesize  32M

and here are other settings

@izumitelj
Copy link

@virtualtam It seems like this has to do with PHP version. The issue is present with PHP 5.6, while with PHP 7 it works as expected without errors.

Unfortunately I can't switch to PHP 7 yet :(.

Can someone look into this issue, probably NetscapeBookmarkUtils.php, or at least revisit the documentation.

Thanks

@virtualtam
Copy link
Member

OK, just to sum things up, could you provide us with the following information so we can try to reproduce the issue?

  • Server type (dedicated/bare metal, VPS, container appliance...)
  • System:
    • Linux distribution and version code/number
    • architecture (x86, x86_64, etc.)
  • Apache:
    • version
    • enabled modules
  • PHP:
    • version
    • enabled extensions
    • configuration file location
    • values for post_max_size and upload_max_filesize

Note:

PHP provides different configuration files (one per environment: apache2, cli, fpm, etc.), be sure to check values from the one used by the actual HTTP server (Apache2 / Nginx+FPM, etc.)


Example on a dedicated server running Debian 8 Jessie, using Apache 2.4 and PHP 5.6:

$ uname -a
Linux myserver 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u5 (2015-10-09) x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 8.2 (jessie)
Release:	8.2
Codename:	jessie

$ dpkg -l apache2 | grep ^i
ii  apache2        2.4.10-10+deb8u10 amd64        Apache HTTP Server

$ dpkg -l php5 | grep ^i
ii  php5           5.6.30+dfsg-0+deb8u1 all          server-side, HTML-embedded scripting language (metapackage)

$ grep post_max /etc/php5/apache2/php.ini
post_max_size = 501M

$ grep upload_max /etc/php5/apache2/php.ini
upload_max_filesize = 500M

In the meantime, I'll write a tool to generate dummy bookmark files of configurable size, to run tests against different environments.

virtualtam added a commit to shaarli/devtools that referenced this issue Oct 4, 2017
It uses the Faker library to generate fake yet coherent bookmark entries that
can then be used to:
- test Shaarli bookmark imports
- test NetscapeBookmarkParser
- diagnose performance issues

See:
- https://faker.readthedocs.io/en/latest/
- shaarli/Shaarli#902
- shaarli/Shaarli#969
- https://github.com/shaarli/netscape-bookmark-parser

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
@izumitelj
Copy link

izumitelj commented Oct 4, 2017

Hmm... maybe I've made wrong assumption about incompatible PHP version. System admins said that they have checked all relevant variables and even tried switching Mod Security off. According to them the only thing that fixed the problem was switching to PHP 7 (which I couldn't do because of the other services).

In the mean time they gave me chance to migrate to newer server that supports multiple PHP versions per subdomain.

Now I've tested it and it works OK on both versions PHP 5.6.31 and 7.0.23, so the problem might be somewhere else! Unfortunately I can't do any testing on ex-server but I still have some info saved.

Old server:

Linux servername 2.6.32-696.6.3.el6.x86_64 #1 SMP Wed Jul 12 14:17:22 UTC 2017 x86_64
Apache Version  2.4.25
PHP Version     5.6.27
post_max_size  64M
upload_max_filesize  32M

New server:

Linux servername 3.10.0-693.2.2.el7.x86_64 #1 SMP Tue Sep 12 22:26:13 UTC 2017 x86_64 
Apache Version  2.4.27
PHP Version     5.6.31
PHP Version     7.0.23
post_max_size  48M
upload_max_filesize  32M

@izumitelj
Copy link

With release 0.9.2 I've successfully imported my bookmarks (1.098.716 bytes, 4583 links) without need to split the file in half. It took some time to process but worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
server support installation and configuration issues tools developer tools
Projects
None yet
Development

No branches or pull requests

4 participants