wallabag / wallabagger

Chrome / Firefox / Opera plugin for wallabag v2.
http://wallabag.github.io/wallabagger/
MIT License
365 stars 47 forks source link

Cannot get Token (Not Granted) #149

Closed Vitriia closed 5 years ago

Vitriia commented 5 years ago

Hi,

I cannot get Token, i have "Not granted" error. I have activated debug. Nothing happened when i submit credentials for token (no log into debug screen). But when i go into the Wallabagger option page (from about:addons) i get those errors into debug screen

TypeError: this._tabPool is null                                                                            browsing-context.js:1480:5
msg.target.ownerGlobal.gBrowser.getTabForBrowser is not a function                                          LoginManagerParent.jsm:135
receiveMessage  resource://gre/modules/LoginManagerParent.jsm:135:25
receiveMessage  jar:file:///usr/lib/firefox/browser/omni.ja!/components/nsBrowserGlue.js:256:15
receiveMessage  self-hosted:1031:17
TypeError: this._tabPool is null                                                                            browsing-context.js:1480:5

Wallabagger: 1.5.0 Wallabag: 2.3.2 (Can't update to 2.3.3 actually) OS: Ubuntu 18.04.1 LTS Firefox: 62.0.3 (64bits)

Simounet commented 5 years ago

Hi, Do you have any addons that could break this? I can't see any reference to wallabagger on your error messages. Can you try it on a fresh Firefox profile please?

Vitriia commented 5 years ago

Hi, I have tried with all addon disabled

It works with a fresh profile

Simounet commented 5 years ago

It doesn't work with all addon disabled? Do you have Umatrix?

Vitriia commented 5 years ago

Doesn't work with all addon disabled. I have try :

I haven't Umatrix. My addon who can break this :

Rurik19 commented 5 years ago

If It works with a fresh profile = try this:

So you can find who blocks wallabagger.

Najrim commented 5 years ago

I had this problem too a couple of days ago. Making a new profile worked. Yesterday I updated Firefox to 63.0 and again, I can't save to Wallabag and can't get a new Token in the Wallabagger preferences in about:addons. It says "Wallabag API token: Not granted". Not sure how to view log. Should I activate "Enable this only developers told you to" and then look in Browser Console"?

Like @Vitriia I have tried disabling addons (Privacy Badger, https everywhere, uBlock). And the preferences say "Wallabag API version 2.3.2.

@Vitriia, have you got it working for you? Have you updated Firefox?

Simounet commented 5 years ago

You can try this:

Najrim commented 5 years ago

Activating "Enable this only if developers told you to" is to enable debug mode, right? This is all I get:

postMessage: {"response":"info","text":"Saving the page to wallabag…"} background.js:186:23
unknown message: [object Object] options.js:381:21
Najrim commented 5 years ago

@Simounet, in the last point you say that a window will be opened when I add something through the context menu. What kind of window? For me, the only thing that happens is that the wallabagger icon turns yellow then red.

Najrim commented 5 years ago

Some more info that might be relevant. This shows up before I do anything with wallabag:

InvalidStateError: RTCPeerConnection is gone (did you enter Offline mode?)

And I get this if I actually press the Wallabag button instead of using the context menu:

The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol. popup.html
postMessage: {"response":"setup","data":{"Url":"<redacted>","ApiVersion":"2.3.2","ClientId":"<redacted>","ClientSecret":"<redacted>","UserLogin":"<redacted>","UserPassword":"<redacted>","ApiToken":"<redacted>","RefreshToken":"<redacted>","ExpireDate":1541355134772,"isTokenExpired":false,"AllowSpaceInTags":false,"AllowExistCheck":false,"Debug":true}} background.js:186:23
postMessage: {"response":"info","text":"Saving the page to wallabag…"} background.js:186:23 
Najrim commented 5 years ago

It all of a sudden started working for me again. I guess it's the November 4 update. So if @Vitriia doesn't protest, I guess the issue might as well be closed.

rushsteve1 commented 5 years ago

I am also having this issue and cannot seem to fix it. Disabling all addons or using a fresh profile doesn't seem to work. This is with a self hosted Wallabag that works with the Android app and has worked previously on other computers.

browser: Firefox 63.0.3 extension version: 1.5.0 wallabag server version: 2.3.2 OS: OpenSUSE Tumbleweed

Simounet commented 5 years ago

Can you follow there steps please?

You can try this:

* enable the debug mode into the wallabagger settings

* go to about:debugging#addons

* check in Enable add-on debugging

* click on wallabag debug link

* click on ok to accept incoming connections

* add some page through the context-menu

* give us the entries on the console tab of the new window opened
rushsteve1 commented 5 years ago

So I have actually figured out why the token is not granted. It will not grant a token, or allow me to save articles with Wallabager, if I am currently logged into the Wallabag web interface. I use LDAP for authentication and being logged into anything as part of the SSO causes the extension to break. As soon as a log out it works again.

I will still post the logs if you want them. Let me know if you want the logs from when it is functional or non-functional.

Najrim commented 5 years ago

Reporting back so there's no confusion: turns out it broke again for me. I guess it worked before because I wasn't logged in. Trying it now resulted in the old error. Logging out, like @rushsteve1 says, fixes it again.

Thatoo commented 5 years ago

I have the exact problem with my configuration. I host wallabag thanks to yunohost (LDAP and SSO). If I'm logged in yunohost, which I need because I use searx with it, then I can't use wallabagger. To be able to use wallabagger (and also to make wallabagger accept the token), I have to be logged out from yunohost.

Simounet commented 5 years ago

@rushsteve1 Could you please share your logs with us, please?

Thatoo commented 5 years ago

Which logs do you need, wallabag or wallabager? For wallabag, inside yunohost, I can access log of mysql or nginx or php7.0-fpm for that app. For wallabagger, I don't know how to get logs.

Najrim commented 5 years ago

@Thatoo, See Simon's reply for how to get Wallabagger logs:

Can you follow there steps please?

You can try this:

* enable the debug mode into the wallabagger settings

* go to about:debugging#addons

* check in Enable add-on debugging

* click on wallabag debug link

* click on ok to accept incoming connections

* add some page through the context-menu

* give us the entries on the console tab of the new window opened

I already tried it for myself but there was nothing of value in the log.

Thatoo commented 5 years ago

Error: Failed to check if exists https://leprette.fr/jaimecesarticles-wallabag/api/entries/exists.json?url=https://leprette.fr/yunohost/sso/ Failed to refresh token https://leprette.fr/jaimecesarticles-wallabag/oauth/v2/token undefined wallabag-api.js:247:23 details.requestBody is null background.js:288 setDownloadHooks/< moz-extension://9f24bee8-5351-479e-8074-a10c6b1875a3/background.js:288:13 apply self-hosted:4619:5 applySafeWithoutClone resource://gre/modules/ExtensionCommon.jsm:470:16 fire resource://gre/modules/ExtensionChild.jsm:941:28 receiveMessage resource://gre/modules/ExtensionChild.jsm:944:38 _callHandlers/< resource://gre/modules/MessageChannel.jsm:876:29 _callHandlers resource://gre/modules/MessageChannel.jsm:875:14 _handleMessage/deferred.promise< resource://gre/modules/MessageChannel.jsm:952:7 _handleMessage resource://gre/modules/MessageChannel.jsm:949:24 _handleMessage self-hosted:977:17 receiveMessage/< resource://gre/modules/MessageChannel.jsm:218:9 forEach self-hosted:262:13 receiveMessage resource://gre/modules/MessageChannel.jsm:211:5 Error: Failed to check if exists https://leprette.fr/jaimecesarticles-wallabag/api/entries/exists.json?url=https://github.com/wallabag/wallabagger/issues undefined wallabag-api.js:247:23 error occurred while processing 'sources: TypeError: can't access dead object Stack: createNonSourceMappedActor@resource://devtools/shared/base-loader.js -> resource://devtools/server/actors/utils/TabSources.js:311:5 createSourceActors/<@resource://devtools/shared/base-loader.js -> resource://devtools/server/actors/utils/TabSources.js:399:21 Line: 311, column: 5 main.js:1576 _unknownError resource://devtools/server/main.js:1576:5 _queueResponse/responsePromise< resource://devtools/server/main.js:1605:27

Thatoo commented 5 years ago

Do these logs help to explain why it's not working the way expected?

Issue reported to the wallabag_2 yunohost fork : https://github.com/YunoHost-Apps/wallabag2_ynh/issues/58

Thatoo commented 5 years ago

I have tried that fix, https://github.com/wallabag/wallabagger/pull/160 , and it works like a charm! Thank you @stan3. Hopefully wallabager 1.5.1 with this fix will be released soon.