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

"Please check your browser", but no browser tab appears #94

Open
antrmn opened this issue Jan 11, 2024 · 6 comments
Open

"Please check your browser", but no browser tab appears #94

antrmn opened this issue Jan 11, 2024 · 6 comments

Comments

@antrmn
Copy link

antrmn commented Jan 11, 2024

Hi, I don't know if this still works due to Reddit API restrictions, but I wanted to give it a try. I installed the package using Cask but whenever I perform any action (opening gnus with the nnreddit backend for the first time, call a nnreddit interactive command) I can't seem to get forward in the authentication process. This is the output in the Emacs message buffer:

nnreddit-rpc-request: send {"jsonrpc":"2.0","method":"canonical_spelling","id":1,"params":{"args":["sss"],"kwargs":{}}}
nnreddit-default: Please check your browser.
nnreddit-sentinel: process /home/antonio/.virtualenvs/nnreddit-0.2.1-python3/bin/python exited abnormally with code 1
nnreddit-rpc-call: ‘nnreddit-rpc-request’: response timed out
Opening nnreddit server...done
nnreddit-rpc-request: send {"jsonrpc":"2.0","method":"user_attr","id":1,"params":{"args":["name"],"kwargs":{}}}
nnreddit-default: Please check your browser.
nnreddit-sentinel: process /home/antonio/.virtualenvs/nnreddit-0.2.1-python3/bin/python exited abnormally with code 1
nnreddit-rpc-call: ‘nnreddit-rpc-request’: response timed out
nnreddit-rpc-request: send {"jsonrpc":"2.0","method":"comments","id":1,"params":{"args":[""],"kwargs":{}}}
nnreddit-default: Please check your browser.
nnreddit-sentinel: process /home/antonio/.virtualenvs/nnreddit-0.2.1-python3/bin/python exited abnormally with code 1
nnreddit-rpc-call: ‘nnreddit-rpc-request’: response timed out
nnreddit-rpc-request: send {"jsonrpc":"2.0","method":"submissions","id":1,"params":{"args":[""],"kwargs":{}}}
nnreddit-default: Please check your browser.
nnreddit-sentinel: process /home/antonio/.virtualenvs/nnreddit-0.2.1-python3/bin/python exited abnormally with code 1
nnreddit-rpc-call: ‘nnreddit-rpc-request’: response timed out
nnreddit-request-scan: : +0 comments +0 submissions
nnreddit-request-group: 211 0 1 0 
nnreddit-request-group: seen-id=nil          seen-index=nil -> 1
nnreddit-request-group: seen-id-to-be=nil seen-index-to-be=1 delta=0
nnreddit-request-group: read-ranges=nil shifted-read-ranges=nil
nnreddit-request-group: mark-ranges=nil shifted-mark-ranges=nil
nnreddit-request-group: new info=(nnreddit: 3 nil nil (nnreddit ) nil)
Retrieving newsgroup: nnreddit:...
20240111T151714.778> Opening nnreddit server...done
20240111T151714.779> nnreddit-request-group: 211 0 1 0 
20240111T151714.779> nnreddit-request-group: seen-id=nil          seen-index=nil -> 1
20240111T151714.779> nnreddit-request-group: seen-id-to-be=nil seen-index-to-be=1 delta=0
20240111T151714.779> nnreddit-request-group: read-ranges=nil shifted-read-ranges=nil
20240111T151714.780> nnreddit-request-group: mark-ranges=nil shifted-mark-ranges=nil
20240111T151714.780> nnreddit-request-group: new info=(nnreddit: 3 nil nil (nnreddit ) nil)
No more unread newsgroups
Group nnreddit: contains no messages

I tried defining and calling the open_url_silent function in an inferior Python shell in Emacs and it successfully creates a new tab in Firefox.

I'm using

  • Emacs 29.1
  • Python 3.11
  • GNOME 45
  • openSUSE TumbleWeed

What could be the issue? Thanks in advance

@dickmao
Copy link
Owner

dickmao commented Jan 12, 2024

nnreddit-sentinel: process /home/antonio/.virtualenvs/nnreddit-0.2.1-python3/bin/python exited abnormally with code 1

The python module is failing.

You can try M-x customize-option RET nnreddit-log-rpc, then retry, and hope the error shows up in /tmp/nnreddit-rpc-log.hhmmss. There are also HIDDEN stdout and stderr buffers *nnreddit-default-stderr* and *nnreddit-default*. Note the space preceding both those buffer names.

@antrmn
Copy link
Author

antrmn commented Jan 12, 2024

Hi, thank you for the quick reply. Here are the output from the mentioned targets:

Output of nnreddit-rpc-log.20240112.114136:

Refresh token: /home/antonio/.local/share/nnreddit/refresh-token

Output of *nnreddit-default-stderr*

Process nnreddit-default stderr finished
::user::Please check your browser.
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/antonio/.config/emacs/elpa/nnreddit-0.2.1/nnreddit/__main__.py", line 25, in <module>
    jsonrpyc.RPC(target=AuthenticatedReddit(check_for_updates=False,
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/antonio/.config/emacs/elpa/nnreddit-0.2.1/nnreddit/authenticated_reddit.py", line 133, in __init__
    raise BrowserError(
rtv.exceptions.BrowserError: Timeout waiting for browser to open
Process nnreddit-default stderr finished

The *nnreddit-default* buffer is empty.

@dickmao
Copy link
Owner

dickmao commented Jan 12, 2024

In that inferior python shell you mentioned, what do you see for:

Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.7.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import webbrowser

In [5]: webbrowser.open_new_tab("https://google.com")
Out[5]: True

In [6]: webbrowser._tryorder
Out[6]: 
['xdg-open',
 'firefox',
 'google-chrome',
 'chromium',
 'www-browser',
 'lynx',
 'w3m']

@antrmn
Copy link
Author

antrmn commented Jan 12, 2024

Python 3.11.6 (main, Nov 15 2023, 09:22:27) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import webbrowser
>>> webbrowser.open_new_tab("https://google.com")
True
>>> webbrowser._tryorder
['firefox', 'xdg-open', 'gio', 'epiphany', 'chromium', 'chromium-browser', 'w3m']
>>> 

The tab opens with no issue.

I could settle by providing the authentication token manually, if it proves difficult or time consuming to find out the cause

@dickmao
Copy link
Owner

dickmao commented Jan 12, 2024

There are some sys.audit calls in webbrowser.py that might shed some light, but I imagine neither of us has the patience to figure out sys.addaudithook. Sorry, we couldn't make it happen. Thanks for trying.

@antrmn
Copy link
Author

antrmn commented Jan 12, 2024

No problem, I created a ticket hoping that this issue could easily be reproduced in order to facilitate the troubleshooting. This has not been the case, but I'll investigate further when I can and leave an update below.

Thank you for trying, too (and for nnreddit, of course!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants