lley154 / atomic-swap-open-protocol

MIT License
3 stars 4 forks source link

getSwaps Failed: AxiosError: getaddrinfo EAI_AGAIN localhost3000 #5

Open besiwims opened 1 year ago

besiwims commented 1 year ago

I need help with this too.

When I do this at the command line : npm run dev then i get the dump error below

getSwaps Failed: AxiosError: getaddrinfo EAI_AGAIN localhost3000 at AxiosError.from (file:///home/wims/atomic-swap-open-protocol/node_modules/axios/lib/core/AxiosError.js:89:14) at RedirectableRequest.handleRequestError (file:///home/wims/atomic-swap-open-protocol/node_modules/axios/lib/adapters/http.js:591:25) at RedirectableRequest.emit (node:events:525:35) at eventHandlers. (/home/wims/atomic-swap-open-protocol/node_modules/follow-redirects/index.js:14:24) at ClientRequest.emit (node:events:513:28) at Socket.socketErrorListener (node:_http_client:502:9) at Socket.emit (node:events:513:28) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { hostname: 'localhost3000', syscall: 'getaddrinfo', code: 'EAI_AGAIN', errno: -3001, config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: [ 'xhr', 'http' ], transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 8000, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: [Function], Blob: [class Blob] }, validateStatus: [Function: validateStatus], headers: AxiosHeaders { Accept: 'application/json, text/plain, /', 'Content-Type': 'application/json', 'User-Agent': 'axios/1.4.0', 'Content-Length': '66', 'Accept-Encoding': 'gzip, compress, deflate, br' }, baseURL: 'http://localhost3000', url: '/api/getSwaps', data: '{"mph":"2d10eda247d5da1fd7f2dfe93f3fcc7c813472a79c523e02fe9e46ec"}', method: 'post' }, 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, constructed: true, prefinished: false, errorEmitted: false, emitClose: true, autoDestroy: true, errored: null, closed: false, closeEmitted: false,

},
_events: [Object: null prototype] {
  response: [Function: handleResponse],
  error: [Function: handleRequestError],
  socket: [Array]
},
_eventsCount: 3,
_maxListeners: undefined,
_options: {
  maxRedirects: 21,
  maxBodyLength: Infinity,
  protocol: 'http:',
  path: '/api/getSwaps',
  method: 'POST',
  headers: [Object: null prototype],
  agents: [Object],
  auth: undefined,
  family: undefined,
  lookup: undefined,
  beforeRedirect: [Function: dispatchBeforeRedirect],
  beforeRedirects: [Object],
  hostname: 'localhost3000',
  port: '',
  agent: undefined,
  nativeProtocols: [Object],
  pathname: '/api/getSwaps'
},
_ended: false,
_ending: true,
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 66,
_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,
  maxRequestsOnConnectionReached: false,
  _defaultKeepAlive: true,
  useChunkedEncodingByDefault: true,
  sendDate: false,
  _removedConnection: false,
  _removedContLen: false,
  _removedTE: false,
  strictContentLength: false,
  _contentLength: '66',
  _hasBody: true,
  _trailer: '',
  finished: false,
  _headerSent: true,
  _closed: false,
  socket: [Socket],
  _header: 'POST /api/getSwaps HTTP/1.1\r\n' +
    'Accept: application/json, text/plain, */*\r\n' +
    'Content-Type: application/json\r\n' +
    'User-Agent: axios/1.4.0\r\n' +
    'Content-Length: 66\r\n' +
    'Accept-Encoding: gzip, compress, deflate, br\r\n' +
    'Host: localhost3000\r\n' +
    'Connection: close\r\n' +
    '\r\n',
  _keepAliveTimeout: 0,
  _onPendingData: [Function: nop],
  agent: [Agent],
  socketPath: undefined,
  method: 'POST',
  maxHeaderSize: undefined,
  insecureHTTPParser: undefined,
  joinDuplicateHeaders: undefined,
  path: '/api/getSwaps',
  _ended: false,
  res: null,
  aborted: false,
  timeoutCb: null,
  upgradeOrConnect: false,
  parser: null,
  maxHeadersCount: null,
  reusedSocket: false,
  host: 'localhost3000',
  protocol: 'http:',
  _redirectable: [Circular *1],
  [Symbol(kCapture)]: false,
  [Symbol(kBytesWritten)]: 0,
  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype],
  [Symbol(errored)]: null,
  [Symbol(kUniqueHeaders)]: null
},
_currentUrl: 'http://localhost3000/api/getSwaps',
_timeout: null,
[Symbol(kCapture)]: false

}, cause: Error: getaddrinfo EAI_AGAIN localhost3000 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) { errno: -3001, code: 'EAI_AGAIN', syscall: 'getaddrinfo', hostname: 'localhost3000' } } getServerSideProps: No swaps found

lley154 commented 1 year ago

I've just updated the README to include a ":" before the port. This should resolve the issue. Please make sure to run source ~/.bashrc after making any updates to the environment variables.