? Success
Pull Request for # 7080

User tests: Successful: Unsuccessful:

avatar alikon
alikon
30 May 2015

fix the #7080 issue


Steps to reproduce the issue

While trying to test #7009 I found a small issue with PostgreSQL during installation. If someone tries to use a PostgreSQL database and a PostgreSQL user that is allowed to access the DB but is not owner of the DB the install just reloads the "Database" tab. For example:

DB: user_database
User: user_userdb
Owner of the PostgreSQL DB: user

In this case the connection to the database is established but then the process dies here (model/database.php):

318 // PostgreSQL database older than version 9.0.0 needs to run 'CREATE LANGUAGE' to create function.
319 if (($options->db_type == 'postgresql') && (version_compare($db_version, '9.0.0', '<')))
320 {
321 $db->setQuery("CREATE LANGUAGE plpgsql");
322 $db->execute();
323 }

Here is a copy of part of the strace results:

32693 connect(4, {sa_family=AF_INET, sin_port=htons(5432), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EINPROGRESS (Operation now in progress)
32693 poll([{fd=4, events=POLLOUT|POLLERR}], 1, -1) = 1 ([{fd=4, revents=POLLOUT}])
32693 getsockopt(4, SOL_SOCKET, SO_ERROR, [121704735920095232], [4]) = 0
32693 getsockname(4, {sa_family=AF_INET, sin_port=htons(38445), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
32693 poll([{fd=4, events=POLLOUT|POLLERR}], 1, -1) = 1 ([{fd=4, revents=POLLOUT}])
32693 rt_sigprocmask(SIG_BLOCK, [PIPE], [], 8) = 0
32693 sendto(4, "\0\0\0\10\4\322\26/", 8, 0, NULL, 0) = 8
32693 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
32693 poll([{fd=4, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=4, revents=POLLIN}])
32693 recvfrom(4, "N", 16384, 0, NULL, NULL) = 1
32693 poll([{fd=4, events=POLLOUT|POLLERR}], 1, -1) = 1 ([{fd=4, revents=POLLOUT}])
32693 rt_sigprocmask(SIG_BLOCK, [PIPE], [], 8) = 0
32693 sendto(4, "\0\0\0004\0\3\0\0user\0danielka_jab123\0database\0danielka_jab\0\0", 52, 0, NULL, 0) = 52
32693 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
32693 poll([{fd=4, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=4, revents=POLLIN}])
32693 recvfrom(4, "R\0\0\0\f\0\0\0\5T?)2", 16384, 0, NULL, NULL) = 13
32693 rt_sigprocmask(SIG_BLOCK, [PIPE], [], 8) = 0
32693 sendto(4, "p\0\0\0(md50baf24d5133432a815cc75a9daf5e19b\0", 41, 0, NULL, 0) = 41
32693 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
32693 poll([{fd=4, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=4, revents=POLLIN}])
32693 recvfrom(4, "R\0\0\0\10\0\0\0\0S\0\0\0\31client_encoding\0UTF8\0S\0\0\0\27DateStyle\0ISO, MDY\0S\0\0\0\31integer_datetimes\0on\0S\0\0\0\33IntervalStyle\0postgres\0S\0\0\0\25is_superuser\0off\0S\0\0\0\31server_encoding\0UTF8\0S\0\0\0\32server_version\0008.4.13\0S\0\0\0*session_authorization\0danielka_jab123\0S\0\0\0$standard_conforming_strings\0off\0S\0\0\0\30TimeZone\0US/Central\0K\0\0\0\f\0\0\1jg\206\20\346Z\0\0\0\5I", 16384, 0, NULL, NULL) = 312
32693 rt_sigprocmask(SIG_BLOCK, [PIPE], [], 8) = 0
32693 sendto(4, "Q\0\0\0(SET standard_conforming_strings=off\0", 41, 0, NULL, 0) = 41
32693 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
32693 poll([{fd=4, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=4, revents=POLLIN}])
32693 recvfrom(4, "S\0\0\0$standard_conforming_strings\0off\0C\0\0\0\10SET\0Z\0\0\0\5I", 16384, 0, NULL, NULL) = 52
32693 rt_sigprocmask(SIG_BLOCK, [PIPE], [], 8) = 0
32693 sendto(4, "Q\0\0\0\"SET escape_string_warning=off\0", 35, 0, NULL, 0) = 35
32693 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
32693 poll([{fd=4, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=4, revents=POLLIN}])
32693 recvfrom(4, "C\0\0\0\10SET\0Z\0\0\0\5I", 16384, 0, NULL, NULL) = 15
32693 rt_sigprocmask(SIG_BLOCK, [PIPE], [], 8) = 0
32693 sendto(4, "Q\0\0\0\34CREATE LANGUAGE plpgsql\0", 29, 0, NULL, 0) = 29
32693 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
32693 poll([{fd=4, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=4, revents=POLLIN}])
32693 recvfrom(4, "E\0\0\0[SERROR\0C42501\0Mmust be owner of database danielka_jab\0Faclchk.c\0L2200\0Raclcheck_error\0\0Z\0\0\0\5I", 16384, 0, NULL, NULL) = 98
32693 rt_sigprocmask(SIG_BLOCK, [PIPE], [], 8) = 0

Expected result

I suspect two issues here:

  • The server's version is server_version 8.4.13 and the code in question should not be executed at all.
  • In case the user is not the owner of the database users should see an error message instead of the "Database" tab just being reloaded.

Actual result

  • Code in model/database.php is executed despite the fact that the version of the server is 8.4.13.
  • Database tab is just reloaded and no error message is shown.

System information (as much as possible)

  • CentOS 6.4
  • PHP 5.6
  • PostgreSQL 8.4.13

Additional comments

Ping me for more details or find me during #jab15 make it happen :)

avatar alikon alikon - open - 30 May 2015
avatar zero-24 zero-24 - change - 30 May 2015
Title
fix #7080
fix PostgreSQL installation issue - no error handling #makeithappen
avatar zero-24 zero-24 - change - 30 May 2015
Category Postgresql
avatar zero-24 zero-24 - change - 30 May 2015
The description was changed
Title
fix #7080
fix PostgreSQL installation issue - no error handling #makeithappen
Status New Pending
Rel_Number 7080
Relation Type Pull Request for
avatar zero-24 zero-24 - change - 30 May 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 30 May 2015
Labels Added: ?
avatar brianteeman
brianteeman - comment - 3 Jun 2015

@dkanchev are you able to test this fix to your issue please


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7082.

avatar dkanchev
dkanchev - comment - 4 Jun 2015

@brianteeman Sorry for the delay. It works just fine.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7082.

avatar dkanchev dkanchev - test_item - 4 Jun 2015 - Tested successfully
avatar waader
waader - comment - 26 Jun 2015

@test works fine!

avatar waader waader - test_item - 26 Jun 2015 - Tested successfully
avatar zero-24 zero-24 - change - 26 Jun 2015
Status Pending Ready to Commit
avatar zero-24
zero-24 - comment - 26 Jun 2015

RTC. Thanks :+1:


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7082.

avatar zero-24 zero-24 - change - 26 Jun 2015
Labels Added: ?
avatar Kubik-Rubik
Kubik-Rubik - comment - 10 Jul 2015

Thank you @alikon! Merged.

avatar Kubik-Rubik Kubik-Rubik - change - 10 Jul 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-07-10 11:16:01
Closed_By Kubik-Rubik
avatar Kubik-Rubik Kubik-Rubik - close - 10 Jul 2015
avatar zero-24 zero-24 - close - 10 Jul 2015
avatar zero-24 zero-24 - change - 14 Oct 2015
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment