Bug 1487741

Summary: Can't run 'install' for gallery2
Product: [Fedora] Fedora Reporter: David A. De Graaf <dad>
Component: gallery2Assignee: Michael Cronenworth <mike>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 26CC: gwync, mike
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: gallery2-2.3.2-19.fc26 gallery2-2.3.2-19.fc25 gallery2-2.3.2-19.fc27 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-17 22:50:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Error msgs from "8 Install Gallery Core "
none
Error msgs from installing gallery2.noarch 2.3.2-19.fc26 none

Description David A. De Graaf 2017-09-01 18:56:41 UTC
Description of problem:
You don't have permission to access /gallery2/install on this server

Version-Release number of selected component (if applicable):
gallery2-2.3.2-16.fc26.noarch
php-7.1.8-1.fc26.x86_64
httpd-2.4.27-2.fc26.x86_64

How reproducible:
100%

Steps to Reproduce:
1.  Activate mariadb and httpd
2.  Point browser at "datix.us/gallery2/install"
3.  Receive rejection - no permission!

Actual results:
Installation is prevented

Expected results:
Access to full startup and configuration steps

Additional info:

I still cannot access 'datix.us/gallery2/install' with a browser.
It says:
  Forbidden
  You don't have permission to access /gallery2/install on this server.

Therefore, I cannot proceed past the most elementary step to set up
gallery2, or the next steps to recover my previously successful gallery2
setup.

After the disaster recorded in Bug 1214128, I gave up on gallery2 for
the duration of Fedora 25, but am anxious to resume use with Fedora
26, since the bugs reportedly have been fixed.
So, after a routine pristine installation from the F26 Live XFCE iso,
and adding the httpd and gallery2 packages, I tried again,
but was dismayed to be presented with this error.

I am a novice in configuring a web server, so I searched for
instructions.  Googling for "gallery2 setup on Fedora 26" was not
productive; there seems to be nothing much newly written on gallery2
in recent years.  In /usr/share/gallery2/README.fedora it says gallery2
requires a database backend to function properly.  To provide it, I did
  systemctl enable mariadb
  systemctl start mariadb
  mysqladmin -u root password  'ginkoba'
  mysql -u root -pginkoba
  mysql>  create database gallery2;
  mysql>  exit;

Next, I obviously need a functioning webserver.  I assumed that the
delivered files in /etc/httpd/ would suffice, so I ran
  systemctl enable httpd
  systemctl start httpd

I made no attempt to "personalize" a web page in /var/www, assuming
that the default "web server" would suffice.  Similarly, I made no
attempt, as yet, to reference my historical gallery2 album files.
I simply pointed my browser (firefox) at 'datix.us/gallery2/install'
and was rejected.  Why?  How can that happen?

The message in /var/log/httpd/error_log seems unhelpful:
  [Fri Sep 01 13:15:03.680772 2017] [authz_core:error] [pid 10802] [client 192.168.2.1:46810] AH01630: client denied by server configuration: /usr/share/gallery2/install

Suspecting a permissions problem, I noted that all the files below 
/usr/share/gallery2/install are owned by root:root.  I changed them:
  chown -R apache /usr/share/gallery2/install
but that fixed nothing.  I changed them back.  (I shouldn't be
changing files in that area - they're owned and managed by dnf/rpm.)

What have I missed?  Why doesn't gallery2, as delivered, work?
How can I fix it?

Comment 1 Gwyn Ciesla 2017-09-05 13:59:24 UTC
Unfortunately I've not personally used gallery2 in some time.  It's also dead upstream, as is, I believe, it's successor, gallery3.  My suspicion is that gallery2 doesn't work with PHP 7, which has been in Fedora since Fedora 25.  I'm not sure if gallery3 works with PHP 7.  I would suggest one of the following:

1. Try gallery2 on CentOS 7.
2. Try gallery3 on Fedora 26.
3. Try gallery2 from an upstream download rather than the RPM, in case it's a packaging bug and not a PHP version issue.

I may need to retire gallery2.

Comment 2 Michael Cronenworth 2017-09-05 14:02:49 UTC
I'm using gallery2 on PHP 7 without a problem. It is an existing install.

Yes, upstream is dead for gallery2 and gallery3.

I'm using gallery2 with PostgreSQL. I don't know if MariaDB will work as it has deviated from MySQL slightly. Please try using PostgreSQL instead (a better choice anyway IMHO).

Comment 3 Gwyn Ciesla 2017-09-05 14:09:34 UTC
Interesting.

A. I see the client address in the above isn't 127.0.0.1, did you edit /etc/httpd/conf.d/gallery2.conf to allow that?

B. If gallery2 still can't find mariadb, if you don't want to change to PostgreSQL, try community-mysql.

Comment 4 David A. De Graaf 2017-09-05 19:45:35 UTC
Michael and Gwyn:
Thank you for taking an interest...

It would be truly sad if gallery[23] became unusable.
1) - it's a good program
2) - I have a ginormous collection of annotated family pics.

B - ...can't fine mariadb...
I seriously doubt that's the problem.  It doesn't seem that my rejection from the  'install' module ever got near the stage of trying to access the database.  In addition, according to my notes, when I last had gallery2 working (Fedora 24), it was working with mariadb.

A - I have most certainly have NOT edited /etc/httpd/conf.d/gallery2.conf, nor anything else in /etc/httpd/.  That's why I am dismayed that gallery2 and apache, as delivered, don't work together.  It seems likely that I am expected to edit some esoteric permissions or access rights for apache, but I haven't a clue what that might be.

For completeness, here's my /etc/httpd/conf.d/gallery2.conf file:

$ cat gallery2.conf
Alias /gallery2 /usr/share/gallery2

<Directory /usr/share/gallery2>
  AllowOverride Options FileInfo
</Directory>

I see nothing there that permits or restricts an IP address.

I can address the install module three different ways:  
  datix.us/gallery2/install
  datium/gallery2/install
  localhost/gallery2/install

The response in the firefox window is the same:
  Forbidden
  You don't have permission to access /gallery2/install on this server.

However the message in /var/log/httpd/error_log is a tiny bit different:

[Tue Sep 05 14:26:13.917280 2017] [authz_core:error] [pid 1225] [client 192.168.2.1:36392] AH01630: client denied by server configuration: /usr/share/gallery2/install

[Tue Sep 05 14:27:04.825909 2017] [authz_core:error] [pid 2980] [client 192.168.2.2:42014] AH01630: client denied by server configuration: /usr/share/gallery2/install

[Tue Sep 05 14:28:03.067990 2017] [authz_core:error] [pid 1227] [client ::1:58380] AH01630: client denied by server configuration: /usr/share/gallery2
/install

Using the public name (datix.us), the request comes from the router (192.168.2.1).
Using the local name (datium), the request comes from datium (192.168.2.2).
Using localhost, the request comes from ::1.

Firewalld is running, but I don't think that affects the public ports (36392, 42014, or 58380).  Selinux is disabled.

Is there anything I can change in the httpd hierarchy to make the error messages more informative.   ...or make it work!   :-)

Comment 5 Gwyn Ciesla 2017-09-06 16:24:19 UTC
Hmm, so it's not a firewall or selinux issue.

[authz_core:error] What configuration does this system have around authz?

Comment 6 David A. De Graaf 2017-09-07 16:48:49 UTC
Wow!  I have achieved utopia.  I have on my screen  Gallery Installer!
and can proceed to configuring gallery2.

Wanna know how?

First, Gwyn, I have never heard of authz; have no package on my system whose name includes that string; haven't the foggiest idea of what "configuration" it has.

However, googling for "authz_core:error" turned up an obscure quote
on a slightly different problem:	

Change your authorization configuration:

<Directory /home/remix/>
    #...
    Order allow,deny
    Allow from all
</Directory>

...to the Apache 2.4 version of the same.

<Directory /home/remix/>
    #...
    Require all granted
</Directory>

This suggestion was made 
  Aug 20 '12 at 15:36 by
  Shane Madden
