Ubuntu

gallery2 2.3 php 5.3 incompatibility

Reported by stel on 2010-05-10
118
This bug affects 17 people
Affects Status Importance Assigned to Milestone
gallery2 (Ubuntu)
High
Unassigned
Lucid
High
Unassigned

Bug Description

Binary package hint: gallery2

following errors when accessing gallery2 page

Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/gallery2/bootstrap.inc on line 43

 Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/gallery2/modules/core/classes/GalleryUtilities.class on line 854

 Warning: Cannot modify header information - headers already sent by (output started at /usr/share/gallery2/bootstrap.inc:43) in /usr/share/gallery2/modules/core/classes/GalleryPhpVm.class on line 142

apparently due to php 5.3 incompatibility. apparently newer version 2.3.1 of gallery2 is available but not in repositories. see http://gallery.menalto.com/node/95919

The gallery2 2.3-1 package should probably depend on php < 5.3, but it is not available in the stable distro anymore..
So, the ugly and easy way out was to remove the dependancy so that the distro does not recognize the problem?

Perhaps I could run testing as well, at least the apps would be a bit more fresh.. stable LTS is not that much more tested, and problems like these are not very much recognized anyway.

btanoue (btanoue) wrote :

Hi,

Does anyone have a work around. Is there a different version of gallery that I can get that is compatible with Lucid?

My gallery is dead until I can get this up.

Note:
Instead of being notified, you can also hit the (+) radio buttion, and say it affects you.

btanoue

i'm still waiting too.

On Sunday, May 23, 2010 06:52:53 pm btanoue wrote:
> Hi,
>
> Does anyone have a work around. Is there a different version of gallery
> that I can get that is compatible with Lucid?
>
> My gallery is dead until I can get this up.
>
>
> Note:
> Instead of being notified, you can also hit the (+) radio buttion, and say
> it affects you.
>
> btanoue

--
_____________________________________________
stel valavanis http://www.onshore.com/

stel (stel-onshore) wrote :

why can't the newer version of gallery be put into the repositories?

On Friday, May 14, 2010 02:05:36 pm Kristian Bäckström wrote:
> The gallery2 2.3-1 package should probably depend on php < 5.3, but it is
> not available in the stable distro anymore.. So, the ugly and easy way out
> was to remove the dependancy so that the distro does not recognize the
> problem?
>
> Perhaps I could run testing as well, at least the apps would be a bit
> more fresh.. stable LTS is not that much more tested, and problems like
> these are not very much recognized anyway.

--
_____________________________________________
stel valavanis http://www.onshore.com/

That's exactly what I wonder as well..

And why not at least correct the insufficient package dependancys? It would prevent installation of the gallery2 package with inproper php combination.

Bjørn Roald (bjorn-4roald) wrote :

I have this problem with gallery2 and Joomla on my server.

