Opened 7 years ago

Closed 22 months ago

#969 closed enhancement (wontfix)

Ushahidi port to PostgreSQL

Reported by: hamish Owned by: live-demo@…
Priority: normal Milestone: Unplanned
Component: OSGeoLive Keywords: chroot, mysql, ushahidi
Cc: eyedol

Description

Hi,

just looking through the 6.0 beta6 build logs. this looked broken:

install_mysql.sh
.. MySQL admin name is <debian-sys-maint>. (see /etc/mysql/debian.cnf)
ERROR 1045 (28000) at line 3: Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)

...


ushahidi:
tar: A lone zero block at 17095
ERROR 1044 (42000) at line 2: Access denied for user 'user'@'localhost' to database 'ushahidi'

?

thanks, Hamish

Change history (43)

comment:1 Changed 7 years ago by hamish

Type: taskdefect

comment:2 Changed 7 years ago by hamish

Hi,

a couple errors in the updated script for 6.0 beta7:

mv: cannot stat `Ushahidi_Web': No such file or directory
cp: cannot stat `ushahidi/': No such file or directory

?

there was another small script error on line 74 which I've now fixed.

thanks, Hamish

comment:4 in reply to:  2 Changed 7 years ago by eyedol

Replying to hamish:

Hi,

a couple errors in the updated script for 6.0 beta7:

mv: cannot stat `Ushahidi_Web': No such file or directory
cp: cannot stat `ushahidi/': No such file or directory

?

I added a quick fix to the installer to fix the broken mv command for renaming Ushahidi_Web folder to ushahidi

there was another small script error on line 74 which I've now fixed.

thanks, Hamish

comment:5 in reply to:  description Changed 7 years ago by eyedol

Replying to hamish:

Hi,

just looking through the 6.0 beta6 build logs. this looked broken:

install_mysql.sh
.. MySQL admin name is <debian-sys-maint>. (see /etc/mysql/debian.cnf)
ERROR 1045 (28000) at line 3: Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)

...


ushahidi:
tar: A lone zero block at 17095
ERROR 1044 (42000) at line 2: Access denied for user 'user'@'localhost' to database 'ushahidi'

This mysql issue seems more of a mysql admin credential problem. The administrator user/user doesn't exist on the mysql server and those are the credentials ushahidi's install script uses. If I could know what credentials were created for an admin user upon installing mysql-server, I can update the install script to use those.

?

thanks, Hamish

comment:6 Changed 7 years ago by eyedol

The admin credentials in install_mysql.sh file looks good to so if that is ran before the install_ushahidi.sh script, then it should work if the install_mysql file runs successfully.

Could someone test if this issue still exist? Otherwise, I'll go ahead and close this issue.

Thanks, Henry!

comment:7 in reply to:  6 Changed 7 years ago by hamish

Replying to eyedol:

The admin credentials in install_mysql.sh file looks good to so if that is ran before the install_ushahidi.sh script, then it should work if the install_mysql file runs successfully.

there is an error in install_mysql.sh:

.. MySQL admin name is <debian-sys-maint>. (see /etc/mysql/debian.cnf)
ERROR 1045 (28000) at line 3: Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)

(6.0 beta6 build log)

Hamish

comment:8 Changed 7 years ago by kalxas

Priority: normalcritical

Ushahidi still broken in beta9 (live-session)

comment:9 in reply to:  8 ; Changed 7 years ago by eyedol

Replying to kalxas:

Ushahidi still broken in beta9 (live-session)

Any log messages to look at?

comment:10 in reply to:  9 ; Changed 7 years ago by kalxas

Replying to eyedol:

Replying to kalxas:

Ushahidi still broken in beta9 (live-session)

Any log messages to look at?

sure: http://aiolos.survey.ntua.gr/gisvm/6.0/osgeo-live-mini-6.0beta9-log.tar.gz

comment:11 in reply to:  10 Changed 7 years ago by eyedol

Replying to kalxas:

Replying to eyedol:

Replying to kalxas:

Ushahidi still broken in beta9 (live-session)

Any log messages to look at?

sure: http://aiolos.survey.ntua.gr/gisvm/6.0/osgeo-live-mini-6.0beta9-log.tar.gz


Thanks.

