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

Client and server successfully deployed but ERROR #43

Open
Adylitto opened this issue Feb 26, 2023 · 7 comments
Open

Client and server successfully deployed but ERROR #43

Adylitto opened this issue Feb 26, 2023 · 7 comments

Comments

@Adylitto
Copy link

Adylitto commented Feb 26, 2023

{"message":"Request failed with status code 429","name":"Error","stack":"Error: Request failed with status code 429\n at createError (/opt/render/project/src/server/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/opt/render/project/src/server/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/opt/render/project/src/server/node_modules/axios/lib/adapters/http.js:322:11)\n at IncomingMessage.emit (events.js:388:22)\n at endReadableNT (internal/streams/readable.js:1336:12)\n at processTicksAndRejections (internal/process/task_queues.js:82:21)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"headers":{"Accept":"application/json, text/plain, /","Content-Type":"application/json","User-Agent":"OpenAI/NodeJS/3.1.0","Authorization":"Bearer sk-","Content-Length":133},"method":"post","data":"{"model":"text-davinci-003","prompt":"hi\n","temperature":0,"max_tokens":3000,"top_p":1,"frequency_penalty":0.5,"presence_penalty":0}","url":"https://api.openai.com/v1/completions"},"status":429}

@Adylitto
Copy link
Author

still same error after using new api
npm run server

codex-server@0.0.0 server
nodemon server

[nodemon] 2.0.20
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node server.js
node:events:505
throw er; // Unhandled 'error' event
^

Error: listen EADDRINUSE: address already in use :::5000
at Server.setupListenHandle [as _listen2] (node:net:1372:16)
at listenInCluster (node:net:1420:12)
at Server.listen (node:net:1508:7)
at Function.listen (/Users/adylitto/CODE/openai/server/node_modules/express/lib/application.js:635:24)
at file:///Users/adylitto/CODE/openai/server/server.js:48:5
at ModuleJob.run (node:internal/modules/esm/module_job:198:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:385:24)
at async loadESM (node:internal/process/esm_loader:88:5)
at async handleMainPromise (node:internal/modules/run_main:61:12)
Emitted 'error' event on Server instance at:
at emitErrorNT (node:net:1399:8)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
code: 'EADDRINUSE',
errno: -48,
syscall: 'listen',
address: '::',
port: 5000
}
[nodemon] app crashed - waiting for file changes before starting...

@Adylitto
Copy link
Author

Based on the provided log, the error 429 is coming from the OpenAI API. The response object contains an HTTP status code of 429, which is indicative of Too Many Requests. This means that the client (your code) has exceeded the rate limit for the API. The response data also contains an error object, which may provide additional information about the error.

In this case, it appears that the error is being thrown by Axios, which is the HTTP client library being used to make the API request. The log also indicates that the isAxiosError flag is set to true, which means that the error was generated by Axios rather than the server.

To resolve the error, you will need to implement rate limiting or modify the code to reduce the number of API requests being made. You can also check the OpenAI API documentation to see if they provide any guidance on how to avoid this error.

@tomoat
Copy link

tomoat commented Mar 1, 2023

The error log has told you the cause of the error Error: listen EADDRINUSE: address already in use :::5000

@willgoncdev
Copy link

@Adylitto this is because the key that was in his code is already expired or out of credits, the best way to fix it is to get your own key and follow the steps to deploy the server, and then update the http on the script.js with the link of the new server. hope it helped.

@Divyansh-singh08
Copy link

{"message":"Request failed with status code 429","name":"Error","stack":"Error: Request failed with status code 429\n at createError (/opt/render/project/src/server/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/opt/render/project/src/server/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/opt/render/project/src/server/node_modules/axios/lib/adapters/http.js:322:11)\n at IncomingMessage.emit (events.js:388:22)\n at endReadableNT (internal/streams/readable.js:1336:12)\n at processTicksAndRejections (internal/process/task_queues.js:82:21)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"headers":{"Accept":"application/json, text/plain, /","Content-Type":"application/json","User-Agent":"OpenAI/NodeJS/3.1.0","Authorization":"Bearer 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","Content-Length":133},"method":"post","data":"{"model":"text-davinci-003","prompt":"hi\n","temperature":0,"max_tokens":3000,"top_p":1,"frequency_penalty":0.5,"presence_penalty":0}","url":"https://api.openai.com/v1/completions"},"status":429}

i have the same error @Adylitto plz help me here

@justtfun
Copy link

@Divyansh-singh08 i am also facing the same issue...please help

@Adylitto
Copy link
Author

@Adylitto this is because the key that was in his code is already expired or out of credits, the best way to fix it is to get your own key and follow the steps to deploy the server, and then update the http on the script.js with the link of the new server. hope it helped.

Thank you very much 🙏🏽

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants