I have successfully installed postgresql, age and age-viewer on my m1 mac. But today it shows connection error
"Database Connection Failed
Failed to connect to the database. Are you sure the database is running on the server?
[]:(ECONNREFUSED) connect ECONNREFUSED 127.0.0.1:5430"
log file details-
Error: Not connected
at _callee3$ (/Users/sakibadnan/Desktop/Install/age-viewer/backend/src/controllers/databaseController.js:54:19)
at tryCatch (/Users/sakibadnan/Desktop/Install/age-viewer/backend/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:44:17)
at Generator.<anonymous> (/Users/sakibadnan/Desktop/Install/age-viewer/backend/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:125:22)
at Generator.next (/Users/sakibadnan/Desktop/Install/age-viewer/backend/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:69:21)
at asyncGeneratorStep (/Users/sakibadnan/Desktop/Install/age-viewer/backend/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (/Users/sakibadnan/Desktop/Install/age-viewer/backend/node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:9)
at /Users/sakibadnan/Desktop/Install/age-viewer/backend/node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:7
at new Promise (<anonymous>)
at apply (/Users/sakibadnan/Desktop/Install/age-viewer/backend/node_modules/@babel/runtime/helpers/asyncToGenerator.js:19:12)
at getStatus (/Users/sakibadnan/Desktop/Install/age-viewer/backend/src/controllers/databaseController.js:56:6)
info: ::ffff:127.0.0.1 - - [29/Mar/2023:05:47:09 +0000] "GET /api/v1/db HTTP/1.1" 500 51
{"timestamp":"2023-03-29 11:47:09"}
info: ::ffff:127.0.0.1 - - [29/Mar/2023:05:47:09 +0000] "GET /api/v1/miscellaneous HTTP/1.1" 304 -
{"timestamp":"2023-03-29 11:47:09"}
Error: connect ECONNREFUSED 127.0.0.1:5430
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 5430
}
info: ::ffff:127.0.0.1 - - [29/Mar/2023:05:47:30 +0000] "POST /api/v1/db/connect HTTP/1.1" 500 85
{"timestamp":"2023-03-29 11:47:30"}
I have tried to connect database in age-viewer but after successful installation it now refuse to connect although i have changed my port number?
4
Answers
I may add some clarifications (deduced from the question)
That error is shown on the running terminal which holds the age-viewer project and you have tried through the front-end to connect to your database and it gets that error on the terminal and for sure similar at the front-end page
There are some tips may help out
Some commands you may need:
Possible duplicate and this too.
To me it seems like loopback error.
Try:
127.0.0.1 to your address (Use netstat). Port to new port.
Example:
You can use netstat to help you:
Restart the server
create some test database
then run connection test
This maybe a cause of loopback adapter.
Do this
127.0.0.1 to db_name
As I see you are using port 5430, First verify that the PostgreSQL server is listening on the correct port using this
netstat -an | grep 5430
If there is no output, the PostgreSQL server is not listening on port 5430.So now you have to check the PostgreSQL server’s configuration in postgresql.conf file. The default port used by PostgreSQL is 5432. If you want to set it to a different value say 5430, update it accordingly. Save the configuration file and restart the PostgreSQL server.