- over five years ago!

I duly edited /etc/httpd/conf.d/gallery2.conf to read:
Alias /gallery2 /usr/share/gallery2

<Directory /usr/share/gallery2>
##  AllowOverride Options FileInfo
    Require all granted
</Directory>

and now it works; I can enter the sanctum sanctorum of gallery2/install.

This is, as they say, a mystery wrapped in an enigma.
I have no idea why it works or where I could look for a rational explanation.
Apparently, apache changed their cryptic security overlay and no one noticed.

But it is SURELY a bug in the packaging of gallery2.
I hope someone will fix it, please.

Thanks for all the help, Gwyn.

Comment 7 Gwyn Ciesla 2017-09-07 17:27:32 UTC
Wow, good work.  Yes, it is a packaging bug. I'll get out updates with a patched conf ASAP.

Thank you!

Comment 8 Fedora Update System 2017-09-07 17:41:19 UTC
gallery2-2.3.2-18.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-6a77ccbbd1

Comment 9 Fedora Update System 2017-09-07 17:41:26 UTC
gallery2-2.3.2-18.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-570113bdc9

Comment 10 Fedora Update System 2017-09-07 17:41:32 UTC
gallery2-2.3.2-18.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-b624fd8ad0

Comment 11 David A. De Graaf 2017-09-07 18:29:06 UTC
OK, that was the EASY one.  :-)

Working my way through  Gallery2 Installer  I got to Step 8 	Install Gallery Core - which generated a ton of error messages, terminating in a Fatal error: !

I've cut 'n pasted it all to a file (3063 lines - half are blank spacers) and then edited out 81 + 68 + 39 duplicates, leaving a file of 501 lines (half blank), which I will attach for your reading pleasure.

I suppose the vast number of "Deprecated: ..." messages are just warnings and can be ignored.  However the "Fatal Error:" cannot.

I can't make sense of that message.  Can you?

Comment 12 David A. De Graaf 2017-09-07 18:31:37 UTC
Created attachment 1323410 [details]
Error msgs from "8 	Install Gallery Core "

Comment 13 Gwyn Ciesla 2017-09-08 14:08:37 UTC
Eek.

Given that my PHP knowledge is rusty and somewhat stale since PHP7, I'd recommend finding someone more expert than myself in PHP exception handling.

Comment 14 Michael Cronenworth 2017-09-08 14:48:14 UTC
The issue is that I introduced a bug with the gallery2-php-warnings.patch to get some warnings squashed. I set a variable to null, but the code David is hitting is trying to use that variable and dereference it into a function. I will fix it.

Comment 15 Gwyn Ciesla 2017-09-08 14:50:07 UTC
Excellent, thank you!

Comment 16 Fedora Update System 2017-09-08 15:24:33 UTC
gallery2-2.3.2-18.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-b624fd8ad0

Comment 17 Fedora Update System 2017-09-08 15:55:42 UTC
gallery2-2.3.2-19.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-b624fd8ad0

Comment 18 David A. De Graaf 2017-09-08 16:57:52 UTC
Michael, thank you for your efforts to fix this code.  Please concentrate on the "Fatal Error:" segment.

Gwyn, if your "PHP knowledge is rusty", imagine how I feel.
With my level of expertise, I shouldn't even be allowed to think about this next question:
I wonder if any other packages have ignored the notation change in Apache 2.4.
So I looked for use of the problematic "AllowOverride":

[root@datium /etc/httpd]
# grep -r AllowOverride *
conf/httpd.conf:    AllowOverride none
conf/httpd.conf:    AllowOverride None
conf/httpd.conf:    # AllowOverride controls what directives may be placed in .htaccess files.
conf/httpd.conf:    AllowOverride None
conf/httpd.conf:    AllowOverride None
conf.d/gallery2.conf:##  AllowOverride Options FileInfo
conf.d/autoindex.conf:    AllowOverride None
conf.d/welcome.conf:    AllowOverride None
conf.d/gallery2.confSTD:  AllowOverride Options FileInfo
conf.d/userdir.conf:    AllowOverride FileInfo AuthConfig Limit Indexes
conf.d/mythweb.conf:        AllowOverride   All

