onozaty / browser-online-bookmark-incsearch

Online Bookmark Incremental Search for Firefox(WebExntension) and Google Chrome
MIT License
16 stars 1 forks source link

Suddenly " Online Bookmark Incremental Search " in Chrome message: Bookmarks loading is failed. (200:OK). #14

Open sfd99 opened 10 months ago

sfd99 commented 10 months ago

Hi Onozaty,

I have been using your excellent Chrome extension: " Online Bookmark Incremental Search " version 2.0.3, for many years. Wonderful to quickly search and find specific bookmarks in my PINBOARD.

But recently, when doing: SYNC, I get the message: " Load bookmarks Bookmarks loading is failed. (200:OK) ".

After re-installing version 2.0.3 in Chrome the extension is not prompting me to enter my PINBOARD API token. No form entry field is displayed for me to enter my PINBOARD API token...

Help please Onozaty, your extension is so helpful and wonderful!.

**SFd99 San Francisco.

onozaty commented 10 months ago

Hi @sfd99

Thank you for using this extension. Can you please check the Console in Chrome's DevTools for any errors so we can learn more about the error.

sfd99 commented 10 months ago

Hi Onozaty,

Thanks for the quick reply!...

I'm not deeply technical and did check F12 in Chrome, but there is an error mssg in the [ Console ] tab:

" Failed to load resource: the server responded with a status of 500 (Internal Server Error) "

I did get now a small prompt popup window with a blue progress bar, from: api.pinbord.com asking for my Pinboard ID and pwd. (It does not ask for my API Token at Pinboard....).

After I enter them both, (VERY carefully and correctly...), the popup shows this message: " Bookmarks loading is failed. (500:Internal Server Error) "

and the blue progress bar is frozen.

Big mystery ... Onozaty, are you also getting this API message when you try to "Sync" your bookmarks at Pinboard with " Online Bookmark Incremental Search " version 2.0.3 ?.

**SFd99 San Francisco.

latest Chrome browser Ubuntu Linux 20.04 Online Bookmark Incremental Search extension: version 2.0.3**

onozaty commented 10 months ago

It works fine on my PC.

onlinebookmarks

Do you know what triggered the problem? For example, did you add a certain bookmark?

sfd99 commented 10 months ago

Interesting...

Apparently, PINBOARD. is updating their API. please, take a look: https://api.pinboard.in/v1/posts/update

Maybe that could have some effect? SFd99

onozaty commented 10 months ago

The following API is used to obtain the bookmark list.

Could you please open this URL in your browser and check how it looks like?

sfd99 commented 10 months ago

UPDATE: I just added the Online Bookmark Incremental Search extension to the the Chromium browser (not Chrome).

Chromium has absolutely no other extensions that could interfere...

Doing " SYNC ", I get the popup with same mssg: " Load bookmarks Bookmarks loading is failed. (200:OK) "

I suspect it may be the new Pinboard API?.

sfd99 commented 10 months ago

ok, chrome to: https://api.pinboard.in/v1/posts/all

Result: Chrome spins for 5-10 seconds, then, this mssg:

This page contains the following errors: error on line 276533 at column 1: invalid character in attribute value Below is a rendering of the page up to the first error. html, body, body :not(iframe) { background-color: #1d1f20 !important; border-color: #8f8476 !important; color: #ffffff !important; }

The rest of the screen below this mssg is totally blank in Chrome...

sfd99 commented 10 months ago

UPDATE: Here, PINB. details the new API V2: https://pinboard.in/api/v2/overview

==== START OF PINB TEXT === Pinboard API DRAFT Documentation (v2) This is draft documentation for version 2 of the Pinboard API, which is under development.

Documentation for version 1 of the Pinboard API can be found here.

OverviewReference

Access The API endpoint is: https://api.pinboard.in/v2/.

The endpoint for testing is https://test.api.pinboard.in/v2/. See the section on test accounts below.

==== END OF PINB TEXT ===

onozaty commented 10 months ago

The new API is Draft and still under development.

This problem seems to be caused by an invalid character being registered as a bookmark, so please find the corresponding bookmark in the error message and correct it. Originally, it would be better if Pinboard handled this correctly when returning from the API, but it seems that there are some characters that are not supported.

The same problem has been reported in #13

Thanks.

sfd99 commented 10 months ago

Great pointers, Onozaty!!!.

Specially the #13 Issue SOLUTION ref: special characters...

I have already D/L (exported) to my HardDisk, my Bookmarks from Pinboard as 3 text files, in:

Interesting Tech Question:

Since I have many thousands of bookmarks, it's almost impossible to scan special characters in each bookmark, visually by hand.

But...but... is there any Linux tool or technique you would kindly suggest , to scan (and automatically delete) any of the offending, special characters?.

Then, I would import again the "healthy" file into Pinboard...

Again thanks for your dedication and great extension!. Very Best, SFd99.

onozaty commented 10 months ago

I don't think there is a tool that is just right.

If you view https://api.pinboard.in/v1/posts/all in your browser, you will see an error. You should be able to find the information about the error there.

If you have not had an error before, it is most likely due to a recently added bookmark.

Thanks.

onozaty commented 10 months ago

If you have made your bookmarks public, could you please tell us the name of your account on the pin board? We may be able to check for suspicious characters on the pinboard site.

sfd99 commented 10 months ago

I did go to: https://api.pinboard.in/v1/posts/all

and I see this message in Chrome:

This page contains the following errors: error on line 276553 at column 1: invalid character in attribute value Below is a rendering of the page up to the first error. html, body, body :not(iframe) { background-color: #1d1f20 !important; border-color: #8f8476 !important; color: #ffffff !important; }

The rest of the screen is blank.

I then opened [ F12 ] f/ the Chrome Inspector. It detects: 10 Errors but in the Console no Error seems to be related to XML bad characters....

I copied the reported "errors": not available  all:544 Error handling response: TypeError: Cannot set properties of undefined (setting 'data') at chrome-extension://cjadmgobonfhilogbdgkkhnoojpgenfg/data/content_script/inject.js:51:31 browsersupport.js:7 Uncaught DOMException: Failed to execute 'attachShadow' on 'Element': This element does not support attachShadow at Object.createShadowDOM (chrome-extension://gipnlpdeieaidmmeaichnddnmjmcakoe/common/browsersupport.js:7:28) at chrome-extension://gipnlpdeieaidmmeaichnddnmjmcakoe/popup/init_script.js:7:36 at chrome-extension://gipnlpdeieaidmmeaichnddnmjmcakoe/popup/init_script.js:216:3 all:1 Error handling response: TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'. at chrome-extension://ghinpogonpmlphfkmnjfapdaoaainejn/content-action.js:33:12 app.js:1 Uncaught TypeError: Cannot read properties of null (reading 'insertAdjacentHTML') at app.Container.init (app.js:1:3999) at app.main (app.js:1:3453) content.js:2 Uncaught TypeError: Cannot use 'in' operator to search for 'animation' in undefined at Ve (content.js:2:33800) at 4448 (content.js:2:34083) at n (content.js:2:157213) at 3935 (content.js:2:136778) at n (content.js:2:157213) at content.js:2:157515 at content.js:2:180026 at content.js:2:180030 commons.js:2 Uncaught TypeError: Cannot read properties of null (reading 'append') at commons.js:2:1280263 at 27770 (commons.js:2:1280323) at l (content.js:1:709106) at content.js:1:710702 at l.O (content.js:1:709439) at content.js:1:710718 at content.js:1:710723 main.js:448 Uncaught TypeError: Cannot read properties of null (reading 'appendChild') at main.js:448:21 content.js:190 Uncaught TypeError: Cannot read properties of undefined (reading 'setProperty') at loadQuickMenu (content.js:190:24) at content.js:79:51 all:1 Error handling response: TypeError: Cannot read properties of null (reading 'scrollHeight') at chrome-extension://hegiignepmecppikdlbohnnbfjdoaghj/thirdparty/pratikabu-jquery-3.2.1.min.js:4:21752 at T (chrome-extension://hegiignepmecppikdlbohnnbfjdoaghj/thirdparty/pratikabu-jquery-3.2.1.min.js:3:544) at r.fn. [as height] (chrome-extension://hegiignepmecppikdlbohnnbfjdoaghj/thirdparty/pratikabu-jquery-3.2.1.min.js:4:21576) at Object.addRemoveGlobalHandlers (chrome-extension://hegiignepmecppikdlbohnnbfjdoaghj/pratikabu-stt.js:573:32) at Object.loadFromResponse (chrome-extension://hegiignepmecppikdlbohnnbfjdoaghj/pratikabu-stt.js:556:17) at chrome-extension://hegiignepmecppikdlbohnnbfjdoaghj/browserspecific/pratikabu-stt-impl.js:9:17 insert-link-icons.js:181 [Deprecation] Listener added for a synchronous 'DOMNodeInserted' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead. /favicon.ico:1 Failed to load resource: the server responded with a status of 403 (Forbidden) 

sfd99 commented 10 months ago

Hi Onozaty,

Hey, thanks for your great support!.

My Pinboard bookmarks file is huge... MBs. ie: not practical to scan visually, by hand...

Although it does not contain any sensitive or confidential info., only Physics, Math, etc. bookmarks mainly in English, some in other languages.

It has not been "Public" since I started it, (20+ years ago, when Pinboard itself started !).

I'm exploring and hopefully learning, other ways to detect ( in the XML file ?), any "special characters" causing this trouble in Pinboard.

I think you are absolutely right. That IS the problem.

I will report back to you if and what I've discovered.

Thanks again, Onozaty!.

onozaty commented 10 months ago

Hi @sfd99

Can you provide me with an XML file? If you can give me the XML file that causes the error in Chrome, I would be able to check it on my end.

sfd99 commented 10 months ago

Thanks Onozaty!.

ok, I'll be sending you the private XML file (it's very BIG, 28 MBs!), directly to your email addr.

We've communicated in the past via your email, so I'll switch to that +secure.

onozaty commented 10 months ago

I would like to leave the results of my check here as I think it will be useful information for others.

onozaty commented 10 months ago

Apparently, it contains control codes that are not allowed in XML 1.0.

With XML 1.0, only 0x09 0x0A 0x0D is allowed in the C0 control code.

onozaty commented 10 months ago

Please be patient as we work out how to replace the incorrect characters.

onozaty commented 10 months ago

Hi @sfd99

A working procedure has been established.

Use filep, a tool I created some time ago, to replace illegal characters. Please download the appropriate one for your execution environment from the following.

The following command will replace it. input.xml is the file before conversion and output.xml is the file after conversion.

filep replace -i input.xml -o output.xml -r "[\x00-\x08\x0B\x0C\x0E-\x1F]" -t ""

Thanks.

sfd99 commented 10 months ago

ok - will try running filep next!.

sfd99 commented 10 months ago

1) OK! ran filep on my latest xml local bkms. file.