Joomla is not from (k)ubuntu repo though. Nevertheless, I need to roll back PHP version or get these two PHP packages upgraded. Have no time now to figure out what to do, so my site is down :-(

stel (stel-onshore) wrote :

you could also just install the latest svn version of gallery2.

On Tuesday, May 25, 2010 03:20:34 pm you wrote:
> I have this problem with gallery2 and Joomla on my server.
>
> Joomla is not from (k)ubuntu repo though. Nevertheless, I need to roll
> back PHP version or get these two PHP packages upgraded. Have no time
> now to figure out what to do, so my site is down :-(
--
_____________________________________________
stel valavanis http://www.onshore.com/

Bjørn Roald (bjorn-4roald) wrote :

On 05/26/2010 07:10 AM, stel wrote:
> you could also just install the latest svn version of gallery2.
>

Has anybody confirmed that this solves the problem?

In that case - are you talking about trunk or a release version I must
get with SVN?

In any case, the gallery2 web site: http://gallery.menalto.com/ --
which seems to be a redirect from http://gallery2.org/ -- has the
following release statement:

 > Gallery 2.3.1 (Skidoo) Released
 > Submitted by mindless on Thu, 2009-12-17 04:49
 > Gallery 2.3.1 (Skidoo) is now available for download! This release
adds compatibility with PHP 5.3, with
 > minor enhancements in a couple plugins.

To me it looks like this is what is needed. However - the seemingly
broken the dep package installed after my 10.04 dist-upgrade of kubuntu is:

gallery2 - 2.3-1ubuntu3(all)

is this not based on gallery 2.3.1 or is something else in play here ?

stel (stel-onshore) wrote :

sounds like 2.3.1 would do the trick. i won't get around to trying it soon but
please report if you do and let's get a shout out to the package maintainer.

On Wednesday, May 26, 2010 12:59:52 am you wrote:
> On 05/26/2010 07:10 AM, stel wrote:
> > you could also just install the latest svn version of gallery2.
>
> Has anybody confirmed that this solves the problem?
>
> In that case - are you talking about trunk or a release version I must
> get with SVN?
>
> In any case, the gallery2 web site: http://gallery.menalto.com/ --
> which seems to be a redirect from http://gallery2.org/ -- has the
>
> following release statement:
> > Gallery 2.3.1 (Skidoo) Released
> > Submitted by mindless on Thu, 2009-12-17 04:49
> > Gallery 2.3.1 (Skidoo) is now available for download! This release
>
> adds compatibility with PHP 5.3, with
>
> > minor enhancements in a couple plugins.
>
> To me it looks like this is what is needed. However - the seemingly
> broken the dep package installed after my 10.04 dist-upgrade of kubuntu is:
>
> gallery2 - 2.3-1ubuntu3(all)
>
> is this not based on gallery 2.3.1 or is something else in play here ?
--
_____________________________________________
stel valavanis http://www.onshore.com/

Charlie_Smotherman (cjsmo) wrote :

Possible reasons why 2.3.1 hasn't been merged from debian:
1) There are currently 38 open bugs in debian with 2 of those bugs being RC bugs.
http://packages.qa.debian.org/g/gallery2.html
2) There are currently 29 open CVE's against gallery2 .
http://security-tracker.debian.org/tracker/source-package/gallery2

Do we really want this package in Ubuntu?

stel (stel-onshore) wrote :

ouch

On Wednesday, May 26, 2010 02:29:09 am you wrote:
> Possible reasons why 2.3.1 hasn't been merged from debian:
> 1) There are currently 38 open bugs in debian with 2 of those bugs being RC
> bugs. http://packages.qa.debian.org/g/gallery2.html
> 2) There are currently 29 open CVE's against gallery2 .
> http://security-tracker.debian.org/tracker/source-package/gallery2
>
> Do we really want this package in Ubuntu?
--
_____________________________________________
stel valavanis http://www.onshore.com/

If those 29 CVE's are open, then why are they listed under the 'Resolved issues' heading and not the 'Open issues' heading? If I open the issues, it states "fixed".

Charlie_Smotherman (cjsmo) wrote :

I have merged 2.3.1 from debian and it is available in my ppa. I have done minimal testing (install, remove, purge). My server is currently broken so I am unable to test gallery2 in great detail. Please test it :)

https://edge.launchpad.net/~cjsmo/+archive/ppa/+packages

It seems that I have to downgrade php and gallery2 to get the gallery back online again.
Do I need to downgrade the whole distro (I'm now running lucid) or what would you suggest?

Lucid is too unstable for me.

Bjørn Roald (bjorn-4roald) wrote :

On 05/27/2010 07:06 AM, Charlie_Smotherman (porthose) wrote:
> I have merged 2.3.1 from debian and it is available in my ppa. I have
> done minimal testing (install, remove, purge). My server is currently
> broken so I am unable to test gallery2 in great detail. Please test it
> :)
>
> https://edge.launchpad.net/~cjsmo/+archive/ppa/+packages
>
Charlie, thanks for doing this. However I did not succeed to test this
as I did not manage to install it. This is probably since I am not
familiar with using PPAs. I followed the instructions to add PPA to my
system and tried to install the package, but it does not seem to pick it
or find it. I did:

sudo add-apt-repository ppa:cjsmo/ppa
sudo apt-get update
sudo apt-get dist-upgrade

Among other things, all seems normal and working too me except your
package does not come out of the void. Can I force it to be selected,
listed or something? Thanks.

Charlie_Smotherman (cjsmo) wrote :

Bjorn,

You could grab the .deb directly:

wget https://edge.launchpad.net/~cjsmo/+archive/ppa/+files/gallery2_2.3.1.dfsg-1ubuntu1~ppa1_all.deb

or you can also use dget and grab the src package

dget https://edge.launchpad.net/~cjsmo/+archive/ppa/+files/gallery2_2.3.1.dfsg-1ubuntu1~ppa1.dsc

I am hoping I will have time this weekend to really test 2.3.1 in a maverick VM. If tests on maverick go well upload. It may be worth a SRU || Backport to lucid. :)

dpkg -i gallery2_2.3.1.dfsg-1ubuntu1~ppa1_all.deb
(Reading database ... 211361 files and directories currently installed.)
Preparing to replace gallery2 2.3-1ubuntu3 (using gallery2_2.3.1.dfsg-1ubuntu1~ppa1_all.deb) ...
Unpacking replacement gallery2 ...
Setting up gallery2 (2.3.1.dfsg-1ubuntu1~ppa1) ...
ln: creating symbolic link `/usr/share/gallery2/lib/smarty': No such file or directory
dpkg: error processing gallery2 (--install):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 gallery2

Artemis3 (artemis3) wrote :

Hello Kristian, you have been bitten by bug #558961: https://bugs.launchpad.net/ubuntu/+source/gallery2/+bug/558961
It is triggered simply by reinstalling gallery2 (has nothing to do with the ppa). IIRC the workaround is to purge gallery2.

Thanks, I got my gallery online again.

stel (stel-onshore) wrote :

i am still having problems. i've used charlie's ppa but the gallery2 pkg seems to be marked as a "maverick" package and not lucid. so when i install it (i'm on lucid), i still get the 2.3 version from the mains. i also grabbed the deb and when i install it i get an error from apache that it can't find the gallery2 apache include file. so i touch that file and i no longer get an apache error but still no joy as there's no gallery2 virtual host without a config file. something's not installing right. i even purged 2.3 first. maybe it has something to do with the db admin passowrd i'm prompted to put in. i'm not sure if that's something i have from something before or if it's new. i assumed it was a new password to define but maybe i'm wrong.

Charlie_Smotherman (cjsmo) wrote :

Ok got things sorted out in debian/gallery2.postrm which was removing both /etc/gallery2 and /usr/share/gallery2 during upgrade. Will have to do an SRU of 2.3 first, then we can proceed with merging 2.3.1. Sorry for the delay

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gallery2 - 2.3-1ubuntu5

---------------
gallery2 (2.3-1ubuntu5) maverick; urgency=low

  * debian/gallery2.postrm only remove /etc/gallery2 and /usr/share/gallery2 on purge.
    (LP: #578137)
 -- Charlie Smotheraman <email address hidden> Thur, 15 Jul 2010 13:35:15 -0500

Changed in gallery2 (Ubuntu):
status: New → Fix Released
Charlie_Smotherman (cjsmo) wrote :

Here is a minimal patch that allows the upgrade from gallery2-2.3-1ubuntu3 to gallery2-2.3.1-1ubuntu1 to complete.

To reproduce this bug install gallery2-2.3-1ubuntu3, then upgrade to gallery2-2.3.1-1ubuntu1~ppa2. When the installation is complete check for /etc/gallery2 and /usr/share/gallery2, and you will noticed that they are not present, which is a serious regression and leaves the package unusable.

https://edge.launchpad.net/~cjsmo/+archive/ppa/+files/gallery2_2.3.1.dfsg-1ubuntu1~ppa2_all.deb

Subscribing ubuntu-sru

Charlie_Smotherman (cjsmo) wrote :
Martin Pitt (pitti) wrote :

Ah, nice catch. Please upload to lucid, SRU approved.

Changed in gallery2 (Ubuntu Lucid):
status: New → Fix Committed
tags: added: verification-needed

Accepted gallery2 into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

SRU Verification Lucid:
The patch intriduce the following regression and prevent the package to upgrade from 2.3-1ubuntu3

Preparing to replace gallery2 2.3-1ubuntu3 (using .../gallery2_2.3-1ubuntu3.1_all.deb) ...
Unpacking replacement gallery2 ...
Setting up gallery2 (2.3-1ubuntu3.1) ...
ln: creating symbolic link `/usr/share/gallery2/lib/smarty': No such file or directory
dpkg: error processing gallery2 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 gallery2
E: Sub-process /usr/bin/dpkg returned an error code (1)

Marking as verification-failed

Changed in gallery2 (Ubuntu Lucid):
status: Fix Committed → Confirmed
tags: added: regression-proposed verification-failed
removed: verification-needed
Charlie_Smotherman (cjsmo) wrote :

Jean,

Could you please check to see if /etc/gallery2 and /usr/share/gallery2 are present, after upgrade.

