mirror of
https://github.com/floccusaddon/floccus.git
synced 2026-04-26 06:35:59 +03:00
[GH-ISSUE #157] Error: "xbelObj is undefined" #148
Labels
No labels
browser-specific
bug
correctness issues
enhancement
feature: Google Drive
feature: Linkwarden
feature: git
feature: nextcloud-bookmarks
feature: tabs
feature: webdav
help wanted
native-app
priority: high
priority: low
priority: medium
pull-request
question
question
stale
upstream
waiting for more information
wontfix
🙁 Not following issue template
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/floccus#148
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @anmith on GitHub (Aug 27, 2018).
Original GitHub issue: https://github.com/floccusaddon/floccus/issues/157
Software versions
Steps to reproduce
I installed Floccus using the Mozilla Add-Ons-page, added a WebDAV account and started an initial sync which worked as expected and showed that the sync went fine.
After a while, I noticed an exclaimation mark on the Floccus icon and when clicking on the Floccus icon I get the error: "xbelObj is undefined"
@anmith commented on GitHub (Aug 27, 2018):
Just had a look at the debug log. It starts with:
Starting sync process for account myaccount@https://mydomain/remote.php/webdav/
...
Successfully ended sync process for account myaccount@https://mydomain/remote.php/webdav/
After the first successful sync, there's 9 times the line:
Starting sync process for account myaccount@https://mydomain/remote.php/webdav/
Starting sync process for account myaccount@https://mydomain/remote.php/webdav/
Starting sync process for account myaccount@https://mydomain/remote.php/webdav/
Starting sync process for account myaccount@https://mydomain/remote.php/webdav/
Starting sync process for account myaccount@https://mydomain/remote.php/webdav/
Starting sync process for account myaccount@https://mydomain/remote.php/webdav/
Starting sync process for account myaccount@https://mydomain/remote.php/webdav/
Starting sync process for account myaccount@https://mydomain/remote.php/webdav/
Starting sync process for account myaccount@https://mydomain/remote.php/webdav/
@marcelklehr commented on GitHub (Aug 27, 2018):
Mmh. It looks like there's an error parsing the XBEL file :/ Could you take a look at the file or perhaps post a redacted version here?
@anmith commented on GitHub (Aug 28, 2018):
Hmmm. Opening and closing tags are there, here's a shortened version:
@jlbprof commented on GitHub (Aug 28, 2018):
It should be valid XML, so can you take that file and go to a website xml
validator upload it and check for errors?
Thanx
Julian
On Tue, Aug 28, 2018 at 1:57 AM anmith notifications@github.com wrote:
@anmith commented on GitHub (Aug 28, 2018):
Hi,
thanks for the hint.
I used the PERL module XML::Validate to check the file and it reported some errors related to the HTML entity " " being used in the Bookmark title:
:394: parser error : Entity 'nbsp' not defined
I edited the two bookmarks where errors had been reported (replacing " " by " "), deleted the file on the Nextcloud-Server and triggered a new sync with option "trigger sync from scratch". The initial sync resulted in "all good".
A manual sync afterwards using the "Sync now" button also was "all good".
So it seems there's a need for HTML-entity handling in titles.
@jlbprof commented on GitHub (Aug 28, 2018):
We may have to deal with that.
Can you find the exact lines in the XML file that caused the issue and post
them here?
Thanx
Julian
On Tue, Aug 28, 2018 at 8:34 AM anmith notifications@github.com wrote:
@anmith commented on GitHub (Aug 28, 2018):
Sadly no, as I deleted the wrong xbel-File before syncing (see above).
But I just noticed another problem:
There seems to be a problem with HTML entities in the title in general. After closing and opening Firefox, the title "Postbank Banking & Brokerage" had been corrupted to "Postbank Banking & Brokerage".
Corresponding entry in the xbel-file is:
@marcelklehr commented on GitHub (Aug 30, 2018):
I've just released v3.0.5 which should fix this.
@jd666 commented on GitHub (Aug 30, 2018):
Still getting same error with 3.0.5. Is there a some kind of test parser to find the bookmark where it breaks?
@marcelklehr commented on GitHub (Aug 30, 2018):
mmmh.
@jd666 Try https://xmlvalidation.com/ or any result of your favorite search engine for "xml validation"
@jd666 commented on GitHub (Aug 30, 2018):
https://xmlvalidation.com/ errors because it doesn't use the referenced dtd:
However
xlint --validate bookmarks.xbelshows me no error.@jlbprof commented on GitHub (Aug 30, 2018):
I wonder if the dtd line is getting removed or corrupted some how.
Because that is the only thing I can think of, since this has to be that it
is not being parsed.
On Thu, Aug 30, 2018 at 6:06 PM jd666 notifications@github.com wrote:
@jlbprof commented on GitHub (Aug 30, 2018):
You seem to be somewhat skilled.
If you are able to do this, please do. If you are not able to do this,
that is ok.
bookmarks.xbel.lock, this is not an error, it just means everything is ok.
can you take a screenshot of it?
Thank you
Julian
On Thu, Aug 30, 2018 at 6:18 PM Julian Brown julian@jlbprof.com wrote:
@anmith commented on GitHub (Aug 31, 2018):
Hi,
a problem with the dtd line could be possible - when checking my corrupted file with XML::Validate it complained about a http IO error until I removed the dtd line.
As I wan't sure if it's a problem with XML::Validate, I just removed the line - maybe I should have taken a closer look.
@marcelklehr commented on GitHub (Aug 31, 2018):
@anmith I don't think the dtd line was responsible, though, as fixing the entities (
) seems to have fixed things for you, is that correct?@marcelklehr commented on GitHub (Aug 31, 2018):
@jd666 Could it be that you are getting this error now: https://github.com/marcelklehr/floccus/issues/160 That one should be fixed in v3.0.6 🙈
@anmith commented on GitHub (Aug 31, 2018):
@marcelklehr: the entity coding works now
<title>Postbank Banking & Brokerage</title>but I still get the "xbelObj is undefined" error after the initial sync, even after updating to 3.0.6.
@marcelklehr commented on GitHub (Aug 31, 2018):
@anmith What does your dtd look like and what does the validator say before and after removing the dtd?
@marcelklehr commented on GitHub (Aug 31, 2018):
The entities might still be the problem, as the xbel data is parsed as XML but serialized as HTML. XML doesn't have the named entities that html has (like the non-breaking space
, etc.).@marcelklehr commented on GitHub (Aug 31, 2018):
This only happens in firefox, correct?
@anmith commented on GitHub (Aug 31, 2018):
Hi,
it's in Firefox. Can't check Chrome as I uninstalled it some time ago.
When using XML::Validate to check the xbel-File, the first error reported is "Error: http error : Unknown IO error" which is gone in the moment I remove the line.
<!DOCTYPE xbel PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML" "http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">When opening the URL http://www.python.org/topics/xml/dtds/xbel-1.0.dtd in the Browser I get redirected to http://pyxml.sourceforge.net/topics/ with a 301 Moved permanently.
Following some links on the document, the right URL for the dtd seems to be http://pyxml.sourceforge.net/topics/dtds/xbel-1.0.dtd
After adding this URL, XML::Validate doesn't complain anymore about an "Error: http error : Unknown IO error", but starts complaining about the entities:
Error: :394: parser error : Entity 'nbsp' not definedSo it seems there's still a problem with the encoding.
@anmith commented on GitHub (Aug 31, 2018):
I tried to create a shortened example:
@jlbprof commented on GitHub (Aug 31, 2018):
If that makes yours fail, we can probably track this down. I am work so
can't do much.
I did run it against this validator.
https://codebeautify.org/xmlvalidator
And it passes, so perhaps Firefox does not have a good validator.
On Fri, Aug 31, 2018 at 10:24 AM anmith notifications@github.com wrote:
@anmith commented on GitHub (Aug 31, 2018):
I think it's the contrary: simple XML validators may just check if all open tags are closed, all attribute values are enclosed in quotes etc while better ones check agains the given dtd.
When running the XML above through https://xmlvalidation.com I get
as result which is something I expect as the URL to the dtd is invalid so the declaration is missing.
When replacing the URL in the DOCTYPE tag with the correct URL
I get different errors:
so the error "xbelObj is undefined" points to the right direction IMHO: Firefox not being able to get the dtd because of the invalid URL and so not being able to parse the XML.
@marcelklehr commented on GitHub (Aug 31, 2018):
Aha. The latter error may be even more significant: https://stackoverflow.com/questions/25256989/attribute-value-001-of-type-id-must-be-an-ncname-when-namespaces-are-enabled#25258374
@marcelklehr commented on GitHub (Aug 31, 2018):
I still cannot reproduce this, though, which bugs me, as you'd think when the XML is invalid, firefox would reject it right from the start, but it didn't as you describe. So, even though the validation errors should be fixed, I doubt those are actually the problem.
@anmith Could you send the redacted debug log of a recent failed sync with floccus v3.0.6? I've since fixed logging in the webdav adapter to also write to the generated log file.
@jlbprof commented on GitHub (Aug 31, 2018):
A one line change can fix the DTD problem, we just need to find out what
the current DTD is after all the redirects.
On Fri, Aug 31, 2018 at 4:16 PM Marcel Klehr notifications@github.com
wrote:
@jlbprof commented on GitHub (Aug 31, 2018):
http://pyxml.sourceforge.net/topics/dtds/xbel.dtd
I found that on the pyxml site, does that seem correct? It internally
refers to itself as xbel-1.0 so that is probably right.
Julian
On Fri, Aug 31, 2018 at 4:55 PM Julian Brown julian@jlbprof.com wrote:
@anmith commented on GitHub (Sep 1, 2018):
@jlbprof this was also the URL I found, see comment https://github.com/marcelklehr/floccus/issues/157#issuecomment-417696953
@anmith commented on GitHub (Sep 1, 2018):
@marcelklehr the log doesn't show much information, just 4 lines are added for every failed sync:
@anmith commented on GitHub (Sep 1, 2018):
@jlbprof , @marcelklehr I tried to replace the URL in the DOCTYPE-definition on the server and then sync again, but still got the same error.
@anmith commented on GitHub (Sep 1, 2018):
@jlbprof , @marcelklehr As it seems it wasn't the URL causing the problems, my plan for the next steps is:
Good idea?
@marcelklehr commented on GitHub (Sep 1, 2018):
@anmith That would be awesome. Thank you!
Can you also try syncing with the following build? https://klehranlage.net/index.php/s/2fNbPdr9nfMiKZQ
It should report a potential parse error in the user interface.
@anmith commented on GitHub (Sep 1, 2018):
Hi,
here's what I tried with 3.0.6 (read the message about the special built too late):
As I wasn't able to find all bookmarks causing problems, I tried a slightly different approach:
So it seems it's one of my bookmarks causing the problem(s). I'll continue investigating.
@marcelklehr commented on GitHub (Sep 1, 2018):
The special build should tell you exactly where in the XML file the error happens, so you don't need to try it with different bookmarks, just install the build temporarily via
about:debuggingand sync as you would normally to get the xbel error.@anmith commented on GitHub (Sep 2, 2018):
Hi,
it did indeed: there was an entry for my old Synology NAS which caused the error, here's the error report:
Here's what the corresponding part of the xbel-file looks like:
The bookmark itself is shown as
fitz - Synology DiskStationin the browser
@jlbprof commented on GitHub (Sep 2, 2018):
A non breaking space, breaks xml, that doesn't make sense. Wierd.
On Sun, Sep 2, 2018 at 3:38 AM anmith notifications@github.com wrote:
@marcelklehr commented on GitHub (Sep 2, 2018):
🎉 that's progress! As I said,
@anmith
That's a good sign. Still, this should be fixed in v3.0.6 :/ What happens if you fix the entities in the XBEL file?
@t3mujin commented on GitHub (Sep 2, 2018):
I'm having a lot of error like these due to the bookmarklets I have in my bookmarks. All of them have to do with the javascript breaking the xml, but all it takes is properly replacing the " by ' to have it working.
@anmith commented on GitHub (Sep 2, 2018):
@marcelklehr
I don't think the entry in the xbel-File is wrong:
<title>fitz - Synology DiskStation</title>However, according to the debug-output, something terrible seems to be happening while accessing:
For me it looks like the entities are encoded again, changing "<" to "<" and the first "
" to "&nbsp"@t3mujin please don't mix things up, this has nothing to do with bookmarklets or javascript within bookmarks. Thanks!
@marcelklehr commented on GitHub (Sep 2, 2018):
Actually, @t3mujin has a good point. If there's a " in the bookmark URL (like when you have a javascript bookmarklet) this breaks the XML as well.
@anmith Ah, I think you're reading more into this than there is. The debug output is itself in XML, which is why entities are encoded again (whoever thought this was a good idea in the W3C.. 🙈 . XML all the way, baby!) So, as I see it, the problem is that floccus used to use HTML entities to encode special characters. However, there's a difference between entities recognized by HTML and those recognized by XML. HTML defines a superset of entities of XML. E.g.
is only defined in HTML, not in XML. Floccus v3.0.6 should now use XML entities. Thus, could you try removing your xbel file ono the server again, tickreset cachein your floccus account options and trigger an initial sync to recreate it, then trigger another sync to see if parsing works?EDIT: Wait, you did that already with v3.0.6 :/
EDIT: Ah, v3.0.6 still uses HTML encoding. My bad. I'll release v3.0.7 shortly.
@marcelklehr commented on GitHub (Sep 2, 2018):
v3.0.7 should finally fix this. Please test by removing xbel file on the server again, clearing cache and triggering a sync twice in sequence :)
@anmith commented on GitHub (Sep 2, 2018):
@marcelklehr updated to 3.0.7 and tried, but all I get is a "myFolder.children.map is not a function" error during the initial sync. :-(
@marcelklehr commented on GitHub (Sep 2, 2018):
sigh. My bad. It seems my testing infrastructure is not mature enough, yet, to rely on it blindly... v3.0.8 it is, then.
@jlbprof commented on GitHub (Sep 2, 2018):
Marcel
I filed an issue about 3.0.7 as well, XBEL has an error creating new
Folder. See my issue.
Thanx
Julian
On Sun, Sep 2, 2018 at 12:14 PM Marcel Klehr notifications@github.com
wrote:
@anmith commented on GitHub (Sep 2, 2018):
Good news. Updated to 3.0.8, deleted the file on the server and started a new sync. Everytime I click on "sync now" afterwards, the result is always "all good".
@marcelklehr Thanks a lot for all the time and energy you put into this project!
@marcelklehr commented on GitHub (Sep 2, 2018):
Awesome! :)
@t3mujin Your issues with bookmarklets should also be fixed in the latest version ;)
@jd666 commented on GitHub (Sep 2, 2018):
3.0.8 fixed the issues I had. Thank you.
@t3mujin commented on GitHub (Sep 4, 2018):
Works perfect, thanks!
On Sun, Sep 2, 2018 at 8:57 PM jd666 notifications@github.com wrote:
--
João Almeida
about.me/joaoalmeida
joaoalmeidaphotography.com
@github-actions[bot] commented on GitHub (Mar 21, 2023):
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.