Bug 497098

Summary: gallery2-2.3-5.fc11 breaks due to php-Smarty changes
Product: [Fedora] Fedora Reporter: Daniel McNamara <daniel>
Component: gallery2Assignee: Gwyn Ciesla <gwync>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: rawhideCC: crow, gwync, mike, vchepkov
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-27 14:32:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Daniel McNamara 2009-04-22 11:13:37 UTC
Description of problem:

Original versions of gallery2 in worked as expected. Upgrade to latest version (gallery2-2.3-5.fc11) caused gallery2 to cease operation (you can't run the upgrade either). To fully test a fresh install was done. Configuration screens will work but upon completion gallery2 fails in the same manner


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

gallery2-2.3-5.fc11

How reproducible:

Every time

Steps to Reproduce:
1. Install gallery2 in Fedora 11 beta
2. Run through setup (this should work) - During install a warning will be shown that gallery2 is failing an intergretity check with the jar and php-Smarty files being missing.
3. At the end of setup gallery2 will show only blank output
  
Actual results:

Gallery2 failing due to errors

Expected results:

Shiny gallery stuff!

Additional info:

Appears related to the changes implemented for BZ 484240 - from the HTTP error logs:

[Wed Apr 22 20:47:22 2009] [error] [client 192.168.122.1] PHP Warning:  require_once(/usr/share/gallery2/modules/core/classes/../../../lib/smarty/Smarty.class.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /usr/share/gallery2/modules/core/classes/GalleryCoreApi.class on line 2827, referer: http://galdev.testme.lan/install/index.php?step=11
[Wed Apr 22 20:47:22 2009] [error] [client 192.168.122.1] PHP Fatal error:  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, referer: http://galdev.testme.lan/install/index.php?step=11


Random additional note: BZ 464566 referenced in the changelog appears incorrect. Possibly meant to be BZ 484566 ?

Comment 1 Gwyn Ciesla 2009-04-23 12:40:16 UTC
How does -7 work for you?

Comment 2 Gwyn Ciesla 2009-04-27 14:32:31 UTC

*** This bug has been marked as a duplicate of bug 484240 ***

Comment 3 David L. Crow 2009-04-28 16:10:38 UTC
I'm not exactly sure how I got into this state, but this morning after the gallery2-2.3-7.fc10.noarch upgrade was installed via yum updates, I did not have a "smarty" link or directory in /usr/share/gallery2/modules.

Force re-installing the rpm did not fix it because the logic to create the symlink looks like

  if [ -d /usr/share/gallery2/lib/smarty ]; then
    rm -rf /usr/share/gallery2/lib/smarty
    ln -s ../../php/Smarty /usr/share/gallery2/lib/smarty
  fi

Since the directory did not exist, no symlink was created.

Seeing the logic, I was able to create the symlink and am off and running, but thought I should report this for posterity and others trying to resolve this problem.

Comment 4 Gwyn Ciesla 2009-04-28 16:16:26 UTC
*** Bug 498019 has been marked as a duplicate of this bug. ***

Comment 5 Gwyn Ciesla 2009-04-28 16:18:21 UTC
I see the flaw, I should move the link creation out of the loop.

Comment 6 David L. Crow 2009-04-28 16:23:00 UTC
Be careful.  If the symlink already exists and the ln command currently in the script is run again, a symlink will get created in the link destination (i.e. /usr/share/php/Smarty).

Comment 7 Gwyn Ciesla 2009-04-28 16:45:35 UTC
New version I'm building is the following:

%pretrans
#symlink to system smarty
if [ -d /usr/share/gallery2/lib/smarty ]; then
  rm -rf /usr/share/gallery2/lib/smarty
fi
if [ ! -e /usr/share/gallery2/lib/smarty ]; then   
  ln -s ../../php/Smarty /usr/share/gallery2/lib/smarty
fi


This should prevent that eventuality.