Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: 0 #90

Closed
night3759 opened this issue Apr 13, 2023 · 11 comments
Closed

RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: 0 #90

night3759 opened this issue Apr 13, 2023 · 11 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@night3759
Copy link

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'

@Pandoxie
Copy link

same here

1 similar comment
@FakeSnake618
Copy link

same here

@Pandoxie
Copy link

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

@horysk
Copy link

horysk commented Apr 15, 2023

me too

@APiTJLillo APiTJLillo added the bug Something isn't working label Apr 15, 2023
@APiTJLillo APiTJLillo added the duplicate This issue or pull request already exists label Apr 15, 2023
@muqiufeng-zang
Copy link

same here

@alorbach
Copy link

alorbach commented Apr 17, 2023

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
Copy link

Same happens on Ubuntu 22.04 LTS

@alorbach
Copy link

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

@asim-shrestha
Copy link
Contributor

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

@alorbach
Copy link

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

It works (Y)

@asim-shrestha
Copy link
Contributor

Added support for custom base url: #543

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

8 participants