Only userdir.conf looks suspicious to me.  I wonder if that usage is correct;  if not, what surprises lurk for the unwary?

Comment 19 Michael Cronenworth 2017-09-08 17:20:44 UTC
Please try the new build as it contains the fix for the PHP error.

gallery2-2.3.2-19

F27: https://bodhi.fedoraproject.org/updates/FEDORA-2017-b624fd8ad0
F26: https://koji.fedoraproject.org/koji/buildinfo?buildID=968103
F25: https://koji.fedoraproject.org/koji/buildinfo?buildID=968105

Comment 20 Gwyn Ciesla 2017-09-08 17:27:51 UTC
(In reply to David A. De Graaf from comment #18)
> Michael, thank you for your efforts to fix this code.  Please concentrate on
> the "Fatal Error:" segment.
> 
> Gwyn, if your "PHP knowledge is rusty", imagine how I feel.
> With my level of expertise, I shouldn't even be allowed to think about this
> next question:
> I wonder if any other packages have ignored the notation change in Apache
> 2.4.
> So I looked for use of the problematic "AllowOverride":
> 
> [root@datium /etc/httpd]
> # grep -r AllowOverride *
> conf/httpd.conf:    AllowOverride none
> conf/httpd.conf:    AllowOverride None
> conf/httpd.conf:    # AllowOverride controls what directives may be placed
> in .htaccess files.
> conf/httpd.conf:    AllowOverride None
> conf/httpd.conf:    AllowOverride None
> conf.d/gallery2.conf:##  AllowOverride Options FileInfo
> conf.d/autoindex.conf:    AllowOverride None
> conf.d/welcome.conf:    AllowOverride None
> conf.d/gallery2.confSTD:  AllowOverride Options FileInfo
> conf.d/userdir.conf:    AllowOverride FileInfo AuthConfig Limit Indexes
> conf.d/mythweb.conf:        AllowOverride   All
> 
> Only userdir.conf looks suspicious to me.  I wonder if that usage is
> correct;  if not, what surprises lurk for the unwary?

Entirely possible.  Please file bugs as needed. :)

Comment 21 David A. De Graaf 2017-09-08 21:01:57 UTC
Michael, we're making progress, but aren't there yet.
The new build for F26, F26: https://koji.fedoraproject.org/koji/buildinfo?buildID=968103 got almost to the end, but failed at Step 9 -
Install Plugins - with this display:

Not Found

The requested URL /gallery2/install/<br /><b>Deprecated</b>: Non-static method GallerySetupUtilities::areCookiesSupported() should not be called statically in <b>/usr/share/gallery2/install/index.php</b> on line <b>319</b><br />index.php was not found on this server.

The previous Step 8 - Install Gallery Core  elicited 11 "Deprecated:" warnings,
a gigantic improvement from before.  I'll include them as an attachment.

Incidentally, your "Please try the new build ..." left a bit to the imagination.
I'm not familiar with koji magic, so tediously clicked on each of the 76 packages to download them, one by one.  Then   'dnf update ./g*'  worked perfectly.
I'm sure there's an easier way...

Comment 22 David A. De Graaf 2017-09-08 21:04:11 UTC
Created attachment 1323934 [details]
Error msgs from installing gallery2.noarch 2.3.2-19.fc26

Comment 23 Michael Cronenworth 2017-09-08 21:41:31 UTC
Thanks for the log. Can you check the "error_log" of apache? Default directory: /var/log/httpd/

If there is nothing that explains the "not found" message there then I would have to guess there is an issue with the Apache config.

