rtv icon indicating copy to clipboard operation
rtv copied to clipboard

rtv goes to lunch when login browser fails and stays frozen

Open ghost opened this issue 5 years ago • 0 comments

Describe the bug When I hit u to login, it tries to launch a browser but the browser errors because it cannot find my profile: browser_hang I will troubleshoot that browser issue separately (which may not be an rtv problem). But rtv should not go to lunch. When the browser fails to function, rtv remains frozen with "Opening browser for authentication..." in the middle of the screen (same screen as captured in #668). I must control-c to kill it off. And after killing rtv that way, the shell is also left in a hosed state where commands being entered are not echoed back.

Note that if I do not login, and simply try to view an article in the browser (which fails for the same reason), rtv recovers from that. It does not hang in a frozen state in that case.

Describe your environment Running this is a non-starter: $rtv --debug-info (that option is not recognized).

I'm running rtv in a firejail sandbox, as follows:

firejail --net=tornet --dns="$mydns"\
             --whitelist="${mycfg_file%/*}" --whitelist="$my_logs\
             --whitelist="$mydata"/rtv --whitelist="$HOME"/.local/share/rtv\
             --whitelist="$HOME"/.mozilla/firefox\
             --env=XDG_DATA_HOME="$mydata"\
             --allow-debuggers strace -o "$strace_logfile" -f\
             rtv --config "$mycfg_file" ${http_logfile:+--log "$http_logfile"} 

The http log contains:

INFO:__main__.py:131:Environment: [('$DISPLAY', ':0'), ('$TERM', 'screen.xterm-256color'), ('$LANG', 'en_US.UTF-8'), ('$XDG_CONFIG_HOME', None), ('$XDG_DATA_HOME', None), ('$RTV_EDITOR', None), ('$RTV_URLVIEWER', None), ('$RTV_BROWSER', None), ('$BROWSER', None), ('$RTV_PAGER', None), ('$PAGER', None), ('$VISUAL', None), ('$EDITOR', 'emacs')]
INFO:__main__.py:155:RTV module path: /usr/lib/python3/dist-packages/rtv/__main__.py
INFO:__main__.py:160:Using packaged PRAW distribution, commit 1656ec224e574eed9cda4efcb497825d54b4d926
DEBUG:connectionpool.py:811:Starting new HTTPS connection (1): api.reddit.com
DEBUG:connectionpool.py:400:https://api.reddit.com:443 "GET /.json?limit=1024 HTTP/1.1" 200 75246

Note as well that the http log itself is erroneous. $XDG_DATA_HOME is set (as you can see from the firejail command) but rtv lies. That's likely another unrelated bug.

When rtv is in this hung state and I do a ps -edfH, there is no child process of rtv. So firefox has terminated but rtv fails to realize it.

possible fix

IMO rtv should not be launching a GUI browser to login in the first place. Implementing enhancement request #371 would kill this bug (#667).

version

rtv 1.25.1

ghost avatar Mar 29 '19 10:03 ghost