m1guelpf / chatgpt-telegram

Run your own GPTChat Telegram bot, with a single command!
MIT License
3.9k stars 560 forks source link

Error: Couldn't get access token #71

Closed hiifeng closed 1 year ago

hiifeng commented 1 year ago

Using the latest v0.2.4 version, the bot replies: Error: Couldn't get access token: failed to decode response: invalid character '<' looking for beginning of value Does anyone know what is the reason? Is it because OpenAI added cloudflare?

R0uter commented 1 year ago

same here with the docker img

alastone commented 1 year ago

同样的问题

a1gx commented 1 year ago

same question

bwmgd commented 1 year ago

same question

jchby commented 1 year ago

same error

tianlichunhong commented 1 year ago

I think it is blocked by OpenAI. It doesn't want to be used too much.

Wandering-Consciousness commented 1 year ago

Same issue here. Something changed on the OpenAI side in the last day or so.

MichaelCutro commented 1 year ago

@dhilman Any updates on this? Going to try and run it on a vm tomorrow but I am getting the same error on M1

MichaelCutro commented 1 year ago

The error is coming from line 148 of chatgpt.go - "failed to decode response: invalid character '<' looking for beginning of value" suggests that the response received from the OpenAI API when the bot attempts to retrieve an access token is not a valid JSON object, but instead contains an HTML page or other invalid content. This could be caused by a number of issues, such as a misconfigured server or endpoint, a network connectivity problem, or an issue with the bot's code or configuration.

gaeduf commented 1 year ago

so how can we solve this problem?

alastone commented 1 year ago

那么我们如何解决这个问题呢?

It's caused by the addition of cloudflare protection

win0113 commented 1 year ago

同样的问题

+1

llegomark commented 1 year ago

Just a few hours ago, OpenAI integrated Cloudflare security into their system.

BlueSkyLT commented 1 year ago

Same issue.

msilenkov commented 1 year ago

Maybe we should plug in here, then. https://beta.openai.com/playground

:)

root-wang commented 1 year ago

image you can this
image

Xiefengshang commented 1 year ago

It seems to be the problem of Cloudflare Captcha. How about adding browser plugin?

llegomark commented 1 year ago

Aside from Cloudflare, ChatGPT no longer outputs long-form content, if you hit the limit, it will throw a network error, or the CLI Response not in correct format! peer closed connection without sending complete message body (incomplete chunked read)

hiifeng commented 1 year ago

Aside from Cloudflare, ChatGPT no longer outputs long-form content, if you hit the limit, it will throw a network error, or the CLI Response not in correct format! peer closed connection without sending complete message body (incomplete chunked read)

Yes, you are quite right. I also found this problem, when I use https://chat.openai.com/chat, "network error" also occurs. I am not familiar with the go language, is there a solution?

Just a moment...
gitk01n commented 1 year ago

you are quite right ,inside cf_cf_clearance token

taxueqinyin commented 1 year ago

get refreshAccessToken is 403 forbidden,because open ai does man-machine validation on the request,i thought we should find a way to around it

waltcow commented 1 year ago

https://github.com/acheong08/ChatGPT/issues/261

m1guelpf commented 1 year ago

Closing in favor of #69 to keep everything in one place

MichaelCutro commented 1 year ago

Aside from Cloudflare, ChatGPT no longer outputs long-form content, if you hit the limit, it will throw a network error, or the CLI Response not in correct format! peer closed connection without sending complete message body (incomplete chunked read)

Yes, you are quite right. I also found this problem, when I use https://chat.openai.com/chat, "network error" also occurs. I am not familiar with the go language, is there a solution?

Just a moment...

I'm not very familiar with Go either but I have built bots in the past and gotten past Cloudflare with Puppeteer-extra I don't think this is a Cloudflare problem though rather the incomplete chunked read that @llegomark mentioned above

Just a moment...