Share feedback, ideas and get community help

Updated 3 months ago

Connect ECONNREFUSED

I am facing the following error when I run an OpenAI block in a new self hosted typebot installation:
Plain Text
{
  "status": 500,
  "body": {
    "message": "connect ECONNREFUSED 179.182.110.148:443",
    "code": "INTERNAL_SERVER_ERROR",
    "data": {
      "code": "INTERNAL_SERVER_ERROR",
      "httpStatus": 500,
      "path": "continueChat"
    }
  }
}


179.182.110.148 is the public IP Address of my server. Although I use subdomain.domain.com.br to connect to Typebot app.

All stacks are running under Traefik built in Portainer
The log shows something not clear to me:
Plain Text
Something went wrong Error: connect ECONNREFUSED 179.182.110.148:443
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
  code: 'INTERNAL_SERVER_ERROR',
  name: 'TRPCError',
  [cause]: Error: connect ECONNREFUSED 179.182.110.148:443
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
    errno: -111,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '179.182.110.148',
    port: 443
  }
}
Something went wrong TRPCError: Stripe environment variables are missing
    at /app/apps/builder/.next/server/chunks/9108.js:1:10994
    at resolveMiddleware (file:///app/node_modules/.pnpm/@[email protected]/node_modules/@trpc/server/dist/index.mjs:420:36)
    at callRecursive (file:///app/node_modules/.pnpm/@[email protected]/node_modules/@trpc/server/dist/index.mjs:456:38)
    at next (file:///app/node_modules/.pnpm/@[email protected]/node_modules/@trpc/server/dist/index.mjs:465:32)
    at inputMiddleware (file:///app/node_modules/.pnpm/@[email protected]/node_modules/@trpc/server/dist/index.mjs:456:32)
    at async callRecursive (file:///app/node_modules/.pnpm/@[email protected]/node_modules/@trpc/server/dist/index.mjs:456:32) {
  code: 'INTERNAL_SERVER_ERROR',
  [cause]: undefined
}


I don't use stripe payment resource. Maybe there is no correlation with the problem.
If I use typebot.io website, the OpenAI block works fine.

Thank you all!.
B
D
C
18 comments
What's the value of NEXT_PUBLIC_VIEWER_URL?
Thank you for your attention, Baptiste.

I am running under traefik.

Thank you in advance!
@Diego Sayron is your install new 2.24.0 ?
Thank you for your reply @CptPlastic.

Builder: baptistearno/typebot-builder:latest
Viewer: baptistearno/typebot-viewer:latest
Postgres:13
Minio: quay.io/minio/minio (I have run the command that creates and sets the typebot bucket as public)
Traefik: traefik:latest
I could bet that the problem is behind the traefik, because I can't upload files as well (An error occured while uploading the file). By the way, I can create buckets remotely via mc command.

When I try to upload a file, after this error, I can see a similar message (typebot's viewer container-logs) like:
Plain Text
Something went wrong Error: connect ECONNREFUSED 179.182.110.148:443
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
  code: 'INTERNAL_SERVER_ERROR',
  name: 'TRPCError',
  [cause]: Error: connect ECONNREFUSED 179.182.110.148:443
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
    errno: -111,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '179.182.110.148',
    port: 443
  }
}
Indeed, must be something going on with your reverse procy
Is it only happening on OpenAI block and File uploads?
Yes! Everything working fine with all other functions
Can you share in DM a bot of yours that triggers an OpenAI block?
Of course! Thank you very much!
So that's an issue when trying to upload a file to the s3 bucket
Can you try with a AWS S3 bucket
and tell us what is the error in the server logs?
There should be a clear error here
1) So that's an issue when trying to upload a file to the s3 bucket
Actually, there are two errors: 1) When I try to upload files and 2) Request to OpenAI a text to speech resource.
At typebot.io everything works fine!

2) Can you try with a AWS S3 bucket
Yes. I have already tried as follows:
  • S3_BUCKET=typebot
  • S3_PORT=443
  • S3_ENDPOINT=s3.us-east-1.amazonaws.com
  • S3_ACCESS_KEY=FAKE4K42GIIC35LZFAKE
  • S3_SECRET_KEY=FakeH+cd5SflEieuwGW2n2aj/U+Lc3vtGOwYQMFP
  • S3_SSL=true
  • S3_REGION=us-east-1
The CORS and Access Policy were applied. I can upload files via "aws cli"

3) and tell us what is the error in the server logs?
Plain Text
Here is the log error:
Something went wrong Error: connect ECONNREFUSED 179.182.110.148:443
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
  code: 'INTERNAL_SERVER_ERROR',
  name: 'TRPCError',
  [cause]: Error: connect ECONNREFUSED 179.182.110.148:443
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
    errno: -111,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '179.182.110.148',
    port: 443
  }
}


4) I'll try something related with traefik.
If I get any progress, I'll post it here.

Thank you!
The OpenAI block on your flow is doing a create speech action which ultimately downloads the generated file temporarily to your S3 bucket. So the only issue is the upload of files to your bucket.
Yes I would guess that your container just can't reach 179.182.110.148:443 when it should be able to do that.
Thank you! To me, It seems that a reverse operation in traefik is not working properly... 179... Is the IP Address of my server, but I think that the egressing calling must be the same as the ingressing, such as "typeflow.briidge.com.br" instead of the IP Address. This behaviour can be the cause to S3 does not be reached.
It''s just my guess.
By the way, thank you for your effort with this issue. I'll try a setting bypassing the traefik.
Add a reply
Sign up and join the conversation on Discord