ChatGPT icon indicating copy to clipboard operation
ChatGPT copied to clipboard

Failed to Refresh Session

Open easyssss opened this issue 2 years ago • 41 comments

Upon using the "python3 -m revChatGPT" command I get the following response: Logging in... Spawning browser... Browser spawned. Found Cloudflare Cookie! Failed to refresh session! Failed to refresh session! Failed to refresh session!

With the "failed to refresh session!" repeating infinitely.

Output --debug results in the same output

easyssss avatar Jan 02 '23 02:01 easyssss

I am getting the same. Although, it is my first time using this.

PortRoyale avatar Jan 02 '23 02:01 PortRoyale

Yup, started to see this, as well. Probably a new CF protection I've seen on my other app

Jamminroot avatar Jan 02 '23 02:01 Jamminroot

Happening occasionally for me as well. Not sure what the exact cause is as it is inconsistent.

acheong08 avatar Jan 02 '23 06:01 acheong08

+1 happening consistently for me today after 3 days of uptime without issue. Have tried clearing browser cache and re-initiating the session several times.

mediacutlet avatar Jan 02 '23 15:01 mediacutlet

Seeing this too. Has anyone solved this problem?

randyzhao avatar Jan 02 '23 22:01 randyzhao

Hmm I think I know whats causing this. the session refresh call generates a new session token and expires the previous one, but its hard to grab the real session token since the website constantly refreshes the token. If the session token is not real, it cant refresh the token

DiamondDemon669 avatar Jan 03 '23 02:01 DiamondDemon669

I think you might need to close the site the moment you get your session token to prevent it from refreshing outside of revChatGPT

acheong08 avatar Jan 03 '23 02:01 acheong08

Seeing this too. Has anyone solved this problem?

mixand avatar Jan 03 '23 13:01 mixand

@acheong08 I tried what you suggested a few times, the moment I see "cookie found" I close the browser and the issue persists. Good thought though. Have you had success with this strategy? Is it perhaps just precise timing?

mediacutlet avatar Jan 03 '23 14:01 mediacutlet

It very rarely happens to me and trying a few times usually gets things working. The reason I haven't fixed this is because I have no way of debugging something that only happens to myself 1% of the time.

acheong08 avatar Jan 03 '23 14:01 acheong08

I really need some help with debugging cases where I can't replicate

acheong08 avatar Jan 03 '23 14:01 acheong08

Sure, I'm interested in helping you sort this out, just let me know what kind of info you'd need. Started to happen to me 100% of times a few days ago

Jamminroot avatar Jan 03 '23 14:01 Jamminroot

Not sure how helpful this is @acheong08 but here is a screencapture of my experience: https://mediacutlet.com/git/132023.mp4

mediacutlet avatar Jan 03 '23 14:01 mediacutlet

Not sure how helpful this is @acheong08 but here is a screencapture of my experience: mediacutlet.com/git/132023.mp4

Why are you trying to log in manually? Do not click the buttons. If you want to log in, you must use config.json to specify your email and password

acheong08 avatar Jan 03 '23 14:01 acheong08

Sure, I'm interested in helping you sort this out, just let me know what kind of info you'd need. Started to happen to me 100% of times a few days ago

Can you tweak the code to show response codes and response text?

acheong08 avatar Jan 03 '23 14:01 acheong08

Need to know if it's a cloudflare 403 or OpenAI 404 or something else entirely

acheong08 avatar Jan 03 '23 14:01 acheong08

Not sure how helpful this is @acheong08 but here is a screencapture of my experience: mediacutlet.com/git/132023.mp4

Why are you trying to log in manually? Do not click the buttons. If you want to log in, you must use config.json to specify your email and password

I use Google to authenticate, no password; I'll create another account using email and password and try again. Even if nothing is clicked, the issue exists. I'll tweak to print response codes and do another recording.

mediacutlet avatar Jan 03 '23 14:01 mediacutlet

Google is not supported at the moment. If you try to use Google, everything will fail. You can use session tokens instead which you can obtain if you are logged in via Google. Check the https://github.com/acheong08/ChatGPT/wiki/Setup for instructions on how to get that

acheong08 avatar Jan 03 '23 14:01 acheong08

It seems that the issue here is that you did not provide a session token

acheong08 avatar Jan 03 '23 14:01 acheong08

Google is not supported at the moment. If you try to use Google, everything will fail. You can use session tokens instead which you can obtain if you are logged in via Google. Check the https://github.com/acheong08/ChatGPT/wiki/Setup for instructions on how to get that

This is how I have it set up. Perhaps the token expired an I need to generate a new one manually?

mediacutlet avatar Jan 03 '23 14:01 mediacutlet

Yes. You have to update the session token every now and then

acheong08 avatar Jan 03 '23 14:01 acheong08

Yes. You have to update the session token every now and then

Got it. Makes sense. Hope this helps others as well. Thanks for your work on this!!

mediacutlet avatar Jan 03 '23 14:01 mediacutlet

Still waiting for the refresh thing to happen

Jamminroot avatar Jan 03 '23 14:01 Jamminroot

Not sure what's going on. Im not getting anywhere:

[2023-01-03 15:09:48,259] WARNING        {connectionpool.py:812}                Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fecfc3ed870>: Failed to establish a new connection: [Errno 111] Connection refused')': /session/90c7f1d037c40ef347fca60faeb9f68d/se/log

I'll come back here with an update later today when I figure this out.

Jamminroot avatar Jan 03 '23 15:01 Jamminroot

It appears that in my case the issue was that I tried to run multiple instances of ChatGPTrev clients (2). Both of those were via session_tokens. If I only run one at a time, it seem to work

Jamminroot avatar Jan 03 '23 16:01 Jamminroot

Manually updating my session token in config.json fixed my issue.

mediacutlet avatar Jan 03 '23 16:01 mediacutlet

The same error happened to me. Obtaining a session token from Chrome's incognito window fixed it.

lijiazheng99 avatar Jan 03 '23 21:01 lijiazheng99

I'm running it using an email + password config with 2captcha and for me, the session token failed to refresh after a day of running it constantly

fsnaix avatar Jan 04 '23 02:01 fsnaix

That is currently a flaw. I need to check for outdated tokens and log in again via status codes. Anyone know the status code or expired tokens?

acheong08 avatar Jan 04 '23 02:01 acheong08

It should be a simple matter of

if response.status_code == <status code>:
	self.config["session_token"] = None
	self.email_login()

something like that (assuming email/password set)

acheong08 avatar Jan 04 '23 02:01 acheong08