RainEggplant / chatgpt-telegram-bot

A ChatGPT bot for Telegram based on Node.js. Support both browserless and browser-base APIs.
MIT License
322 stars 97 forks source link

TimeoutError: Waiting for selector `#__next .btn-primary` failed #5

Closed NuperSu closed 1 year ago

NuperSu commented 1 year ago

I get this error when I try to run docker:

chatgpt-telegram-bot-app-1  | > chatgpt-telegram-bot@1.0.4 start /app
chatgpt-telegram-bot-app-1  | > node dist/index.js
chatgpt-telegram-bot-app-1  | 
chatgpt-telegram-bot-app-1  | TimeoutError: Waiting for selector `#__next .btn-primary` failed: Waiting failed: 180000ms exceeded
chatgpt-telegram-bot-app-1  |     at Timeout.<anonymous> (/app/node_modules/.pnpm/registry.npmmirror.com+puppeteer-core@19.6.3/node_modules/puppeteer-core/lib/cjs/puppeteer/common/WaitTask.js:65:32)
chatgpt-telegram-bot-app-1  |     at listOnTimeout (node:internal/timers:564:17)
chatgpt-telegram-bot-app-1  |     at process.processTimers (node:internal/timers:507:7)
chatgpt-telegram-bot-app-1  |  ELIFECYCLE  Command failed with exit code 1.
chatgpt-telegram-bot-app-1 exited with code 1

Tried rebuilding docker image but it didn't help.

RainEggplant commented 1 year ago

This may be due to the fact that chatgpt is currently in high demand and the login page will not show at this time. Try again after a while and see if the problem persists.

VectorZhao commented 1 year ago

> chatgpt-telegram-bot@1.0.5 start /app
> node dist/index.js

TimeoutError: Waiting for selector `#__next .btn-primary` failed: Waiting failed: 180000ms exceeded
    at Timeout.<anonymous> (/app/node_modules/.pnpm/registry.npmmirror.com+puppeteer-core@19.6.3/node_modules/puppeteer-core/lib/cjs/puppeteer/common/WaitTask.js:65:32)
    at listOnTimeout (node:internal/timers:564:17)
    at process.processTimers (node:internal/timers:507:7)
 ELIFECYCLE  Command failed with exit code 1.

> chatgpt-telegram-bot@1.0.5 start /app
> node dist/index.js

the same error for me, I tried again and again, but i can not fix it. and Is there any chance we can use a bot version that doesn't require a browser? Will the arm version of the docker image be released then.

RainEggplant commented 1 year ago

I encountered this problem today. It seems that OpenAI is sometimes asking for a new cloudflare captcha before showing the "log in" / "sign up" page.

cloudflare_captcha

Currently, you'll have to solve the captcha manually (if you're using xvfb, you'll need to connect to the virtual display first).

Is there any chance we can use a bot version that doesn't require a browser?

After the v4 of chatgpt api becomes stable, I'll update the code and then we'll be able to use a lightweight solution (which requires an OpenAI API key and may not be free though).

Will the arm version of the docker image be released then.

Currently it is not planned. You may search for some discussions here.

VectorZhao commented 1 year ago

Thanks for your answers. could i use Google reCaptcha to solve the captcha?

RainEggplant commented 1 year ago

could i use Google reCaptcha to solve the captcha?

I'm not sure what you mean. This captcha is from Cloudflare, not the Google reCAPTCHA.

RainEggplant commented 1 year ago

Closed as the issue is related to the upstream API.

FYI, now you can use the unofficial API that comes with v2.1.0 to bypass CloudFlare without a browser.