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

AI not running within monolith. Bug Report: connect ECONNREFUSED 127.0.0.1:8000 When Running Briefer Standalone Docker Container #293

Open
sl-NZ opened this issue Dec 11, 2024 · 2 comments

Comments

@sl-NZ
Copy link

sl-NZ commented Dec 11, 2024

Encountering a connection error when running the standalone Docker container for Briefer with OpenAI integration:

Error: connect ECONNREFUSED 127.0.0.1:8000

The issue seems to arise because Briefer is not running the AI services inside the monolithic Docker build.

Steps to Reproduce
1. Run the standalone Briefer Docker container using the provided docker-compose.yml file.
2. Login to briefer and configure OpenAI Key
3. Make a request using AI from query block
4. Observe the error in logs.

Observed Behavior:

Requests to http://localhost:8000 fail with the following error:

connect ECONNREFUSED 127.0.0.1:8000: connect ECONNREFUSED 127.0.0.1:8000

Complete error stack trace:

[05:15:15.398] ERROR (174): Error while handling block status change
    workspaceId: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    documentId: "230c4a54-7bad-4c4e-9b4a-e42d57b90f67"
    blockId: "e47cf8b4-c26a-4137-af1c-e58bc23e677b"
    status: "edit-with-ai-running"
    err: {
      "message": "connect ECONNREFUSED 127.0.0.1:8000: connect ECONNREFUSED 127.0.0.1:8000",
      "name": "Error",
      "stack":
          Error: connect ECONNREFUSED 127.0.0.1:8000
              at AxiosError.from (file:///app/api/node_modules/axios/lib/core/AxiosError.js:92:14)
              at RedirectableRequest.handleRequestError (file:///app/api/node_modules/axios/lib/adapters/http.js:620:25)
              at RedirectableRequest.emit (node:events:517:28)
              at RedirectableRequest.emit (node:domain:489:12)
              at eventHandlers.<computed> (/app/api/node_modules/follow-redirects/index.js:49:24)
              at ClientRequest.emit (node:events:517:28)
              at ClientRequest.emit (node:domain:489:12)
              at Socket.socketErrorListener (node:_http_client:501:9)
              at Socket.emit (node:events:517:28)
              at Socket.emit (node:domain:489:12)
              at Axios.request (file:///app/api/node_modules/axios/lib/core/Axios.js:45:41)
              at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
          caused by: Error: connect ECONNREFUSED 127.0.0.1:8000
              at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
      "config": {
        "transitional": {
          "silentJSONParsing": true,
          "forcedJSONParsing": true,
          "clarifyTimeoutError": false
        },
        "adapter": [
          "xhr",
          "http",
          "fetch"
        ],
        "transformRequest": [
          null
        ],
        "transformResponse": [
          null
        ],
        "timeout": 0,
        "xsrfCookieName": "XSRF-TOKEN",
        "xsrfHeaderName": "X-XSRF-TOKEN",
        "maxContentLength": -1,
        "maxBodyLength": -1,
        "env": {},
        "headers": {
          "Accept": "application/json, text/plain, */*",
          "Content-Type": "application/json",
          "Authorization": "Basic xxxxxxxxxx",
          "User-Agent": "axios/1.7.7",
          "Content-Length": "352",
          "Accept-Encoding": "gzip, compress, deflate, br"
        },
        "responseType": "stream",
        "signal": {},
        "method": "post",
        "url": "http://localhost:8000/v1/stream/sql/edit",
        "data": "{\"databaseURL\":\"duckdb\",\"query\":\"SELECT * FROM 'extract-1733557826519-metrics.csv' LIMIT 1000000\",\"instructions\":\"limit to 100\",\"credentialsInfo\":null,\"modelId\":\"gpt-4o\",\"openaiApiKey\":\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"}"
      },
      "code": "ECONNREFUSED"
    }

Docker Configuration:

version: "3.8"
services:
  briefer:
    image: briefercloud/briefer:latest
    restart: unless-stopped
    ports:
      - "3000:3000"
    volumes:
      - briefer_psql_data:/var/lib/postgresql/data
      - briefer_jupyter_data:/home/jupyteruser
      - briefer_briefer_data:/home/briefer

volumes:
  briefer_psql_data:
  briefer_jupyter_data:
  briefer_briefer_data:

Additional Context

Lucas Vieira confirmed this issue is caused by the AI services not running inside the monolithic build:

“Briefer is not running the AI services inside the monolithic build that you are using.”
@vieiralucas vieiralucas changed the title Bug Report: connect ECONNREFUSED 127.0.0.1:8000 When Running Briefer Standalone Docker Container AI not running within monolith. Bug Report: connect ECONNREFUSED 127.0.0.1:8000 When Running Briefer Standalone Docker Container Dec 13, 2024
@vieiralucas
Copy link
Member

Hi @sl-NZ, thanks for this detailed bug report.

We'll work on fixing this soon.

@finnicius
Copy link

@vieiralucas , I don't know if that's a related issue - but sometimes the AI stops working in the cloud version, also showing no error message at all.

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

3 participants