Comment 24 Michael Cronenworth 2017-09-08 21:42:22 UTC
(In reply to David A. De Graaf from comment #21)
> Incidentally, your "Please try the new build ..." left a bit to the
> imagination.
> I'm not familiar with koji magic, so tediously clicked on each of the 76
> packages to download them, one by one.  Then   'dnf update ./g*'  worked
> perfectly.
> I'm sure there's an easier way...

Yes, you can use "koji download-build <build#>" to grab them all at once.

Comment 25 Fedora Update System 2017-09-08 22:21:03 UTC
gallery2-2.3.2-18.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-6a77ccbbd1

Comment 26 Fedora Update System 2017-09-08 22:23:32 UTC
gallery2-2.3.2-18.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-570113bdc9

Comment 27 Fedora Update System 2017-09-09 13:46:25 UTC
gallery2-2.3.2-19.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-570113bdc9

Comment 28 Fedora Update System 2017-09-09 13:46:45 UTC
gallery2-2.3.2-19.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-6a77ccbbd1

Comment 29 Fedora Update System 2017-09-09 19:56:57 UTC
gallery2-2.3.2-19.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-b624fd8ad0

Comment 30 Fedora Update System 2017-09-10 05:53:08 UTC
gallery2-2.3.2-19.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-570113bdc9

Comment 31 Fedora Update System 2017-09-10 07:22:35 UTC
gallery2-2.3.2-19.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-6a77ccbbd1

Comment 32 Fedora Update System 2017-09-17 22:50:02 UTC
gallery2-2.3.2-19.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 33 Fedora Update System 2017-09-18 02:51:15 UTC
gallery2-2.3.2-19.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 34 Fedora Update System 2017-09-30 06:20:43 UTC
gallery2-2.3.2-19.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 35 David A. De Graaf 2017-10-19 18:59:48 UTC
Michael Cronenworth and Gwyn Ciesla:

I would like to close out this BZ with some comments.

I should have paid closer attention to the implications of
Comment 1 and realized that the gallery project is dead and
has been since 2014-06-20 - RIP.
This is confirmed in
   http://galleryproject.org/time-to-hibernate

Therefore, it is pointless to spend effort on fixing this broken
package.  Instead, in my opinion, the gallery2 and gallery3 packages
should be withdrawn.  That's sad, but it's reality.

There is a viable and reasonable replacement - piwigo - details at
   piwigo.org
This is an active project;  version 2.9.2 was released Oct 6, 2017.
Installation was dead easy.  I simply downloaded piwigo-2.9.2.zip,
unzip'd it, creating a new directory piwigo/,  rsync'd that entire
subtree to /var/www/html/datix/piwigo/, changed that name to photos/.
Then I created a new empty mariadb database, piwigo, alongside the
gallery2 database.  Then pointed firefox at datix.us/photos and,
bingo - "Congratulations, Piwigo installation is completed".

Perhaps best of all, there is a plugin called Menalto2Piwigo that
converts gallery2 data to piwigo data, automatically and flawlessly.

I really appreciate your efforts in trying to resuscitate gallery2
but it's time to give up I think.  I apologize for asking for help
in flogging this dead horse.

Comment 36 Gwyn Ciesla 2017-10-20 12:18:10 UTC
(In reply to David A. De Graaf from comment #35)

Agreed. I myself am prone to flogging dead horses, as I often use "legacy" software that still works.  I even maintain at least on package for Fedora where upstream is long gone but the code still builds and works and I use it.

I'll retire gallery2 and gallery3; they won't be available as of f28, and I'll  include a link to piwigo in the retirement notes.

If you'd like to see it packaged, please reach out to some of the more active PHP application packagers. I've largely stopped using PHP, and am so out of touch with it's current state that I really shouldn't be the one to take on new packages using it at this point.

Comment 37 Michael Cronenworth 2017-10-20 14:04:30 UTC
Please don't be so quick to take action. I will still want to maintain gallery2. It works for me and I still have a live instance.

Comment 38 Gwyn Ciesla 2017-10-20 14:07:10 UTC
I've already retired both, but you should be able to take ownership.

Comment 39 Michael Cronenworth 2017-10-20 14:08:07 UTC
Gwyn, please check ACLs next time.

I was the primary admin of gallery2.

Thanks.

Comment 40 Gwyn Ciesla 2017-10-20 14:09:06 UTC
My apologies.