Error After Install

Status
Not open for further replies.

KitchM

Member
Jul 15, 2019
168
6
18
I received this message:
error: SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?

It should be looking for 192.168.1.21.

Does anyone know what this means? It appears that the install may not have completed correctly even though it said it did.
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
It means exactly what it says. Your postresql database server should be running and listening for connections on IP address 127.0.0.1 (localhost, LO, loopback) and TCP port 5432. You need to check that it is, and if it is not, find out why.

At the command prompt, as root, Issue the command:
Code:
root@a2es-test1:~# ps ax | grep postgres


You should see an output looking something like this:
Code:
   668 ?        S      6:06 /usr/lib/postgresql/11/bin/postgres -D /var/lib/postgresql/11/main -c config_file=/etc/postgresql/11/main/postgresql.conf
   948 ?        Ss     0:23 postgres: 11/main: checkpointer
   949 ?        Ss     0:25 postgres: 11/main: background writer
   950 ?        Ss     2:00 postgres: 11/main: walwriter
   951 ?        Ss     0:25 postgres: 11/main: autovacuum launcher
   952 ?        Ss     1:31 postgres: 11/main: stats collector
   953 ?        Ss     0:00 postgres: 11/main: logical replication launcher
67287 ?        Ss     0:00 postgres: 11/main: fusionpbx fusionpbx 127.0.0.1(57966) idle


You can also check the postresql service status with:
Code:
root@a2es-test1:~# service postgresql status


You should see a status looking somehting like this if all is well:
Code:
● postgresql.service - PostgreSQL RDBMS
   Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
   Active: active (exited) since Mon 2020-08-03 12:30:06 BST; 2 weeks 2 days ago
  Process: 1347 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 1347 (code=exited, status=0/SUCCESS)


Finally you can check what is written to the logfile(s) located in /var/log/postgresql
 
Last edited:

KitchM

Member
Jul 15, 2019
168
6
18
You made some mistakes in your post. Evidently, you included your prompt name in your commands. Very confusing. Also, there is no service command. And there is no /var/log/postgresql.

If it helps you, I am using Debian 10.
 
Last edited:

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
Most people would find the inclusion of the prompt helpful. I gained this experience from teaching computer programming to students at HNC level for a good number of years.

I too am running Debian 10. See the command output below - without the confusing prompt name:
Code:
cat /etc/*release

PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"


Also, see what happens when I cd to the postgresl log directory (apologies for the annoying prompt in the output):
Code:
cd /var/log/postgresql/
root@a2es-test1:/var/log/postgresql#


If you don't have service, you may be able to use systemctl instead:
Code:
systemctl status postgresql
● postgresql.service - PostgreSQL RDBMS
   Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
   Active: active (exited) since Mon 2020-08-03 12:30:06 BST; 2 weeks 3 days ago
  Process: 1347 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 1347 (code=exited, status=0/SUCCESS)
 

KitchM

Member
Jul 15, 2019
168
6
18
FYI, as a long time professional, my many customers and students want the exact details. Computer professionals are supposed to know that. A misplaced 1 or 0 will ruin everything. Without precision nothing works in the computer arena.

As to knowing where a prompt is, there has to be a simple standard to use. That standard is and always have been to use $ to represent the user prompt and # to represent the root prompt. When we stray from these standards we create confusion.

And do not forget that advanced users often create their own custom prompt labeling. We would never, ever want that to be used as part of a prompt.

And finally, the insert code command at the top of the edit window is for the actual characters which will be typed into the prompt and nothing else. If we go off on our own tangent, it always leads to confusion.

Forgive me for the long explanation, but I believe we need to remind ourselves from time to time. I find that this helps me as well just by repeating it.

Yes, your release info is the same as mine, with the addition of:
ID=raspbian
ID_LIKE=debian

The service could not be found and there still is no log file.

I looked back into my notes and found a FusionPBX script error. I had written that I was not supposed to sudo su into root prompt, but was supposed to sudo -i. However, now that I already made the mistake, I do not know how to uninstall and start over. What a pain. I wish they had just made an accurate script to begin with.

You wouldn't know how to uninstall would you?
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
You may find ID=raspbian and ID_LIKE=debian, to be significant, as you say, exact details matter.

I fear that I will be unable to help you further because I cannot deliver the precision that you require.

Kind regards,
Adrian.
 

KitchM

Member
Jul 15, 2019
168
6
18
Well, guess what. I was able to find a new way to install and it worked just fine. Perhaps a step was missing or a variable was not passed on correctly. In any case, the error went away and the server's GUI interface was available.

Thanks for your help. Much appreciated.
 
Status
Not open for further replies.