morphic icon indicating copy to clipboard operation
morphic copied to clipboard

RetryError [AI_RetryError]: Failed after 3 attemps. Last error: Cannot connect to API: read ECONNRESET

Open Mecil9 opened this issue 1 year ago • 1 comments

when i am running the server.throw these errors:

RetryError [AI_RetryError]: Failed after 3 attemps. Last error: Cannot connect to API: read ECONNRESET
    at _retryWithExponentialBackoff (webpack-internal:///(rsc)/./node_modules/ai/dist/index.mjs:718:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async experimental_generateObject (webpack-internal:///(rsc)/./node_modules/ai/dist/index.mjs:839:30)
    at async taskManager (webpack-internal:///(rsc)/./lib/agents/task-manager.tsx:13:20)
    at async processEvents (webpack-internal:///(rsc)/./app/action.tsx:55:29) {
  reason: 'maxRetriesExceeded',
  errors: [
    APICallError [AI_APICallError]: Cannot connect to API: read ECONNRESET
        at postToApi (webpack-internal:///(rsc)/./node_modules/ai/openai/dist/index.mjs:398:15)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async OpenAIChatLanguageModel.doGenerate (webpack-internal:///(rsc)/./node_modules/ai/openai/dist/index.mjs:783:22)
        at async _retryWithExponentialBackoff (webpack-internal:///(rsc)/./node_modules/ai/dist/index.mjs:706:12)
        at async experimental_generateObject (webpack-internal:///(rsc)/./node_modules/ai/dist/index.mjs:839:30)
        at async taskManager (webpack-internal:///(rsc)/./lib/agents/task-manager.tsx:13:20)
        at async processEvents (webpack-internal:///(rsc)/./app/action.tsx:55:29) {
      url: 'https://api.openai.com/v1/chat/completions',
      requestBodyValues: [Object],
      statusCode: undefined,
      responseBody: undefined,
      cause: [Error],
      isRetryable: true,
      data: undefined
    },
lastError: APICallError [AI_APICallError]: Cannot connect to API: read ECONNRESET
      at postToApi (webpack-internal:///(rsc)/./node_modules/ai/openai/dist/index.mjs:398:15)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async OpenAIChatLanguageModel.doGenerate (webpack-internal:///(rsc)/./node_modules/ai/openai/dist/index.mjs:783:22)
      at async _retryWithExponentialBackoff (webpack-internal:///(rsc)/./node_modules/ai/dist/index.mjs:706:12)
      at async experimental_generateObject (webpack-internal:///(rsc)/./node_modules/ai/dist/index.mjs:839:30)
      at async taskManager (webpack-internal:///(rsc)/./lib/agents/task-manager.tsx:13:20)
      at async processEvents (webpack-internal:///(rsc)/./app/action.tsx:55:29) {
    url: 'https://api.openai.com/v1/chat/completions',
    requestBodyValues: {
      model: 'gpt-3.5-turbo',
      logit_bias: undefined,
      user: undefined,
      max_tokens: undefined,
      temperature: undefined,
      top_p: undefined,
      frequency_penalty: undefined,
      presence_penalty: undefined,
      seed: undefined,
      messages: [Array],
      tool_choice: [Object],
      tools: [Array]
    },
    statusCode: undefined,
    responseBody: undefined,
    cause: Error: read ECONNRESET
        at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)
        at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
      errno: -54,
      code: 'ECONNRESET',
      syscall: 'read'
    },
    isRetryable: true,
    data: undefined
  }

I have been changed model to gpt3.5.

Mecil9 avatar Apr 09 '24 18:04 Mecil9

The OpenAI API request has failed all three times. The cause is either an issue with OpenAI's servers or a network problem. Please check your network connection.

miurla avatar Apr 10 '24 13:04 miurla