Postgresql Wont' Start after Update

24 views
Skip to first unread message

Barnabas Akumba

unread,
Jun 4, 2018, 2:20:52 AM6/4/18
to DHIS2 system administrators
Hello Admins,

I updated my OS from Ubuntu 14.0 LTS to 16.0.4 LTS. After the upgrade, a lot of things went wrong.
My Postgresql wouldn't start. I tried re-installing postgresql. The installation seem to have been succesful but afterwards Postgresql wouldn't start. It gives the attached error.

Any one with an idea of how to fix this quickly?


I rely on your prompt response.

Regards

--
 
Barnabas AKUMBA

Skype: barnabas.akumba

gerald thomas

unread,
Jun 4, 2018, 2:29:39 AM6/4/18
to Barnabas Akumba, DHIS2 system administrators
Dear Benabas,

Try to manually start postgresql "sudo service postgres start" and send the error if it fails.

--
You received this message because you are subscribed to the Google Groups "DHIS2 system administrators" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dhis2-system-administrators+unsub...@googlegroups.com.
To post to this group, send email to dhis2-system-administrators@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/dhis2-system-administrators/CAF5odxTDU%3Dv5eWq3ohAJw-suV%3DzsWk7bngpdCdMDHT4-Fv6xsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Regards,
 
Gerald

Barnabas Akumba

unread,
Jun 4, 2018, 2:39:16 AM6/4/18
to gerald thomas, DHIS2 system administrators
Hello Gerald,

I tried and got this error "Failed to start postgres.service: Unit postgres.service not found"



On Mon, Jun 4, 2018 at 7:29 AM, gerald thomas <geral...@gmail.com> wrote:
Dear Benabas,

Try to manually start postgresql "sudo service postgres start" and send the error if it fails.
On Mon, Jun 4, 2018 at 6:20 AM, Barnabas Akumba <akumb...@gmail.com> wrote:
Hello Admins,

I updated my OS from Ubuntu 14.0 LTS to 16.0.4 LTS. After the upgrade, a lot of things went wrong.
My Postgresql wouldn't start. I tried re-installing postgresql. The installation seem to have been succesful but afterwards Postgresql wouldn't start. It gives the attached error.

Any one with an idea of how to fix this quickly?


I rely on your prompt response.

Regards

--
 
Barnabas AKUMBA

Skype: barnabas.akumba

--
You received this message because you are subscribed to the Google Groups "DHIS2 system administrators" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dhis2-system-administrators+unsubs...@googlegroups.com.



--
Regards,
 
Gerald


gerald thomas

unread,
Jun 4, 2018, 2:58:18 AM6/4/18
to Barnabas Akumba, DHIS2 system administrators
That's weird.
Please do "sudo service postgres status" and "netstat -nlp | grep 5432" copy and send information.

If everything is green(OK) and service it is running; then you will need to access postgres using "psql -U postgres -h localhost"

But i am sure you will need to reinstall postgres again and i hope you already have backup of the database. I
--
Regards,
 
Gerald

Barnabas Akumba

unread,
Jun 4, 2018, 3:03:40 AM6/4/18
to gerald thomas, DHIS2 system administrators
Hello Gerald,





I have a backup and wouldn't mind doing a reinstall. How do I go about reinstalling. Cos I've tried but doing a reinstall using the steps here: https://www.godaddy.com/garage/how-to-install-postgresql-on-ubuntu-14-04/

but still end up with same issue.

Regards


gerald thomas

unread,
Jun 4, 2018, 4:16:25 AM6/4/18
to Barnabas Akumba, DHIS2 system administrators
That's weird.
Ple

On Mon, 4 Jun 2018 at 06:39, Barnabas Akumba <akumb...@gmail.com> wrote:
Hello Gerald,

I tried and got this error "Failed to start postgres.service: Unit postgres.service not found"


On Mon, Jun 4, 2018 at 7:29 AM, gerald thomas <geral...@gmail.com> wrote:
Dear Benabas,

Try to manually start postgresql "sudo service postgres start" and send the error if it fails.
On Mon, Jun 4, 2018 at 6:20 AM, Barnabas Akumba <akumb...@gmail.com> wrote:
Hello Admins,

I updated my OS from Ubuntu 14.0 LTS to 16.0.4 LTS. After the upgrade, a lot of things went wrong.
My Postgresql wouldn't start. I tried re-installing postgresql. The installation seem to have been succesful but afterwards Postgresql wouldn't start. It gives the attached error.