Less than 1 second later...DONE. :-) "output.xml" file is ready.

I uploaded the new bookmarks file:
output.xml directly to PINBOARD.

PINB Message: "...wait a few minutes for the update ... ".

Then... I'll test the extension again, and report the results.

2) By the way, it would be VERY NICE if users could perform a SEARCH test and access their downloaded PINB bookmarks on their own PC, LOCALLY with the extension: " Online Bookmark Incremental Search "

Just an idea... :-)

sfd99 commented 10 months ago

Ok - after uploading the new filep "output.txt" file and then trying to Sync, the extension reports:

" Load bookmarks Bookmarks loading is failed. (500:Internal Server Error) ".

I tried Sync again, this time: " Bookmarks loading is failed. (200:OK) "

So, whatever problem it is, it's difficult to identify.

But...more than ever... it would be VERY NICE if users could perform a SEARCH test and access their downloaded PINBOARD bookmarks file on their own PC, LOCALLY with the extension: " Online Bookmark Incremental Search ".

That is exactly my "Use case"!...

I D/L frequently a backup of all my Pinboard bookmarks in HTML, JSON and XML file formats.

If the great extension: " Online Bookmark Incremental Search " could actually read and search the local, downloaded Pinboard.XML file in my HD directly, that would be EXCELLENT!.

And users could bypass the PINB API access - obviously a problem to some of us.

What's your opinion, Onozaty?.

onozaty commented 10 months ago

Sorry, this extension is designed to work with other bookmarking services, so I do not consider using local files. Also, if there is a problem with the XML file itself, loading it as a local file will not solve the problem.

Please give me the XML file of the bookmarks currently registered in Pinboard so that I can investigate the cause of the error again.

sfd99 commented 10 months ago

Yes, I do understand the main objective of the extension.

Ok, as requested, will send the XML file of the bookmarks currently registered in Pinboard (the output of filep).

onozaty commented 10 months ago

It looks fine as XML.

When you get the error, I believe the error also appears in the browser's DevTools Console, so could you please provide that information?

sfd99 commented 10 months ago

After trying SYNC and get the mssg:

Load bookmarks Bookmarks loading is failed. (200:OK)

I opened the Chrome Inspector and the Console Tab shows:

By the way I tried using the extension and doing SYNC also in the CHROMIUM and FIREFOX browsers (which have no other extensions), and they both also return the same mssg after SYNC:

Load bookmarks Bookmarks loading is failed. (200:OK).

...so the problem does not seem to be related to CHROME...

And, as you just confirmed, the XML file is also fine...

onozaty commented 10 months ago

I don't know why, so I will try to output some more information on the extension side. Please wait a while until we release a supported version.

onozaty commented 10 months ago

Hi @sfd99

Thank you for your patience. I have released a new version, could you please check how the error is displayed using this one?