chatgpt-api: Not Able to run ChatGPT inside Docker Container

Verify latest release

  • I verified that the issue exists in the latest chatgpt release

Verify webapp is working

  • I verify that the ChatGPT webapp is working properly for this account.

Environment details

Nodejs - v18.12.1 OS Ubuntu - 20.04 LTS puppeteer - 19.4.1 chatgpt - 3.3.2

Describe the Bug

I created nodejs program for chatgpt using this library and running in docker container.

logs cmd - docker logs containerID

I installed google-chrome browser inside the docker also

Error:

Listening to Port 8000 Error: Failed to launch the browser process! [31:31:1223/094709.453848:ERROR:ozone_platform_x11.cc(238)] Missing X server or $DISPLAY [31:31:1223/094709.453908:ERROR:env.cc(255)] The platform failed to initialize. Exiting.

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

at onClose (/node_modules/puppeteer-core/src/node/BrowserRunner.ts:328:9)
at ChildProcess.<anonymous> (/node_modules/puppeteer-core/src/node/BrowserRunner.ts:317:16)
at ChildProcess.emit (node:events:525:35)
at ChildProcess.emit (node:domain:489:12)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)

Has anyone faced this issue? Share your opinion …

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (4 by maintainers)

Most upvoted comments

After updating chatgpt lib and docker file, gets the below error

dependencies”: { “chatgpt”: “^3.3.4”, “dotenv”: “^14.2.0”, “matrix-bot-sdk”: “^0.6.2”, “puppeteer”: “^19.4.1”, “typescript”: “^4.5.2” }

code : const api = new ChatGPTAPIBrowser({ email: “XXXXX”, password: “YYYY”, debug: true, isGoogleLogin: true, minimize: true, // executablePath: “/usr/bin/google-chrome”, });

error-----------------> ChatGPTError: Failed to authenticate session

Does anyone resolve this?

Ok, Thanks @tqnghia1998.

I am also finding the solution. Please let me know if find any