MySQL error when upgrading from 1.4.1.6 to 1.4.2.2 locally, Admin pages broken

Hello,

I run MAMP 2.0.5 locally to test some of my servers on Mac OS X, and needed to update the version of Zenphoto from 1.4.1.6 to 1.4.2.2. MAMP runs PHP v5.3.6, MySQL v5.5.9, and Apache 2.2.21. Seemed to go fine, but after I hit the Go button to update the databases, I got this error:

About to update tables...
Zenphoto encountered an error
MySQL Query ( INSERT INTO `administrators` (`user`, `valid`, `date`) VALUES ('administrators', '0', '2012-03-15 11:32:53') ) failed. MySQL returned the error Table 'zenphoto.administrators' doesn't exist

AfterwardsZenphoto 1.4.2.2 appears to run fine: I can view the album. Unfortunately, I can only view the Users tab in the Admin pages. Any ideas why this had occurred, and how I may fix it?

Thanks in advance!

Comments

  • Does your database have an `administrators` table? The only thing that is slightly unusual is that there appears to be no "prefix" for your database tables. Is that as it should be?

    If there is no `administrators` table then you should re-run setup. If there is such a table, are the rows populated? If not you will have to create an admin user.

    You should also look at your logs to see if there were any PHP errors. The 1.4.1.6 `administrator` table should have come over to the 1.4.2.2 installation intact.
  • How odd: No, there isn't an `administrators` table. Fwiw, no, I purposely did not have a prefix set for my tables.

    I'll go check my logs, then trying re-running setup. (I'm also going to double-check if I was, in fact, running a version earlier than 1.4.1.6.) Thanks again!
  • Hrm, turns out I was actually running Zenphoto 1.4.0.3, according to what I see in `zp-core/version.php`. In addition, this is what I got in the PHP log:

    `
    [15-Mar-2012 11:51:26] PHP Fatal error: Call to a member function getAlbum() on a non-object in /Applications/MAMP/htdocs/zenphoto/zp-core/admin-functions.php on line 2082
    [15-Mar-2012 11:51:35] PHP Fatal error: Call to a member function getCustomData() on a non-object in /Applications/MAMP/htdocs/zenphoto/zp-core/zp-extensions/comment_form.php on line 697
    [15-Mar-2012 11:51:37] PHP Fatal error: Call to a member function getCustomData() on a non-object in /Applications/MAMP/htdocs/zenphoto/zp-core/zp-extensions/comment_form.php on line 697
    [15-Mar-2012 11:51:39] PHP Fatal error: Call to a member function getCustomData() on a non-object in /Applications/MAMP/htdocs/zenphoto/zp-core/zp-extensions/comment_form.php on line 697
    `
    Re-running setup resulted in the same MySQL error, so I'm going to try restoring the older installation from a backup, double-checking the db stables, and retrying the update.
  • Looks like my 1.4.0.3 installation, after restoration, was also broken: i.e., admin pages only showing the Users tab. I don't recall getting upgrade errors back when I had upgraded to 1.4.0.3, though.

    Since this is just a local installation, I should just go and reinstall from scratch, and see if I can restore the album data.
  • Side note: Fortunately, the upgrade of my live zenphoto site from 1.4.1.6 to 1.4.2.2 went fine. :)
  • Those errors are all probably caused by not having an administrators table (and therefore not an administrator.) So probably not the root cause of the problems.

    The upgrade from 1.4.0.3 should also not have been the issue.

    I am glad that your live site upgrade went well. But I guess we have no idea what caused the problems with the local site.
Sign In or Register to comment.