[GH-ISSUE #2070] [BUG]: Error: connect ECONNREFUSED 127.0.0.1:5433 #1350

Closed
opened 2026-02-22 18:24:23 -05:00 by yindo · 2 comments
Owner

Originally created by @sonnt-dna on GitHub (Aug 8, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2070

How are you running AnythingLLM?

Docker (local)

What happened?

Hi Admin,

I am currently encountering an issue with connecting to the Local-Postgres database while using AnythingLLM. Below are the details of the error and the steps I have taken so far:

Error Details:

less
Copy code
@agent: Checking what are the available databases.
@agent: Checking what are the available tables in the Local-Postgres database.
Running SQL: SELECT * FROM pg_catalog.pg_tables WHERE schemaname = 'public'
Error: connect ECONNREFUSED 127.0.0.1:5433
Steps Taken:

Verified that PostgreSQL is running on port 5433.
Checked that the PostgreSQL service is active and listening on the correct port using sudo lsof -i -P -n | grep LISTEN.
Updated the pg_hba.conf and postgresql.conf files to ensure proper configurations.
Restarted the PostgreSQL service using brew services restart postgresql@14.
Successfully connected to the PostgreSQL server via the command line:
css
Copy code
psql -h localhost -p 5433 -U postgres -d postgres
Despite these steps, the application still throws the "connect ECONNREFUSED 127.0.0.1:5433" error. Could you please guide me on how to properly configure the connection for AnythingLLM?

I appreciate any assistance or guidance you can provide.
image

image

Are there known steps to reproduce?

No response

Originally created by @sonnt-dna on GitHub (Aug 8, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2070 ### How are you running AnythingLLM? Docker (local) ### What happened? Hi Admin, I am currently encountering an issue with connecting to the Local-Postgres database while using AnythingLLM. Below are the details of the error and the steps I have taken so far: Error Details: less Copy code @agent: Checking what are the available databases. @agent: Checking what are the available tables in the Local-Postgres database. Running SQL: SELECT * FROM pg_catalog.pg_tables WHERE schemaname = 'public' Error: connect ECONNREFUSED 127.0.0.1:5433 Steps Taken: Verified that PostgreSQL is running on port 5433. Checked that the PostgreSQL service is active and listening on the correct port using sudo lsof -i -P -n | grep LISTEN. Updated the pg_hba.conf and postgresql.conf files to ensure proper configurations. Restarted the PostgreSQL service using brew services restart postgresql@14. Successfully connected to the PostgreSQL server via the command line: css Copy code psql -h localhost -p 5433 -U postgres -d postgres Despite these steps, the application still throws the "connect ECONNREFUSED 127.0.0.1:5433" error. Could you please guide me on how to properly configure the connection for AnythingLLM? I appreciate any assistance or guidance you can provide. ![image](https://github.com/user-attachments/assets/f2311ee7-5ce2-4bb1-bacf-47a99a92ecce) ![image](https://github.com/user-attachments/assets/16c807a8-d0de-469c-a11f-d2e40f819389) ### Are there known steps to reproduce? _No response_
yindo added the possible bug label 2026-02-22 18:24:23 -05:00
yindo closed this issue 2026-02-22 18:24:23 -05:00
Author
Owner

@timothycarambat commented on GitHub (Aug 8, 2024):

Unless you are running PG inside of the AnythingLLM container (unlikely) when you use 127.0.0.1 or localhost you are referring to the containers network layer not your host.

Use host.docker.internal:5433 or if on Ubuntu 172.17.0.1 to reach back out to the host network layer.

@timothycarambat commented on GitHub (Aug 8, 2024): Unless you are running PG _inside_ of the AnythingLLM container (unlikely) when you use 127.0.0.1 or localhost you are referring to the _containers network layer_ not your host. Use `host.docker.internal:5433` or if on Ubuntu `172.17.0.1` to reach back out to the host network layer.
Author
Owner

@sonnt-dna commented on GitHub (Aug 8, 2024):

Unless you are running PG inside of the AnythingLLM container (unlikely) when you use 127.0.0.1 or localhost you are referring to the containers network layer not your host.

Use host.docker.internal:5433 or if on Ubuntu 172.17.0.1 to reach back out to the host network layer.

Thanks for your reply and "host.docker.internal:5433" is working now
I am using PG inside of my AnythingLLM.

How i can pass this error with prompting or anyway ?

@agent: Checking what are the available databases.
@agent: Im going to run a query on the Local-Postgres to get an answer.
Running SQL: SELECT * FROM testmarker;
Error encountered while running: 400 Invalid 'messages[18].content': string too long. Expected a string with maximum length 1048576, but got a string with length 5155351 instead.

Thanks

@sonnt-dna commented on GitHub (Aug 8, 2024): > Unless you are running PG _inside_ of the AnythingLLM container (unlikely) when you use 127.0.0.1 or localhost you are referring to the _containers network layer_ not your host. > > Use `host.docker.internal:5433` or if on Ubuntu `172.17.0.1` to reach back out to the host network layer. Thanks for your reply and "host.docker.internal:5433" is working now I am using PG inside of my AnythingLLM. How i can pass this error with prompting or anyway ? @agent: Checking what are the available databases. @agent: Im going to run a query on the Local-Postgres to get an answer. Running SQL: SELECT * FROM testmarker; Error encountered while running: 400 Invalid 'messages[18].content': string too long. Expected a string with maximum length 1048576, but got a string with length 5155351 instead. Thanks
yindo changed title from [BUG]: Error: connect ECONNREFUSED 127.0.0.1:5433 to [GH-ISSUE #2070] [BUG]: Error: connect ECONNREFUSED 127.0.0.1:5433 2026-06-05 14:40:18 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1350