Charlie, no they aren't there any more since they are removed in the old postrm and that's what this sru is intended to fix.
You should probably specifically handle the upgrade from version 2.3-1ubuntu2 and recreate the directories, without forgetting to save the config files in /etc/gallery2 prior to the execution of the old-postrm.

Jean-Baptiste Lallement [2010-07-17 21:57 -0000]:
> Charlie, no they aren't there any more since they are removed in the
> old postrm and that's what this sru is intended to fix. You should
> probably specifically handle the upgrade from version 2.3-1ubuntu2
> and recreate the directories, without forgetting to save the config
> files in /etc/gallery2 prior to the execution of the old-postrm.

This can be done in the preinst script. It should copy/move away the
files/dirs, and then the postinst script can move them back on
upgrade.

Charlie_Smotherman (cjsmo) wrote :

Jean,

I'm confused, if I understand you correctly, what you are saying is to add a prerm to 2.3-1ubuntu2 that moves /etc/gallery2 and /usr/share/gallery2 to a temp location, let the old-postrm run and then re-add /etc/gallery2 and /usr/share/gallery2 in the postinst, is this correct?

Sorry, it was not my intention to confuse you.
I meant exactly the same thing than Martin. In new-preinst (new being 2.3-1ubuntu3.2 in lucid and 2.3-1ubuntu6 in maverick) copy the content of /etc/gallery2 to a temp directory, let the old-postrm run, and then restore the files in the new-postinst.
I mentioned 2.3-1ubuntu2 because that's the version which introduced the problem and only upgrades from this version or newer will suffer from the bug.

Charlie_Smotherman (cjsmo) wrote :

Jean,

Sorry this has taken so long, but real life has gotten in the way (again)

I have created a branch for 2.3-1ubuntu3.2 if you would please test it.
lp:~cjsmo/+junk/g2-2.3-3.2-fix

It seems Gallery2 will be removed from squeeze, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=590602

Best regards
Charlie

Hi Charlie,

In the preinst I think you need to save both /etc/gallery2 and /usr/share/gallery2 because they are deleted by the old-postrm after the unpack phase. I would also check the version. It's useless to manipulate this files if the versions are not affected.
So the preinst would be something like:
---- gallery2.preinst ----
#! /bin/sh

set -e

BACKUPDIR=/tmp/gallery2
ETCDIR=/etc/gallery2
SHAREDIR=/usr/share/gallery2

if [ "$1" = upgrade ]; then
 if dpkg --compare-versions "$2" ge-nl 2.3-1ubuntu2 &&
     dpkg --compare-versions "$2" lt "2.3-1ubuntu3.2"; then
  mkdir -p ${BACKUPDIR}${ETCDIR}
  mkdir -p ${BACKUPDIR}${SHAREDIR}

  cp -a $ETCDIR/* ${BACKUPDIR}${ETCDIR}
  cp -a $SHAREDIR/* ${BACKUPDIR}${SHAREDIR}
 fi
fi

#DEBHELPER#

exit 0

Regarding the postinst, correct me if I'm wrong, but there is no 'upgrade' action for postinst scripts and everything needs to be done in the 'configure'. So the restore phase would look like
$ diff -u gallery2-2.3/debian/gallery2.postinst ./gallery2.postinst
--- gallery2-2.3/debian/gallery2.postinst 2010-08-02 11:03:42.000000000 +0200
+++ ./gallery2.postinst 2010-08-02 12:39:53.433622450 +0200
@@ -5,8 +5,22 @@
 . /usr/share/debconf/confmodule
 db_version 2.0 || [ $? -lt 30 ]

-
 if [ "$1" = "configure" ]; then
+ if dpkg --compare-versions "$2" lt "2.3-1ubuntu3.2" \
+ && dpkg --compare-versions "$2" ge-nl "2.3-1ubuntu2" ; then
+ # Restore directory deleted by old postrm
+ BACKUPDIR=/tmp/gallery2
+ ETCDIR=/etc/gallery2
+ SHAREDIR=/usr/share/gallery2
+
+ if [ -d "${BACKUPDIR}${ETCDIR}" -a ! -d "$ETCDIR" ]; then
+ cp -a ${BACKUPDIR}${ETCDIR} $ETCDIR
+ fi
+
+ if [ -d "${BACKUPDIR}${SHAREDIR}" -a ! -d "$SHAREDIR" ]; then
+ cp -a ${BACKUPDIR}${SHAREDIR} $SHAREDIR
+ fi
+ fi

     if [ ! -L /usr/share/gallery2/lib/smarty ]; then
         if [ -d /usr/share/gallery2/lib/smarty ]; then

The issue is that we restore files from a previous version of the package to a newer one. But that should not hurt because there was no change to theses files between the versions 2.3-1ubuntu3.2 and 2.3-1ubuntu2 of gallery2.
This is not heavily tested but preliminary tests shows that the upgrade is not failing anymore and that the deleted directories are there after the upgrade.

What do you think ?

Charlie_Smotherman (cjsmo) wrote :

Jean,

IMHO, backing up /usr/share/gallery2 is not needed. Theses file are replaced by the new files during upgrade (it's the same version so they are the same). I have also noticed that during upgrade /etc/galery2/config.php is regenerated so backing it up is not needed. IMHO the only file that needs to be preserved is /etc/gallery2/apache.conf, during upgrade, this will also preserve any changes the user may have made to /etc/gallery2/apache.conf such as additional vhosts and multi-site configurations.

I uploaded gallery2-2.3-1ubuntu6 before I noticed your response, so I will go ahead and upload gallery2-2.3-1ubuntu3.2 to proposed.

I have tested gallery2-2.3-1ubuntu1 -> gallery2-2.3-1ubuntu3.2 -> gallery2-2.3-1ubuntu6 upgrade path with the upgrade completing successfully.

gallery2-2.3-1ubuntu3.2 and gallery2-2.3-1ubuntu6 both install, remove and purge correctly.

Best regards
Charlie Smotherman

tags: added: verification-needed
removed: regression-proposed verification-failed

Accepted gallery2 into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in gallery2 (Ubuntu Lucid):
status: Confirmed → Fix Committed
Loïc Minier (lool) wrote :

Just upgraded from lucid's 2.3-1ubuntu3 to lucid-proposed's 2.3-1ubuntu3.3:

Setting up gallery2 (2.3-1ubuntu3.3) ...
ln: creating symbolic link `/usr/share/gallery2/lib/smarty': No such file or directory
dpkg: error processing gallery2 (--configure):
 subprocess installed post-installation script returned error exit status 1

The old postrm completely wiped my gallery install.

# ls /usr/share/gallery2 /etc/gallery2
ls: cannot access /usr/share/gallery2: No such file or directory
ls: cannot access /etc/gallery2: No such file or directory

Please retract this proposed update ASAP as people tracking -proposed will lose their gallery2 data on upgrade.

tags: added: verification-failed
removed: verification-needed
Loïc Minier (lool) wrote :

So this is not really related to this bug report, but any upgrade from the lucid version will rm -rf /etc/gallery and /usr/share/gallery2, and people end up without these dirs (and without their config data, obviously); it's a serious issue.

The preinst for the -proposed package should take steps to avoid this removal on upgrades.

I can think of a terribly evil way to do it, which would be to patch the postrm of the old package, that's the simplest implementation, but it's really evil. The full implementation would involve taking some kind of backup, and moving it back in place, or moving the data before the upgrade and then moving it back.

Loïc Minier (lool) on 2010-09-02
Changed in gallery2 (Ubuntu):
importance: Undecided → High
Changed in gallery2 (Ubuntu Lucid):
importance: Undecided → High
Martin Pitt (pitti) wrote :

OK, I removed the lucid-proposed package again.

Changed in gallery2 (Ubuntu Lucid):
status: Fix Committed → Triaged
tags: removed: verification-failed

Loïc, that's the proposed fix in comment #35. The latest upload to -proposed doesn't fix it because the files are unpacked before the postrm is executed. Hence the files from the new package are deleted. That's why I suggested to backup both /etc/gallery2 _and_ /usr/share/gallery2 in preinst.
This is not a really satisfying solution because we would mix files from the old package with the new one, but I don't see a better way to fix the package in lucid.

Loïc Minier (lool) wrote :

I checked policy to make sure, and there is no maintainer script from the new package which is called between unpack and the old postrm; it seems to me that the only way is to patch the old postrm in the new preinst. :-/

btanoue (btanoue) wrote :

Hi,

I've been busy. Haven't kept up with all the work on the bug fix.
Some questions.

1. Is Gallery2 going to be removed in Debian AND Ubuntu in the next release?
2. If I backup my /etc/gallery2 and /usr/share/gallery2 and get the fix version, will it install?
3. Do I need to copy back the backed up directories after the install?

Sorry for being a Noob.

btanoue

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.