Bug 498334 - Missing smarty link or wrong absolute path to smarty class in gallery2
Missing smarty link or wrong absolute path to smarty class in gallery2
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: gallery2 (Show other bugs)
10
All Linux
low Severity medium
: ---
: ---
Assigned To: Gwyn Ciesla
Fedora Extras Quality Assurance
:
: 500124 500985 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-29 17:25 EDT by Martí­n Marqués
Modified: 2009-06-15 22:44 EDT (History)
9 users (show)

See Also:
Fixed In Version: 2.3-12.fc10
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-06-15 22:44:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Martí­n Marqués 2009-04-29 17:25:08 EDT
Description of problem:

Latest gallery2 update couldn't get the marty class files, and so couldn't show the web pages.

Version-Release number of selected component (if applicable):

# rpm -q gallery2
gallery2-2.3-7.fc10.noarch


How reproducible:

After finishing the upgrade, open the main gallery2 page and nothing shows. In php log I get:

PHP Warning:  GalleryCoreApi::require_once(/usr/share/gallery2/modules/core/classes/../../../lib/smarty/Smarty.class.php) [<a href='gallerycoreapi.require-once'>gallerycoreapi.require-once</a>]: failed to open stream: No existe el fichero o el directorio in /usr/share/gallery2/modules/core/classes/GalleryCoreApi.class on line 2827
 PHP Fatal error:  GalleryCoreApi::require_once() [<a href='function.require'>function.require</a>]: Failed opening required'/usr/share/gallery2/modules/core/classes/../../../lib/smarty/Smarty.class.php' (include_path='.:/usr/share/pear:/usr/share/php') in /usr/share/gallery2/modules/core/classes/GalleryCoreApi.class on line 2827
^

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Gwyn Ciesla 2009-04-30 13:07:59 EDT
Known issue, discussion of solutions:

https://fedorahosted.org/rel-eng/ticket/1674
Comment 2 Jan Houtsma 2009-05-06 04:23:29 EDT
Note that after adding the symlink solution as described in the comment and link above the following error occurs when you go to the upgrade path step 2:

Missing files:
==============
lib/smarty/COPYING.lib
lib/smarty/README
modules/core/classes/GalleryStorage/g2_db2.jar

Changed files:
==============
lib/smarty/Smarty_Compiler.class.php
lib/smarty/plugins/modifier.debug_print_var.php

Especially the g2_db2 worries me. 

Thanks, Jan
Comment 3 Gwyn Ciesla 2009-05-07 12:39:56 EDT
The lib/smarty files are in error, and can be fixed by reinstalling php-Smarty.  A subsequent update will prevent this happening again.  The g2_db2 is correctly removed, as it and the other jars had to be pulled for legal reasons.
Comment 4 Gwyn Ciesla 2009-05-11 08:18:35 EDT
*** Bug 500124 has been marked as a duplicate of this bug. ***
Comment 5 Gwyn Ciesla 2009-05-11 10:43:56 EDT
Please see gallery2-2.3-9.fc10 in koji.  I'll submit for updates-testing.
Comment 6 Fedora Update System 2009-05-11 10:44:54 EDT
gallery2-2.3-9.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/gallery2-2.3-9.fc10
Comment 7 Jan Houtsma 2009-05-11 11:38:19 EDT
After downloading the gallery2 updated 2.3.9 rpms above to my server local hard disk and applying the following command:

yum --nogpgcheck localupdate gallery2-2.3-9.fc10.noarch.rpm gallery2-classic-2.3-9.fc10.noarch.rpm gallery2-httpauth-2.3-9.fc10.noarch.rpm gallery2-matrix-2.3-9.fc10.noarch.rpm gallery2-tile-2.3-9.fc10.noarch.rpm gallery2-rewrite-2.3-9.fc10.noarch.rpm

the link was *not* created.

Also (after again applying the symlink by hand) it still gave me the same errors as already indicated in comment #2. 

Do i miss something?

Thanks, Jan
Comment 8 Gwyn Ciesla 2009-05-11 11:42:10 EDT
So you did have the symlink, updated, and then it was missing?
Comment 9 Jan Houtsma 2009-05-11 11:47:48 EDT
No, before 2.3.9 (so in 2.3.7) i had the symlink added by hand via 

[17:43:root@pegasus /usr/share/gallery2/lib]# cd /usr/share/gallery2/lib
[17:43:root@pegasus /usr/share/gallery2/lib]# ln -s /usr/share/php/Smarty smarty

Which worked with the errors from comment #2.

Then today, i downloaded the new 2.3.9. rpms, removed the symlink again, executed the yum --nogpgcheck localupdate gallery2-2.3-9.fc10.noarch.rpm
gallery2-classic-2.3-9.fc10.noarch.rpm gallery2-httpauth-2.3-9.fc10.noarch.rpm
gallery2-matrix-2.3-9.fc10.noarch.rpm gallery2-tile-2.3-9.fc10.noarch.rpm
gallery2-rewrite-2.3-9.fc10.noarch.rpm

