AGiXT icon indicating copy to clipboard operation
AGiXT copied to clipboard

Trying to Connect to localhost:3000 using npm run dev / frontend

Open WillTryToDoItRight opened this issue 2 years ago • 1 comments

Description

what I did before that:

deleted whole repo
git clone / cd "Agent-LLM" pip install -r requirements.txt / python app.py
cd frontend / npm install / npm run build / npm start:

Error message inside the homepage

Unhandled Runtime Error

AxiosError: Request failed with status code 500 Call Stack AxiosError node_modules/axios/lib/core/AxiosError.js (22:0) settle node_modules/axios/lib/core/settle.js (19:0) onloadend node_modules/axios/lib/adapters/xhr.js (107:12)

error message in the terminal:

ready - started server on 0.0.0.0:3000, url: http://localhost:3000 info - Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc" https://nextjs.org/docs/messages/swc-disabled event - compiled client and server successfully in 13.6s (11823 modules) wait - compiling /_error (client and server)... wait - compiling /new/agent (client and server)... event - compiled client and server successfully in 2.8s (11844 modules) Promise { } error - unhandledRejection: AxiosError: connect ECONNREFUSED 127.0.0.1:80 at AxiosError.from (file:///home/g3n3r3luser/Programming/Agent-LLM/frontend/node_modules/axios/lib/core/AxiosError.js:89:14) at RedirectableRequest.handleRequestError (file:///home/g3n3r3luser/Programming/Agent-LLM/frontend/node_modules/axios/lib/adapters/http.js:591:25) at RedirectableRequest.emit (node:events:513:28) at eventHandlers. (/home/g3n3r3luser/Programming/Agent-LLM/frontend/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) { port: 80, address: '127.0.0.1', syscall: 'connect', code: 'ECONNREFUSED', errno: -111, config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: [ 'xhr', 'http' ], transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, 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, /', 'User-Agent': 'axios/1.4.0', 'Accept-Encoding': 'gzip, compress, deflate, br' }, method: 'get', url: '/api/provider', data: undefined }, 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, [Symbol(kOnFinished)]: [] }, _events: [Object: null prototype] { response: [Function: handleResponse], error: [Function: handleRequestError], socket: [Function: handleRequestSocket] }, _eventsCount: 3, _maxListeners: undefined, _options: { maxRedirects: 21, maxBodyLength: Infinity, protocol: 'http:', path: '/api/provider', method: 'GET', headers: [Object: null prototype], agents: [Object], auth: undefined, family: undefined, lookup: undefined, beforeRedirect: [Function: dispatchBeforeRedirect], beforeRedirects: [Object], hostname: 'localhost', port: '', agent: undefined, nativeProtocols: [Object], pathname: '/api/provider' }, _ended: true, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 0, _requestBodyBuffers: [], _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: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: [Socket], _header: 'GET /api/provider HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /\r\n' + 'User-Agent: axios/1.4.0\r\n' + 'Accept-Encoding: gzip, compress, deflate, br\r\n' + 'Host: localhost\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, joinDuplicateHeaders: undefined, path: '/api/provider', _ended: false, res: null, aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'localhost', 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://localhost/api/provider', [Symbol(kCapture)]: false }, cause: Error: connect ECONNREFUSED 127.0.0.1:80 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) { errno: -111, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 80 } } warn - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload Promise { } { mutate: [Function (anonymous)], data: [Getter], error: [Getter], isValidating: [Getter], isLoading: [Getter] } Promise { } { mutate: [Function (anonymous)], data: [Getter], error: [Getter], isValidating: [Getter], isLoading: [Getter] } error - unhandledRejection: Error: connect ECONNREFUSED 127.0.0.1:80 at AxiosError.from (file:///home/g3n3r3luser/Programming/Agent-LLM/frontend/node_modules/axios/lib/core/AxiosError.js:89:14) at RedirectableRequest.handleRequestError (file:///home/g3n3r3luser/Programming/Agent-LLM/frontend/node_modules/axios/lib/adapters/http.js:591:25) at RedirectableRequest.emit (node:events:513:28) at eventHandlers. (/home/g3n3r3luser/Programming/Agent-LLM/frontend/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) { digest: undefined } error - unhandledRejection: Error: connect ECONNREFUSED 127.0.0.1:80 at AxiosError.from (file:///home/g3n3r3luser/Programming/Agent-LLM/frontend/node_modules/axios/lib/core/AxiosError.js:89:14) at RedirectableRequest.handleRequestError (file:///home/g3n3r3luser/Programming/Agent-LLM/frontend/node_modules/axios/lib/adapters/http.js:591:25) at RedirectableRequest.emit (node:events:513:28) at eventHandlers. (/home/g3n3r3luser/Programming/Agent-LLM/frontend/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) { digest: undefined } wait - compiling /api/provider (client and server)... event - compiled successfully in 68 ms (80 modules) error - Error: connect ECONNREFUSED 127.0.0.1:80 at AxiosError.from (file:///home/g3n3r3luser/Programming/Agent-LLM/frontend/node_modules/axios/lib/core/AxiosError.js:89:14) at RedirectableRequest.handleRequestError (file:///home/g3n3r3luser/Programming/Agent-LLM/frontend/node_modules/axios/lib/adapters/http.js:591:25) at RedirectableRequest.emit (node:events:513:28) at eventHandlers. (/home/g3n3r3luser/Programming/Agent-LLM/frontend/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) { digest: undefined } error - Error: connect ECONNREFUSED 127.0.0.1:80 at AxiosError.from (file:///home/g3n3r3luser/Programming/Agent-LLM/frontend/node_modules/axios/lib/core/AxiosError.js:89:14) at RedirectableRequest.handleRequestError (file:///home/g3n3r3luser/Programming/Agent-LLM/frontend/node_modules/axios/lib/adapters/http.js:591:25) at RedirectableRequest.emit (node:events:513:28) at eventHandlers. (/home/g3n3r3luser/Programming/Agent-LLM/frontend/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) { digest: undefined }

