dickmao / nnreddit

A Gnus backend for Reddit
70 stars 5 forks source link

401's on reading new news #79

Open AriT93 opened 3 years ago

AriT93 commented 3 years ago

midday on 7/6/21 I started to receive 401's when pulling new headers

Warning: nnreddit-rpc-call: nnreddit-rpc-request: (:code -32603 :message Internal error :data An invalid value was specified for display_name. Check that the argument for the display_name parameter is not empty.); nnreddit-rpc-call: nnreddit-rpc-request: (:code -32603 :message Internal error :data An invalid value was specified for display_name. Check that the argument for the display_name parameter is not empty.); nnreddit-rpc-call: nnreddit-rpc-request: (:code -32603 :message Internal error :data received 401 HTTP response); nnreddit-rpc-call: nnreddit-rpc-request: (:code -32603 :message Internal error :data received 401 HTTP response); nnreddit-rpc-call: nnreddit-rpc-request: (:code -32603 :message Internal error :data received 401 HTTP response)

I see this on two machines now.

Steps I've taken.

removed the virtualenv and revoked nnreddit from reddit account. restarted gnus to recreate the virtualenv and reconnect to redit. the env is created but no oauth setup runs. Is there a method to call that will kick off the oauth setup again?

dickmao commented 3 years ago

Yes, I'm getting the same starting today. I wonder what happened.

AriT93 commented 3 years ago

looks like they just started enforcing tls1.2 on the api but that is the only real change I see. Not familiar with the nnreddit code itself but will look through it this afternoon. not sure if I'll find anything though.

AriT93 commented 3 years ago

Well, I was unable to find anything.

I suspect there may be an issue with praw that is failing the oauth setup. After deleting the virtualevn and revoking the nnreddit app in my profile on reddit I would have expected to be prompted to re-authorize with reddit. However that step never happened.

It looks like the start of that process also gets a 401 with the 32603 error above. I have not been able to find any documentation about what that error could mean.

did the nnreddit client id/secret get changed or denied?

AriT93 commented 3 years ago

ok I deleted the refresh token set up originally in ~/.local/nnreddit/refresh-token. after that it attempted to reauth me but I got an error page that said an invalid client_id was provided

https://www.reddit.com/api/v1/authorize?client_id=KBV2seGZgHOa9g&duration=permanent&redirect_uri=http%3A%2F%2F127.0.0.1%3A17973&response_type=code&scope=edit+history+identity+mysubreddits+privatemessages+read+report+save+submit+subscribe+vote&state=34527

dickmao commented 3 years ago

Thanks for your nontrivial investigation. I believe something changed at Reddit HQ.

I reported my suspicions to https://github.com/praw-dev/praw/pull/1757

Deleting the refresh-token in ~/.local/share/nnreddit/refresh-token was a necessary but not quite sufficient thing to get things working for me. The current README describes one possible path to salvation.

AriT93 commented 3 years ago

Thank you for looking into this! can confirm the new version works as expected on Mac and Linux again.

dickmao commented 3 years ago

Please refer to the README on next steps. As you appear to be the only nnreddit user other than myself, I was hoping you could confirm the new version works outside my finely tuned bubble.

AriT93 commented 3 years ago

LOL it's a pretty exclusive club. I can confirm that this works on both my mac laptop and my linux desktop. Updated the package and deleted the refresh-token and was able to reauthenticate.

bcollison commented 3 years ago

šŸ¤£ I too was experiencing this issue, and have been following this ticket. The fix worked for me as well. I appreciate the effort! GNU Emacs 27.2 (build 1, x86_64-apple-darwin20.5.0, NS appkit-2022.50 Version 11.4 (Build 20F71)) of 2021-06-02

AriT93 commented 3 years ago

GNU Emacs 28.0.50 (build 4, x86_64-apple-darwin20.5.0, NS appkit-2022.50 Version 11.4 (Build 20F71)) of 2021-07-06

is my build. still master but a few days older on the linux box

harizvi commented 3 years ago

Fwiw, I came looking for the same issue. I use nnreddit installed through melpa, and confirrming that it is now working with the update on melpa.

@dickmao thanks for this package, saves me plenty of time, and much more efficient looking at reddit through gnus.

namtsui commented 3 years ago

thanks. I had the same issue and this fixes it for me on openbsd.