I checked the log file but it looks like the beta9 is running the old ushahidi install script. I updated the script with a fix to

mv: cannot stat `Ushahidi_Web': No such file or directory
cp: cannot stat `ushahidi/': No such file or directory

The log message is still complaining about that issue. My guess is, the new install script didn't ran.

comment:12 Changed 7 years ago by kalxas

oops, sorry, I will look into a more fresh build and let you know.

comment:13 Changed 7 years ago by kalxas

Resolution: fixed
Status: newclosed

confirmed to be working on build8877 thanks.

comment:14 in reply to:  13 Changed 7 years ago by eyedol

Replying to kalxas:

confirmed to be working on build8877 thanks.

Smiles :-)

comment:15 Changed 7 years ago by hamish

install_mysql.sh and install_ushaidi.sh logs still contain errors:

Setting up mysql-server (5.5.24-0ubuntu0.12.04.1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
.. MySQL admin name is <debian-sys-maint>. (see /etc/mysql/debian.cnf)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

(ushahidi one is the same)

maybe that is harmless, just because mysql isn't running at the time?

Hamish

comment:16 Changed 7 years ago by eyedol

Yes. For some reasons, the mysql service isn't running and the script is trying to make a connection to the service.

install_mysql.sh script seems to be failing somewhere upon installation.

In the mysql install script, there is no command to start the mysql service after the install. That could be the issue. Because it tries to connect to the service to create an account. Although, 'apt-get install' tries to start the service upon successful installation. Not sure why it fails.

I have gone ahead and added a command to start the service manually before it attempts to create an account.

comment:17 Changed 7 years ago by hamish

Resolution: fixed
Status: closedreopened

comment:18 Changed 7 years ago by hamish

After clicking "Let's get started" there's an error at the top:

  • The imap extension could not be loaded

and you can proceed no further.

sudo /etc/init.d/mysql restart

shows no errors at the terminal.

comment:19 Changed 7 years ago by eyedol

Fixed -- Added imap and gd to the list of dependencies to be installed

comment:20 in reply to:  19 Changed 7 years ago by hamish

Replying to eyedol:

Fixed -- Added imap and gd to the list of dependencies to be installed

thanks, now it gets past the imap complaint.

but on the next screen (db login) we're back to the mysql problem:

Listed below is a summary of the errors we encountered:

  • Connection error: Access denied for user 'user'@'localhost' (using password: YES)
  • Database connection error: [same as above]

from the command line in the r8980 build,

user@osgeolive:~$ mysql
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| test               |
+--------------------+
2 rows in set (0.00 sec)

no db named ushahidi existing?

user@osgeolive:~$ mysql -h localhost -u user -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'user'@'localhost' (using password: YES)

:-(

Hamish

comment:21 Changed 7 years ago by hamish

funny, does /etc/mysql/debian.cnf get removed? it's not there in the iso, but seems to have worked to extract the admin name below:

MySQL admin name is <debian-sys-maint>. (see /etc/mysql/debian.cnf)

I only see /etc/mysql/my.conf. ?

anyway, this works:

user@osgeolive:~$ mysql -u root -p
Enter password: 

with the user's paswd. then

CREATE DATABASE ushahidi;
GRANT ALL PRIVILEGES ON ushahidi.* TO ‘user’@’localhost’ IDENTIFIED BY ‘user’;

as described in the ushahidi quickstart.

hopefully fixed by r9009, but I've put some debugging stuff into the build log in case it isn't.

Hamish

comment:22 Changed 7 years ago by darkblueb

beta10

user@osgeolive:~$ mysql -u root -p
Enter password:  user
...
mysql> show databases;
...
mysql
...
test
..

is this the expected list ?

comment:23 in reply to:  22 Changed 7 years ago by hamish

Replying to darkblueb:

beta10

It was fixed soon after beta10; wait for the next build.

thanks, Hamish

comment:24 Changed 7 years ago by hamish

... one more time around. hopefully fixed in r9056 this time.

Hamish

comment:25 Changed 7 years ago by hamish

it didn't work in the r9057 build.

install_mysql.sh:

note it restarted mysql since pgrep thought it was already running (maybe the install_mysql.sh script itself?)

Restarting mysql..
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

but it connects fine at run time on the ISO..?

Hamish

comment:27 Changed 7 years ago by hamish

I've committed a script in app-conf/ushahidi/rc.go_mysql to run at boot time, to set the credentials and create the ushahidi db if needed. It would be better to get the diversions working in the chroot environment, but I fear we are too close to release to test that properly. Another idea promoted by kalxas would be to install mysql-server on the chroot's host (it's an identical platform on his build platform), but interactions and change targets are unknown without testing, which we don't really have time for.

the /etc/rc2.d/S99rc.go_mysql startup script work around has been tested in test build r9066 and seems to work well for me. I've got concerns about the db setup being vulnerable to a race condition with mysql startup up just a few seconds before, but hopefully I built enough of a delay into it so that is rare, if at all.

  • summary: ushahidi is working on the iso now with an ugly work-around, problem was trying to run mysql in a chroot.

Hamish

comment:28 Changed 7 years ago by kalxas

Milestone: OSGeoLive6.0RC1OSGeoLive6.5
Priority: criticalnormal

This was fixed and confirmed in build [9066]

Moving it to 6.5 for a better solution

comment:29 Changed 7 years ago by hamish

Milestone: OSGeoLive6.5

MySQL wasn't fixed, it was poorly worked around using a cheap and temporary hack (mea culpa). We don't know yet how it will react on the VM or USB install. With luck it will allow Ushahidi work, but we may not be out of the woods yet.

We should continue to work on this issue in the weeks post-release, so if a 6.0.1 bug fix release is needed (for some other reason) the mysql-chroot build fix will be ready to go in for that.

best, Hamish

comment:30 Changed 7 years ago by hamish

Priority: normalmajor

comment:31 Changed 6 years ago by kalxas

Keywords: chroot added
Milestone: OSGeoLive6.5

This problem is not yet fixed and we are towards 6.5 beta. So far this hack seems to work fine, no complaints about Ushahidi and this is tested to work under a VM installation. Thoughts?

comment:32 Changed 6 years ago by kalxas

Summary: mySQL and Ushahidi: db permission problemsmySQL and Ushahidi: db permission problems during chroot

comment:33 Changed 6 years ago by kalxas

Milestone: OSGeoLive6.5OSGeoLive7.0

comment:34 Changed 6 years ago by kalxas

I guess there will be a Ushahidi version upgrade for 7.0. The question is if Postgresql is now supported...

comment:35 Changed 6 years ago by kalxas

Milestone: OSGeoLive7.0OSGeoLive7.5

moving to next version

comment:36 Changed 5 years ago by hamish

Milestone: OSGeoLive7.9OSGeoLive8.0

comment:37 Changed 5 years ago by hamish

Hi eyedol,

any update on back-end postgresql support for newer Ushahidi?

It's the last hold-out before we can drop mysql from the disc and free up a bunch of space + effort.

thanks, Hamish

comment:38 in reply to:  37 Changed 5 years ago by hamish

Cc: eyedol added

Replying to hamish:

Hi eyedol,

any update on back-end postgresql support for newer Ushahidi? It's the last hold-out before we can drop mysql from the disc and free up a bunch of space + effort.

Postgres is still preferred, but just to note here some talk on the ML/IRC about mariaDB being an easy swap out as mysql security patches become less distro-friendly.

Hamish

comment:39 Changed 5 years ago by hamish

Keywords: 6.0 removed
Milestone: OSGeoLive8.0OSGeoLive8.5

comment:40 Changed 4 years ago by kalxas

Milestone: OSGeoLive8.5OSGeoLive9.0

This is still not happening in 8.5

comment:41 Changed 4 years ago by kalxas

Milestone: OSGeoLive9.0OSGeoLive9.5

Ticket retargeted after milestone closed

comment:42 Changed 3 years ago by kalxas

Milestone: OSGeoLive9.5Unplanned
Priority: majornormal
Summary: mySQL and Ushahidi: db permission problems during chrootUshahidi port to PostgreSQL
Type: defectenhancement

comment:43 Changed 22 months ago by darkblueb

Resolution: wontfix
Status: reopenedclosed

install_ushahidi.sh is retired for Live11

Note: See TracTickets for help on using tickets.