Opened 10 years ago

Closed 5 years 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 by hamish, 10 years ago

Type: taskdefect

comment:2 by hamish, 10 years ago

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

in reply to:  2 comment:4 by eyedol, 10 years ago

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

in reply to:  description comment:5 by eyedol, 10 years ago

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 by eyedol, 10 years ago

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!

in reply to:  6 comment:7 by hamish, 10 years ago

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 by kalxas, 10 years ago

Priority: normalcritical

Ushahidi still broken in beta9 (live-session)

in reply to:  8 ; comment:9 by eyedol, 10 years ago

Replying to kalxas:

Ushahidi still broken in beta9 (live-session)

Any log messages to look at?

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

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

in reply to:  10 comment:11 by eyedol, 10 years ago

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 by kalxas, 10 years ago

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

comment:13 by kalxas, 10 years ago

Resolution: fixed
Status: newclosed

confirmed to be working on build8877 thanks.

in reply to:  13 comment:14 by eyedol, 10 years ago

Replying to kalxas:

confirmed to be working on build8877 thanks.

Smiles :-)

comment:15 by hamish, 10 years ago

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 by eyedol, 10 years ago

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 by hamish, 10 years ago

Resolution: fixed
Status: closedreopened

comment:18 by hamish, 10 years ago

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 by eyedol, 10 years ago

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

in reply to:  19 comment:20 by hamish, 10 years ago

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 by hamish, 10 years ago

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 by darkblueb, 10 years ago

beta10

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

is this the expected list ?

in reply to:  22 comment:23 by hamish, 10 years ago

Replying to darkblueb:

beta10

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

thanks, Hamish

comment:24 by hamish, 10 years ago

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

Hamish

comment:25 by hamish, 10 years ago

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 by hamish, 10 years ago

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 by kalxas, 10 years ago

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 by hamish, 10 years ago

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 by hamish, 10 years ago

Priority: normalmajor

comment:31 by kalxas, 10 years ago

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 by kalxas, 10 years ago

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

comment:33 by kalxas, 10 years ago

Milestone: OSGeoLive6.5OSGeoLive7.0

comment:34 by kalxas, 9 years ago

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

comment:35 by kalxas, 9 years ago

Milestone: OSGeoLive7.0OSGeoLive7.5

moving to next version

comment:36 by hamish, 9 years ago

Milestone: OSGeoLive7.9OSGeoLive8.0

comment:37 by hamish, 8 years ago

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

in reply to:  37 comment:38 by hamish, 8 years ago

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 by hamish, 8 years ago

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

comment:40 by kalxas, 8 years ago

Milestone: OSGeoLive8.5OSGeoLive9.0

This is still not happening in 8.5

comment:41 by kalxas, 7 years ago

Milestone: OSGeoLive9.0OSGeoLive9.5

Ticket retargeted after milestone closed

comment:42 by kalxas, 7 years ago

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

comment:43 by darkblueb, 5 years ago

Resolution: wontfix
Status: reopenedclosed

install_ushahidi.sh is retired for Live11

Note: See TracTickets for help on using tickets.