AgentGPT icon indicating copy to clipboard operation
AgentGPT copied to clipboard

RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: 0

Open night3759 opened this issue 1 year ago • 10 comments

I am in china, so I need to use vpn to get the response from openai, but when the vpn is on, the error occurs. error - RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: 0 at new NodeError (node:internal/errors:399:5) at ServerResponse.writeHead (node:_http_server:344:11) at ServerResponse.writeHead (E:\AgentGPT-main\node_modules\next\dist\compiled\compression\index.js:46:263) at ServerResponse._implicitHeader (node:_http_server:335:8) at ServerResponse.end (E:\AgentGPT-main\node_modules\next\dist\compiled\compression\index.js:22:749) at DevServer.runEdgeFunction (E:\AgentGPT-main\node_modules\next\dist\server\next-server.js:1461:41) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async DevServer.runApi (E:\AgentGPT-main\node_modules\next\dist\server\next-server.js:468:47) at async Object.fn (E:\AgentGPT-main\node_modules\next\dist\server\next-server.js:751:37) at async Router.execute (E:\AgentGPT-main\node_modules\next\dist\server\router.js:253:36) at async DevServer.run (E:\AgentGPT-main\node_modules\next\dist\server\base-server.js:384:29) at async DevServer.run (E:\AgentGPT-main\node_modules\next\dist\server\dev\next-dev-server.js:743:20) at async DevServer.handleRequest (E:\AgentGPT-main\node_modules\next\dist\server\base-server.js:322:20) { code: 'ERR_HTTP_INVALID_STATUS_CODE'

night3759 avatar Apr 13 '23 18:04 night3759

same here

Pandoxie avatar Apr 14 '23 04:04 Pandoxie

same here

FakeSnake618 avatar Apr 14 '23 06:04 FakeSnake618

Update. I pulled hahayusuf:feat/custom_base_path and misconfiged the API Base Url. The format should be: API_BASE_URL=https://your_url/v1 Now the agent can generate outputs. But please fix the API key issue... https://github.com/reworkd/AgentGPT/pull/67

Pandoxie avatar Apr 14 '23 08:04 Pandoxie

me too

horysk avatar Apr 15 '23 03:04 horysk

same here

muqiufeng-zang avatar Apr 17 '23 02:04 muqiufeng-zang

same here ! Has anybody got this running locally in dev mode?

  • Debian 11
  • Nodejs 19.x

Fails to deploy Agent with error:

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Loaded env from /home/user/git/AgentGPT/.env
event - compiled client and server successfully in 1037 ms (288 modules)
wait  - compiling /_error (client and server)...
event - compiled client and server successfully in 187 ms (289 modules)
warn  - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
wait  - compiling / (client and server)...
event - compiled client and server successfully in 1200 ms (1294 modules)
wait  - compiling /api/auth/[...nextauth] (client and server)...
event - compiled successfully in 41 ms (122 modules)
wait  - compiling /api/chain (client and server)...
event - compiled successfully in 256 ms (174 modules)
error - RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: 0
    at new NodeError (node:internal/errors:399:5)
    at ServerResponse.writeHead (node:_http_server:339:11)
    at ServerResponse.writeHead (/home/user/git/AgentGPT/node_modules/next/dist/compiled/compression/index.js:46:263)
    at ServerResponse._implicitHeader (node:_http_server:330:8)
    at ServerResponse.end (/home/user/git/AgentGPT/node_modules/next/dist/compiled/compression/index.js:22:749)
    at DevServer.runEdgeFunction (/home/user/git/AgentGPT/node_modules/next/dist/server/next-server.js:1461:41)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async DevServer.runApi (/home/user/git/AgentGPT/node_modules/next/dist/server/next-server.js:468:47)
    at async Object.fn (/home/user/git/AgentGPT/node_modules/next/dist/server/next-server.js:751:37)
    at async Router.execute (/home/user/git/AgentGPT/node_modules/next/dist/server/router.js:253:36)
    at async DevServer.run (/home/user/git/AgentGPT/node_modules/next/dist/server/base-server.js:384:29)
    at async DevServer.run (/home/user/git/AgentGPT/node_modules/next/dist/server/dev/next-dev-server.js:743:20)
    at async DevServer.handleRequest (/home/user/git/AgentGPT/node_modules/next/dist/server/base-server.js:322:20) {
  code: 'ERR_HTTP_INVALID_STATUS_CODE'

alorbach avatar Apr 17 '23 20:04 alorbach

Same happens on Ubuntu 22.04 LTS

alorbach avatar Apr 18 '23 09:04 alorbach

I am in germany and I can open https://api.openai.com/v1/ easily in webbrowser on Debian 11 and Ubunu 22 machines so it is not a connection error

alorbach avatar Apr 18 '23 20:04 alorbach

Are you still experiencing this @alorbach @night3759 @Pandoxie @horysk @FakeSnake618 @muqiufeng-zang ?

asim-shrestha avatar Apr 25 '23 21:04 asim-shrestha

Are you still experiencing this @alorbach @night3759 @Pandoxie @horysk @FakeSnake618 @muqiufeng-zang ?

It works (Y)

alorbach avatar Apr 28 '23 07:04 alorbach

Added support for custom base url: https://github.com/reworkd/AgentGPT/pull/543

Going to close this as a result. I'll also include something in the documentation to describe this

asim-shrestha avatar May 16 '23 01:05 asim-shrestha