adrianhajdin / project_ai_mern_image_generation

Build and Deploy a Full Stack MERN AI Image Generation App MidJourney & DALL E Clone
https://jsmastery.pro
1.08k stars 302 forks source link

Error: connect ETIMEDOUT 104.18.7.192:443 at TCPConnectWrap.afterConnect #45

Open minal322 opened 1 year ago

minal322 commented 1 year ago

ERROR ON BACKEND TERMINAL ----- [nodemon] 2.0.22 [nodemon] to restart at any time, enter rs [nodemon] watching path(s): . [nodemon] watching extensions: js,mjs,json [nodemon] starting node index index.js Server has started on port http://localhost:8080 connected to mongodb Database Error: connect ETIMEDOUT 104.18.7.192:443 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
errno: -4039, code: 'ETIMEDOUT', syscall: 'connect', address: '104.18.7.192', port: 443, config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: [Function: httpAdapter], transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, validateStatus: [Function: validateStatus], headers: { Accept: 'application/json, text/plain, /', 'Content-Type': 'application/json', 'User-Agent': 'OpenAI/NodeJS/3.2.1', Authorization: 'Bearer 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', 'Content-Length': 73 }, method: 'post', data: '{"prompt":"beach ","n":1,"size":"1024x1024","response_format":"b64_json"}', url: 'https://api.openai.com/v1/images/generations' }, request: <ref 1> Writable { _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: false, ended: false, finished: false, destroyed: false, decodeStrings: true, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: true, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, allBuffers: true, allNoop: true, pendingcb: 0, prefinished: false, errorEmitted: false, emitClose: true, autoDestroy: true, errored: null, closed: false }, _events: [Object: null prototype] { response: [Function: handleResponse], error: [Function: handleRequestError], socket: [Function: handleRequestSocket] }, _eventsCount: 3, _maxListeners: undefined, _options: { maxRedirects: 21, maxBodyLength: 10485760, protocol: 'https:', path: '/v1/images/generations', method: 'POST', headers: [Object], agent: undefined, agents: [Object], auth: undefined, hostname: 'api.openai.com', port: null, nativeProtocols: [Object], pathname: '/v1/images/generations' }, _ended: false, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 73, _requestBodyBuffers: [ [Object] ], _onNativeResponse: [Function (anonymous)], _currentRequest: ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: null, _hasBody: true, _trailer: '', finished: false, _headerSent: true, socket: [TLSSocket], _header: 'POST /v1/images/generations HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /\r\n' + 'Content-Type: application/json\r\n' + 'User-Agent: OpenAI/NodeJS/3.2.1\r\n' + 'Authorization: Bearer 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\r\n' + 'Content-Length: 73\r\n' + 'Host: api.openai.com\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: noopPendingOutput], agent: [Agent], socketPath: undefined, method: 'POST', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/v1/images/generations', _ended: false, res: null, aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'api.openai.com', protocol: 'https:', _redirectable: [Circular 1],

  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype]
},
_currentUrl: 'https://api.openai.com/v1/images/generations',       
[Symbol(kCapture)]: false

}, response: undefined, isAxiosError: true, toJSON: [Function: toJSON] }

#################################################################### I'm able to fetch image from openAi but when i click on share with community button getting this error on backend and on console image

image latest image doent display in this page ################################## PLEASE HELP ME TO RESOLVE THIS