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

Redis Connection Error: ECONNREFUSED at 127.0.0.1:6379 Causing Service Failure #8269

Open
KazeroG opened this issue Nov 1, 2024 · 8 comments
Labels
type: bug Something isn't working

Comments

@KazeroG
Copy link

KazeroG commented Nov 1, 2024

Bug Description

When running the application, a connection error occurs with Redis, causing the service to exit. This issue happens because the application cannot connect to 127.0.0.1:6379, resulting in an ECONNREFUSED error in the logs.

ERROR [ExceptionHandler] connect ECONNREFUSED 127.0.0.1:6379
Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16)

Expected behavior

The application should successfully connect to Redis at 127.0.0.1:6379, or an alternative Redis instance if configured, without raising connection errors. The application should start and run as expected without interruption.

Technical inputs

  • The application is configured to connect to Redis on the localhost (127.0.0.1) at port 6379.
  • The issue might be fixable by:
  • Ensuring Redis is running on the expected address and port.
  • Checking firewall settings or Docker container networking if Redis runs in a container.
  • Updating environment configurations if Redis is hosted remotely.

other info

  1. Hosting : render.com
  2. version twenty:server : Latest
  3. Render.yaml Blueprint
# Exported from Render on 2024-10-12T14:37:13Z
services:
- type: worker
  name: twenty:worker
  runtime: image
  image:
    url: docker.io/twentycrm/twenty:latest
    creds:
      fromRegistryCreds:
        name: dockerhub
  plan: standard
  envVars:
  - key: REFRESH_TOKEN_SECRET
    sync: false
  - key: LOGIN_TOKEN_SECRET
    sync: false
  - key: FILE_TOKEN_SECRET
    sync: false
  - key: ACCESS_TOKEN_SECRET
    sync: false
  - fromGroup: Twenty
  region: oregon
  dockerCommand: yarn run worker:prod
- type: web
  name: twenty:server
  runtime: image
  image:
    url: docker.io/twentycrm/twenty:latest
    creds:
      fromRegistryCreds:
        name: dockerhub
  plan: standard
  envVars:
  - key: REFRESH_TOKEN_SECRET
    sync: false
  - key: LOGIN_TOKEN_SECRET
    sync: false
  - key: FILE_TOKEN_SECRET
    sync: false
  - key: ACCESS_TOKEN_SECRET
    sync: false
  - fromGroup: Twenty
  region: oregon
  dockerCommand: yarn run start:prod
  disk:
    name: disk
    mountPath: /.local-storage
    sizeGB: 5
version: "1"
@KazeroG KazeroG added the type: bug Something isn't working label Nov 1, 2024
@FelixMalfait
Copy link
Member

Hey @KazeroG - we don't officially maintain the Render.yaml but a pull request would be most welcome! It seems it's missing a redis in Render.yaml https://docs.render.com/redis

@technicalnoodles
Copy link

technicalnoodles commented Nov 1, 2024

I am having the same issue with the docker compose version from the docs. I have checked that I can connect to the redis service from the host computer. And both containers are in the same docker network

@FelixMalfait
Copy link
Member

Yes that's the issue, you're looking at the .env/documentation for main, while the docker version is still the old one :-/.
Ideally one day we should have versioned docs that match the last published version

@technicalnoodles
Copy link

Ahhh, alright. So waiting a bit and it should all sync up with the docs

@FelixMalfait
Copy link
Member

Yes it should! Sorry

@JTCorrin
Copy link

JTCorrin commented Nov 2, 2024

I've got this issue. Not sure from the discussion what the fix is; wait for an update to the docker compose?

@FelixMalfait
Copy link
Member

@JTCorrin use the .env.example variable from the latest published version and not the one from the main branch, (so this one https://github.com/twentyhq/twenty/blob/v0.31.3/packages/twenty-server/.env.example)

@FrancisVarga
Copy link

Damn took me 6 hours till found this hahaha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
Status: 🆕 New
Development

No branches or pull requests

5 participants