shaarli / Shaarli

The personal, minimalist, super-fast, database free, bookmarking service - community repo
https://shaarli.readthedocs.io/
Other
3.44k stars 295 forks source link

Imported Google Bookmarks and Shaarli Home Page is Now Blank #1227

Closed meminens closed 6 years ago

meminens commented 6 years ago

Apache Log

[Sun Sep 30 20:56:28.227647 2018] [php7:error] [pid 13794] [client 75.187.71.158:54418] PHP Fatal error:  Uncaught Error: Invalid serialization data for DateTime object in /var/www/xxxx.com/html/shaarli/application/FileUtils.php:77
Stack trace:
#0 [internal function]: DateTime->__wakeup()
#1 /var/www/xxxx.com/html/shaarli/application/FileUtils.php(77): unserialize('a:25:{i:0;a:8:{...')
#2 /var/www/xxxx.com/html/shaarli/application/LinkDB.php(294): FileUtils::readFlatDB('data/datastore....', Array)
#3 /var/www/xxxx.com/html/shaarli/application/LinkDB.php(118): LinkDB->read()
#4 /var/www/xxxx.com/html/shaarli/index.php(1834): LinkDB->__construct('data/datastore....', true, true, '', true)
#5 {main}\n  thrown in /var/www/xxxx.com/html/shaarli/application/FileUtils.php on line 77

Before I imported the html file from Google Bookmarks, everything was working perfectly fine. How can I resolve this issue? I literally installed Shaarli on my Ubuntu VPS just a few minutes ago. Thanks.

Setup Ubuntu 18.04 running on a VPS PHP 7.2.10 Apache 2.4.29

meminens commented 6 years ago

I emptied the datastore.php file and now everything works fine. Of course no bookmarks at the moment. Is there a way to import from the bookmarks.html that Google Bookmarks generates?

virtualtam commented 6 years ago

Hi @bisherbas,

The issue is likely related to how bookmarks are exported by Google, and how the parser reads them.

Would you mind sharing a sample export (e.g. with 5 to 10 entries/bookmarks) from Google Bookmarks so we can update the parser code to support this format ?

meminens commented 6 years ago

Hi @virtualtam,

Thank you for your reply. Please see a sample Google Bookmarks export below:


<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><H3 ADD_DATE="1523996194943160">Unlabeled</H3>
<DL><p>
<DT><A HREF="https://www.wordhippo.com/" ADD_DATE="1515515697780642">WordHippo | Comprehensive Thesaurus for Synonyms and Antonyms</A>
<DT><A HREF="https://stackoverflow.com/questions/20180072/move-files-into-alphabetically-named-folders" ADD_DATE="1519067075550809">powershell - Move files into alphabetically named folders - Stack Overflow</A>
<DT><A HREF="http://www.searchq.com/" ADD_DATE="1523996185317575">Free Lien Search</A>
<DT><A HREF="https://www.opennic.org/" ADD_DATE="1529505663052547">OpenNIC Project</A>
<DT><A HREF="https://www.imdb.com/title/tt4302938/" ADD_DATE="1532442262578515">Kubo and the Two Strings (2016) - IMDb</A>
<DT><A HREF="https://nextace.com/" ADD_DATE="1523996194943160">Home | NextAce</A>
</DL><p>
</DL><p>
virtualtam commented 6 years ago

Thanks! It's due to the date formatting indeed and should be easy to patch :)

meminens commented 6 years ago

Thanks a lot! :)

meminens commented 6 years ago

Should I close the issue now? Looks like you've merged some updates.