and the symlink was *not* created. So now in 2.3.9 i created it by hand again.

After that i ran the upgrade URL. And still gave me the same errors as in 2.3.7 (comment #2).

Thanks, Jan
Comment 10 Gwyn Ciesla 2009-05-11 11:53:19 EDT
Odd.  I had the symlink previously, and had it on upgrade.  Rex, any insights?
Comment 11 Toshio Ernie Kuratomi 2009-05-11 12:51:49 EDT
Rex, symlink replacing directory problem here.
Comment 12 Rex Dieter 2009-05-11 15:28:58 EDT
Seems I missed seeing comment #10

this trick works to replace dirs with symlinks (in my own tests).

What we failed to account for was the upgrade from the pkg with symlink to pkg using %ghost + %post scriptlet.  In that case, the symlink seems to go awol.
Comment 13 Gwyn Ciesla 2009-05-11 15:47:55 EDT
What if we go from this:

if [ -d %{installprefix}/gallery2/lib/smarty -a ! -L %{installprefix}/gallery2/lib/smarty ]; then
    mv %{installprefix}/gallery2/lib/smarty %{installprefix}/gallery2/lib/smarty.rpmbak && \
    ln -s ../../php/Smarty %{installprefix}/gallery2/lib/smarty && \
    rm -rf %{installprefix}/gallery2/lib/smarty.rpmbak
fi 


to this:


if [ -d %{installprefix}/gallery2/lib/smarty -a ! -L %{installprefix}/gallery2/lib/smarty ]; then
    mv %{installprefix}/gallery2/lib/smarty %{installprefix}/gallery2/lib/smarty.rpmbak && \
    ln -s ../../php/Smarty %{installprefix}/gallery2/lib/smarty && \
    rm -rf %{installprefix}/gallery2/lib/smarty.rpmbak
fi 
if [ ! -L %{installprefix}/gallery2/lib/smarty ]; then
  ln -s ../../php/Smarty %{installprefix}/gallery2/lib/smarty
fi


Would that not catch that case and fail acceptably for the others?  Inelegant to be sure, but. . .
Comment 14 Jan Houtsma 2009-05-11 16:45:47 EDT
That would fix my case regarding the symlink for sure. How about the upgrade warnings that still remain after this fix (see comment #2)?

Thanks, jan
Comment 15 Fedora Update System 2009-05-11 23:55:19 EDT
gallery2-2.3-9.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update gallery2'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-4695
Comment 16 Gwyn Ciesla 2009-05-12 10:09:55 EDT
That would fix all but the g2_db2, which isn't getting fixed. 

Rex, if you think this will fly, I'll build it.
Comment 17 Gwyn Ciesla 2009-05-14 11:53:05 EDT
gallery2-2.3-10.fc11 is built, with changes from #13.  Seems to work for me.
Comment 18 Gwyn Ciesla 2009-05-15 07:59:38 EDT
*** Bug 500985 has been marked as a duplicate of this bug. ***
Comment 19 Fedora Update System 2009-05-18 10:24:19 EDT
gallery2-2.3-10.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/gallery2-2.3-10.fc10
Comment 20 Fedora Update System 2009-05-18 22:12:55 EDT
gallery2-2.3-10.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update gallery2'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-5146
Comment 21 Joel 2009-05-21 03:31:50 EDT
This update still broke my smarty install.  I had to rpm -e and reinstall the package.
Comment 22 Gwyn Ciesla 2009-05-21 08:11:41 EDT
Odd, I had another report that it was fine.  Was this -9 to -10, or some earlier version?
Comment 23 Joel 2009-05-21 09:45:18 EDT
Ah sorry.  Details.  

It might not actually be a bug in the current package.  I am running fc9 on this machine.  Before I upgrade to newest fedora, I always upgrade the server softwares first.  That way I control my variables when something goes wrong.

Previously I was running gallery2 2.3.1.fc10 rebuilt on fc9.  I upgraded using yum upgrade to 2.3.10.fc10, rebuilt on fc9.

In the upgrade, the entire contents of smarty were erased (everything at the end of the softlink coming out of gallery2 into smarty.
Comment 24 Gwyn Ciesla 2009-05-21 10:08:51 EDT
I think that's an artifact of the apparently broken way the bundled Smarty was initially removed in 2.2.4-3.
Comment 25 Fedora Update System 2009-05-21 12:05:56 EDT
gallery2-2.3-11.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/gallery2-2.3-11.fc10
Comment 26 Fedora Update System 2009-05-25 17:08:34 EDT
gallery2-2.3-11.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update gallery2'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-5433
Comment 27 Fedora Update System 2009-05-27 12:36:51 EDT
gallery2-2.3-12.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/gallery2-2.3-12.fc10
Comment 28 Fedora Update System 2009-05-28 03:59:34 EDT
gallery2-2.3-12.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update gallery2'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-5545
Comment 29 Fedora Update System 2009-06-15 22:44:02 EDT
gallery2-2.3-12.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.