Any one with an idea of how to fix this quickly?


I rely on your prompt response.

Regards

--
 
Barnabas AKUMBA

Skype: barnabas.akumba

--
You received this message because you are subscribed to the Google Groups "DHIS2 system administrators" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dhis2-system-administrators+unsub...@googlegroups.com.



--
Regards,
 
Gerald

gerald thomas

unread,
Jun 5, 2018, 1:50:06 AM6/5/18
to Barnabas Akumba, DHIS2 system administrators
Dear Barnabas,
You are still using the Ubuntu 14 procedures; kindly note you already upgraded to Ubuntu 16.
Secondly, I will like to see the output of this command “sudo netstat -nlp | grep 5432“. 

On Mon, 4 Jun 2018 at 08:16, gerald thomas <geral...@gmail.com> wrote:
That's weird.
Ple

On Mon, 4 Jun 2018 at 06:39, Barnabas Akumba <akumb...@gmail.com> wrote:
Hello Gerald,

I tried and got this error "Failed to start postgres.service: Unit postgres.service not found"


On Mon, Jun 4, 2018 at 7:29 AM, gerald thomas <geral...@gmail.com> wrote:
Dear Benabas,

Try to manually start postgresql "sudo service postgres start" and send the error if it fails.
On Mon, Jun 4, 2018 at 6:20 AM, Barnabas Akumba <akumb...@gmail.com> wrote:
Hello Admins,

I updated my OS from Ubuntu 14.0 LTS to 16.0.4 LTS. After the upgrade, a lot of things went wrong.
My Postgresql wouldn't start. I tried re-installing postgresql. The installation seem to have been succesful but afterwards Postgresql wouldn't start. It gives the attached error.

Any one with an idea of how to fix this quickly?


I rely on your prompt response.

Regards

--
 
Barnabas AKUMBA

Skype: barnabas.akumba

--
You received this message because you are subscribed to the Google Groups "DHIS2 system administrators" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dhis2-system-admini...@googlegroups.com.
To post to this group, send email to dhis2-system-...@googlegroups.com.



--
Regards,
 
Gerald



--
 
Barnabas AKUMBA

Skype: barnabas.akumba
--
Regards,
 
Gerald

Barnabas Akumba

unread,
Jun 5, 2018, 2:24:01 AM6/5/18
to gerald thomas, DHIS2 system administrators
Hello Gerald,

Can you share a link to a detailed guide for installation on Ubuntu 16?

See output from the command below:


Regards

That's weird.
Ple

To unsubscribe from this group and stop receiving emails from it, send an email to dhis2-system-administrators+unsub...@googlegroups.com.
To post to this group, send email to dhis2-system-administrators@googlegroups.com.



--
Regards,
 
Gerald



--
 
Barnabas AKUMBA

Skype: barnabas.akumba
--
Regards,
 
Gerald


gerald thomas

unread,
Jun 5, 2018, 2:27:48 AM6/5/18
to Barnabas Akumba, DHIS2 system administrators

Dear Barnabas,
Try these:

  • sudo apt-get --purge remove postgresql-*
  • sudo rm -Rf /etc/postgresql /var/lib/postgresql
  • sudo apt-get install postgresql
This will surely install Postgres 9.5

That's weird.
Ple

To unsubscribe from this group and stop receiving emails from it, send an email to dhis2-system-admini...@googlegroups.com.
To post to this group, send email to dhis2-system-...@googlegroups.com.



--
Regards,
 
Gerald



--
 
Barnabas AKUMBA

Skype: barnabas.akumba
--
Regards,
 
Gerald



--
 
Barnabas AKUMBA

Skype: barnabas.akumba
--
Regards,
 
Gerald

Barnabas Akumba

unread,
Jun 5, 2018, 2:44:20 AM6/5/18
to gerald thomas, DHIS2 system administrators
Hello Gerald,

Thanks. Do I need to move my backups out of the postgresql folder before carrying out the steps?

Regards

That's weird.
Ple

To unsubscribe from this group and stop receiving emails from it, send an email to dhis2-system-administrators+unsub...@googlegroups.com.
To post to this group, send email to dhis2-system-administrators@googlegroups.com.



--
Regards,
 
Gerald



--
 
Barnabas AKUMBA

Skype: barnabas.akumba
--
Regards,
 
Gerald



--
 