Steps to Reproduce the Bug

  1. deleted whole repo
  2. git clone / cd "Agent-LLM" pip install -r requirements.txt / python app.py
  3. cd frontend / npm install / npm run dev

Expected Behavior

load the website

Actual Behavior

loading website, throughing axios error

and getting error in terminal

Additional Context / Screenshots

v1.1.0-alpha

Operating System

  • [ ] Microsoft Windows
  • [ ] Apple MacOS
  • [X] Linux
  • [ ] Android
  • [ ] iOS
  • [ ] Other

Python Version

  • [ ] Python <= 3.9
  • [X] Python 3.10
  • [ ] Python 3.11

Environment Type - Connection

  • [X] Local
  • [ ] Remote

Environment Type - Container

  • [ ] Using Docker
  • [X] Not Using Docker

Acknowledgements

  • [X] My issue title is concise, descriptive, and in title casing.
  • [X] I have searched the existing issues to make sure this bug has not been reported yet.
  • [X] I am using the latest version of Agent-LLM.
  • [X] I have provided enough information for the maintainers to reproduce and diagnose the issue.

WillTryToDoItRight avatar May 02 '23 01:05 WillTryToDoItRight

Same error.

Then noticed error - Error: connect ECONNREFUSED 127.0.0.1:80 It tries to connect to port 80 but frontend runs on port 3000.

So I tried to redirect port 3000 to port 80 using this command: socat TCP-LISTEN:80,fork TCP:127.0.0.1:3000 (apt install socat to install)

Then as soon as I load the frontend in the browser (now at http://localhost/) it starts spamming these errors (in the console):

error - Error [AxiosError]: Request failed with status code 404
    at settle (file:///home/garlen/Agent-LLM/frontend/node_modules/axios/lib/core/settle.js:19:12)
    at Unzip.handleStreamEnd (file:///home/garlen/Agent-LLM/frontend/node_modules/axios/lib/adapters/http.js:570:11)
    at Unzip.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1358:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  digest: undefined
}
error - Error [AxiosError]: Request failed with status code 404
    at settle (file:///home/garlen/Agent-LLM/frontend/node_modules/axios/lib/core/settle.js:19:12)
    at Unzip.handleStreamEnd (file:///home/garlen/Agent-LLM/frontend/node_modules/axios/lib/adapters/http.js:570:11)
    at Unzip.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1358:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  digest: undefined
}
error - unhandledRejection: Error [AxiosError]: Request failed with status code 500
    at settle (file:///home/garlen/Agent-LLM/frontend/node_modules/axios/lib/core/settle.js:19:12)
    at Unzip.handleStreamEnd (file:///home/garlen/Agent-LLM/frontend/node_modules/axios/lib/adapters/http.js:570:11)
    at Unzip.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1358:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  digest: undefined
}
error - unhandledRejection: Error [AxiosError]: Request failed with status code 500
    at settle (file:///home/garlen/Agent-LLM/frontend/node_modules/axios/lib/core/settle.js:19:12)
    at Unzip.handleStreamEnd (file:///home/garlen/Agent-LLM/frontend/node_modules/axios/lib/adapters/http.js:570:11)
    at Unzip.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1358:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  digest: undefined
}

It does not stop when closing the page in the browser.

VRImage avatar May 02 '23 05:05 VRImage

Please pull the latest and let us know if you're still having issues.

https://github.com/Josh-XT/Agent-LLM/releases/tag/v1.1.1-alpha

Josh-XT avatar May 03 '23 00:05 Josh-XT