Barnabas AKUMBA

Skype: barnabas.akumba
--
Regards,
 
Gerald


gerald thomas

unread,
Jun 5, 2018, 3:03:50 AM6/5/18
to Barnabas Akumba, DHIS2 system administrators
Yes, you can do that.


That's weird.
Ple

To unsubscribe from this group and stop receiving emails from it, send an email to dhis2-system-admini...@googlegroups.com.
To post to this group, send email to dhis2-system-...@googlegroups.com.



--
Regards,
 
Gerald



--
 
Barnabas AKUMBA

Skype: barnabas.akumba
--
Regards,
 
Gerald



--
 
Barnabas AKUMBA

Skype: barnabas.akumba
--
Regards,
 
Gerald



--
 
Barnabas AKUMBA

Skype: barnabas.akumba
--
Regards,
 
Gerald

gerald thomas

unread,
Jun 5, 2018, 3:04:58 AM6/5/18
to Barnabas Akumba, DHIS2 system administrators
Or you can do a backup again but from what I had seeing it seem like there is no Postgres on your server 
--
Regards,
 
Gerald

Barnabas Akumba

unread,
Jun 5, 2018, 3:54:27 AM6/5/18
to gerald thomas, DHIS2 system administrators
Hello Gerald,

You made my day!

Regards

That's weird.
Ple

To unsubscribe from this group and stop receiving emails from it, send an email to dhis2-system-administrators+unsub...@googlegroups.com.
To post to this group, send email to dhis2-system-administrators@googlegroups.com.



--
Regards,
 
Gerald
--
Regards,
 
Gerald
--
Regards,
 
Gerald
--
Regards,
 
Gerald
--
Regards,
 
Gerald


Barnabas Akumba

unread,
Jun 5, 2018, 4:10:14 AM6/5/18
to gerald thomas, DHIS2 system administrators
Hello All,

I've been able to reinstall my postgres and I've setup an instance.
I tried starting it up but no success. See log tail screen shot below:


Any idea what must be responsible for the failure?

Regards

That's weird.
Ple

To unsubscribe from this group and stop receiving emails from it, send an email to dhis2-system-administrators+unsubs...@googlegroups.com.



--
Regards,
 
Gerald
--
Regards,
 
Gerald
--
Regards,
 
Gerald
--
Regards,
 
Gerald
--
Regards,
 
Gerald

gerald thomas

unread,
Jun 5, 2018, 4:19:38 AM6/5/18
to Barnabas Akumba, DHIS2 system administrators
Barnabas,
Which method did you use to install your instance? Secondly, share with me "sudo netstat -nlp" so that i can see all the service that are currently running on your server?? Have you done the following:
sudo su postgres
psql
\l
This give the list of databases. Can you share as well because i will like to know if the database is OK.

--
Regards,
 
Gerald

Barnabas Akumba

unread,
Jun 5, 2018, 4:27:46 AM6/5/18
to gerald thomas, DHIS2 system administrators
Hello Gerald,
I used dhis2-tools:

The simplified set of steps to get a dhis2 instance up and running from here are:
1. turn your user (eg bobj) into a dhis2-admin user by running:
sudo dhis2-create-admin barns
2. create an instance named eg dhis with:
dhis2-instance-create dhis
3. deploy the latest stable war file with:
dhis2-deploy-war dhis

I checked and discovered that the dhis DB isn't created:



netstat output below:




gerald thomas

unread,
Jun 5, 2018, 4:37:48 AM6/5/18
to Barnabas Akumba, DHIS2 system administrators
Barnabas,
Good!!! 
As you can see from the list of databases, there is no database called “dhis”
Which means you didn’t import any back database.
That's weird.
Ple

To unsubscribe from this group and stop receiving emails from it, send an email to dhis2-system-admini...@googlegroups.com.
To post to this group, send email to dhis2-system-...@googlegroups.com.



--
Regards,
 
Gerald
--
Regards,
 
Gerald
--
Regards,
 
Gerald
--
Regards,
 
Gerald
--
Regards,
 
Gerald



--
Regards,
 
Gerald
--
Regards,
 
Gerald

Barnabas Akumba

unread,
Jun 5, 2018, 4:46:51 AM6/5/18
to gerald thomas, DHIS2 system administrators
Hello Gerald,

I discovered that I had to delete the previous instance that was there.
After doing that, I ran the dhis2-tools command again and everything went well.

Regards