upgrade to RC 2 -> database error

deep_dark_blue

Joined: 2010-03-26
Posts: 19
Posted: Fri, 2010-08-27 19:48

hi!

i successfully upgraded one gallery to RC2 on one of my sites, but trying to upgrade from RC1 to RC2 on another of my sites always creates a database error

the error message looks like this:

Quote:
Hey wait, you're an admin! We can tell you stuff.

Database_Exception [ Database Error ]:
#1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{user_access_tokens} TO user_access_keys' at line 1 [ RENAME TABLE {user_access_tokens} TO user_access_keys ]
SYSPATH/libraries/Database_Mysqli_Result.php[ 27 ]

22 }
23 elseif (is_bool($result))
24 {
25 if ($result == FALSE)
26 {
27 throw new Database_Exception('#:errno: :error [ :query ]',
28 array(':error' => $link->error,
29 ':query' => $sql,
30 ':errno' => $link->errno));
31 }
32 else
SYSPATH/libraries/Database_Mysqli.php[ 79 ] » Database_Mysqli_Result_Core->__construct( arguments )

SYSPATH/libraries/Database.php[ 272 ] » Database_Mysqli_Core->query_execute( arguments )

MODPATH/gallery/libraries/MY_Database.php[ 45 ] » Database_Core->query( arguments )

MODPATH/rest/helpers/rest_installer.php[ 38 ] » Database->query( arguments )

{PHP internal call} » rest_installer::upgrade( arguments )

MODPATH/gallery/helpers/module.php[ 208 ] » call_user_func_array( arguments )

MODPATH/gallery/controllers/upgrader.php[ 74 ] » module_Core::upgrade( arguments )

{PHP internal call} » Upgrader_Controller->upgrade()

SYSPATH/core/Kohana.php[ 331 ] » ReflectionMethod->invokeArgs( arguments )

{PHP internal call} » Kohana_Core::instance( arguments )

SYSPATH/core/Event.php[ 208 ] » call_user_func_array( arguments )

APPPATH/Bootstrap.php[ 67 ] » Event_Core::run( arguments )

DOCROOT/index.php[ 94 ] » require( arguments )

any ideas what i am doing wrong and how to fix it?

thanx in advance!
torsten

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Fri, 2010-08-27 20:09

Try grabbing the latest experimental code, grab it here:
http://github.com/gallery/gallery3/zipball/master

Upgrade instructions here:
http://codex.gallery2.org/Gallery3:Upgrading
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
deep_dark_blue

Joined: 2010-03-26
Posts: 19
Posted: Fri, 2010-08-27 20:42

thanx a lot, i tried it, but now i get an error message like this:

Quote:
:-(
Dang... Something went wrong!

We tried really hard, but it's broken.

Hey wait, you're an admin! We can tell you stuff.

There's an error message below and you can find more details in gallery3/var/logs (look for the file with the most recent date on it). Stuck? Stop by the Gallery 3 Forums and ask for help. You can also look at our list of open tickets to see if the problem you're seeing has been reported. If you post a request, here's some useful information to include:

and no further information is below...

any other ideas?
RC1 runs and works without problems on my server

torsten

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Fri, 2010-08-27 20:52

Is there anything in your gallery3/var/logs directory?

Quote:
RC1 runs and works without problems on my server

That sounds suspicious. Do you happen be running Apache 1.x on the server? Can you provide a link to your site?

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
deep_dark_blue

Joined: 2010-03-26
Posts: 19
Posted: Fri, 2010-08-27 21:11

apache 2.2.8

maybe you could take a look:

http://www.flying-frog.de/gallery3/index.php
RC1 - running nearly perfectly [since trying to upgrade to RC2 and downgrading again i just get the error message to install the rest module, which is installed]
there are no public pictures, so maybe this link does not help, but:

i just did a brand new and fresh install of RC2:
http://www.flying-frog.de/gallery3RC2/

if you try to get to the dashboard or to change settings i get the error message again

thank you so much for your efforts!
torsten

 
deep_dark_blue

Joined: 2010-03-26
Posts: 19
Posted: Fri, 2010-08-27 21:23

and another strange thing:
i have gallery3 RC2 running on the same server on another domain as well, and the upgrade from RC1 to RC2 has been no problem

maybe my database is corrupted?
---- edit:
i also created a new "var" and a brand new mysql database...
still the error...

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Fri, 2010-08-27 21:27

Try enabling the rewrite rules in .htaccess (that ships with G3), there's documentation inside that file for what to edit. If you have questions, just ask.

btw, I deleted your login info above.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
deep_dark_blue

Joined: 2010-03-26
Posts: 19
Posted: Fri, 2010-08-27 21:41

in wich format should i enter the url in the rewrite base line?

http://www.etcetc.com/etc???

or better how should the line look like? is this ok if the path is correct?
RewriteBase /gallery3

thanx for deleting the login - but it is just a temp-install...

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Fri, 2010-08-27 21:55

What ever directory G3 is in, so for your 2 installs you linked to above:

/gallery3 and /gallery3RC2 respectively

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
deep_dark_blue

Joined: 2010-03-26
Posts: 19
Posted: Fri, 2010-08-27 21:57

ok, i changed it - but i still get the error...

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Fri, 2010-08-27 22:08

Can you post a link to phpinfo?
FAQ: How do I create a phpinfo page?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
deep_dark_blue

Joined: 2010-03-26
Posts: 19
Posted: Sat, 2010-08-28 09:52
 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Sun, 2010-08-29 07:13

Odd. It's bombing on upgrading the rest module so try using the RC2 code again and move the modules/rest directory somewhere else (like /tmp) and then see if the rest of the upgrade completes. If it does, we can figure out what's going wrong with the rest module. It's doing something legit (renaming a table) so it *should* work, but we'll have to investigate.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
deep_dark_blue

Joined: 2010-03-26
Posts: 19
Posted: Sun, 2010-08-29 10:50

i made a fresh install of the latest code - no problems at all - it works perfectly without and even with the rest modul

BUT: when i move my old "var"-folder into the new gallery-folder i get the error again, so i think that there must be something wrong with[in] my "var"-folder

any ideas what i could try? any chance to reimport the old albums/permissions etc? or will i have to upload every image again and to rebuild the whole gallery???

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Sun, 2010-08-29 19:22

I'm sure it's fixable, but I don't have enough information to tell you what to do. I'm unclear about the current state of the problem since you've talked about upgrades and downgrades. What version of the code do you have now? And what error do you see when you try to use it? Let's go through this step by step and we'll fix it. Please provide details about what steps you took to get to where you are now.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
deep_dark_blue

Joined: 2010-03-26
Posts: 19
Posted: Sun, 2010-08-29 19:51

hi bharat!
thanx a lot for your support!

ok:
right now i have 2 versions in separate directories:

1. gallery3 RC1 running with a lot of albums, after trying to upgrade this version i got the error and i downgraded again, since then i have an error message that says that the rest module needs to be activated, although it is activated - but nevertheless, this version works...

2. as a test i installed RC2 [b1275ab], this install works without errors, but when i move my "var" folder from the RC1 directory to this RC2 directory i get the kohana-exception-error again

the same happened when i deleted everything inside the RC1 folder except of the var-folder, copied the RC2 relaese to that folder and ran the upgrader
as i don't know what the upgrader exactly does that means that probably the content of the var-folder is upgraded already and maybe this is the problem???

i hope it is clear, if not: don't hesitate to ask and i will provide you with all infos i can get ;)

torsten

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Sun, 2010-08-29 20:02

Ok, so let's ignore the 2nd install and focus on the first one. I'm pretty sure I know what went wrong, though I'm not positive. Can you give me a listing of your database tables? In MySQL just run "show tables" and paste that in here.

I think what happened is that somehow one of your REST tables is missing or named incorrectly. If you tell me the version of the rest module you have installed (look in the "modules" table in your database) I can tell you what steps to take to get that fixed up.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
deep_dark_blue

Joined: 2010-03-26
Posts: 19
Posted: Sun, 2010-08-29 20:21

hi bharat

i would love to give you the listing, but unfortunately i don't know how get into MySQL and how to run this command, i think i will have to ask my server admin, and for me [as a non-code-guru] it looks like i don't have the permission to do that

if you know plesk panel maybe you can give me advice how to get there, otherwise we'll have to wait until tomorrow and i'll ask my admin

i will send him an email now and ask...

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Sun, 2010-08-29 22:38

No hurry. During the week I tend to respond to forums once a day, so it may take us a few days to sort it out.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
deep_dark_blue

Joined: 2010-03-26
Posts: 19
Posted: Sun, 2010-08-29 23:22

no problem at all - i will post here as soon as i have the info
and i am not in a hurry ;)

thanx for your support, bharat!

 
deep_dark_blue

Joined: 2010-03-26
Posts: 19
Posted: Mon, 2010-08-30 11:30

ok, i already have the the "show tables" results:

Quote:
+--------------------------------+

| Tables_in_flying-frog_gallery3 |

+--------------------------------+

| access_caches |

| access_intents |

| caches |

| comments |

| exif_records |

| failed_auths |

| graphics_rules |

| groups |

| groups_users |

| incoming_translations |

| items |

| items_tags |

| logs |

| messages |

| modules |

| outgoing_translations |

| permissions |

| search_records |

| sessions |

| tags |

| tasks |

| themes |

| user_access_keys |

| users |

| vars |

+--------------------------------+

still waiting for the rest modules info and will post it here as soon as the admin found it ;)

torsten

 
deep_dark_blue

Joined: 2010-03-26
Posts: 19
Posted: Mon, 2010-08-30 21:21

and here is the modules table:

Quote:
+----+--------+-------------+---------+--------+

| id | active | name | version | weight |

+----+--------+-------------+---------+--------+

| 1 | 1 | gallery | 34 | 1 |

| 2 | 1 | user | 3 | 2 |

| 3 | 0 | comment | 3 | 3 |

| 4 | 1 | organize | 1 | 4 |

| 5 | 1 | info | 1 | 5 |

| 6 | 1 | rss | 1 | 6 |

| 7 | 1 | search | 1 | 7 |

| 8 | 1 | slideshow | 2 | 8 |

| 9 | 1 | tag | 1 | 9 |

| 10 | 1 | exif | 1 | 10 |

| 11 | 1 | recaptcha | 1 | 11 |

| 12 | 1 | menu_links | 1 | 12 |

| 13 | 0 | thumbnav | 1 | 13 |

| 14 | 1 | image_block | 1 | 14 |

| 15 | 1 | purifier | 1 | 15 |

| 16 | 1 | rest | 1 | 16 |

+----+--------+-------------+---------+--------+

i hope that helps ;)
torsten

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Thu, 2010-09-02 05:22

Ok, somehow what happened is that your user_access_tokens table got renamed to user_access_keys (which is supposed to happen) but the rest module stayed at version 1. So subsequent attempts to upgrade resulted in it trying and failing to rename the table again. I'm not sure how exactly that happened, but I've fixed it.

I've filed this ticket for it https://sourceforge.net/apps/trac/gallery/ticket/1325 and it's fixed in the latest experimental version of the code.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
deep_dark_blue

Joined: 2010-03-26
Posts: 19
Posted: Thu, 2010-09-02 08:06

perfect!
i will try it tonight and report back

thanx a lot!

 
deep_dark_blue

Joined: 2010-03-26
Posts: 19
Posted: Sun, 2010-09-05 10:15

hi bharat - unfortunately still the error message without any details

i used the latest code [gallery3-32d1892] and ran the upgrader, the upgrader reports successful upgrades of all modules, but once i visit the "new" index-page i get the error message again, without any details listed, just "dang - something went wrong"...

here are the tables as they look like right now:
http://www.flying-frog.de/torsten/ff_tables.pdf
and here are the modules:
http://www.flying-frog.de/torsten/ff_modules.pdf

any idea what i could try?

[i am moving my var folder back to the old install now, so if you need to try something, just let me know and i can move it back...]

thanx in advance
torsten

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Mon, 2010-09-06 18:43

Moving your var folder between versions of the code is probably making your situation worse, just fyi.

When you get the dang page, what's in your error logs?
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
deep_dark_blue

Joined: 2010-03-26
Posts: 19
Posted: Mon, 2010-09-06 20:42

well, but how could i update without moving the var folder and NOT losing all my images...?

error log [i had to move the var folder to the new install of RC2]:

Quote:
<?php defined('SYSPATH') or die('No direct script access.'); ?>

2010-09-06 13:18:06 -07:00 --- error: Kohana_Exception [ 42 ]: The requested views, page.html, could not be found
/srv/www/vhosts/flying-frog.de/httpdocs/gallery3_new/system/core/Kohana.php [ 806 ]
#0 /srv/www/vhosts/flying-frog.de/httpdocs/gallery3_new/system/libraries/View.php(83): Kohana_Core::find_file('views', 'page.html', true)
#1 /srv/www/vhosts/flying-frog.de/httpdocs/gallery3_new/system/libraries/View.php(49): View_Core->set_filename('page.html', NULL)
#2 /srv/www/vhosts/flying-frog.de/httpdocs/gallery3_new/modules/gallery/libraries/MY_View.php(56): View_Core->__construct('page.html', NULL, NULL)
#3 /srv/www/vhosts/flying-frog.de/httpdocs/gallery3_new/modules/gallery/libraries/Theme_View.php(32): View->__construct('page.html')
#4 /srv/www/vhosts/flying-frog.de/httpdocs/gallery3_new/modules/gallery/controllers/albums.php(63): Theme_View_Core->__construct('page.html', 'collection', 'album')
#5 /srv/www/vhosts/flying-frog.de/httpdocs/gallery3_new/modules/gallery/controllers/albums.php(22): Albums_Controller->show(Object(Item_Model))
#6 [internal function]: Albums_Controller->index()
#7 /srv/www/vhosts/flying-frog.de/httpdocs/gallery3_new/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Object(Albums_Controller), Array)
#8 [internal function]: Kohana_Core::instance(NULL)
#9 /srv/www/vhosts/flying-frog.de/httpdocs/gallery3_new/system/core/Event.php(208): call_user_func_array(Array, Array)
#10 /srv/www/vhosts/flying-frog.de/httpdocs/gallery3_new/application/Bootstrap.php(67): Event_Core::run('system.execute')
#11 /srv/www/vhosts/flying-frog.de/httpdocs/gallery3_new/index.php(94): require('/srv/www/vhosts...')
#12 {main}

hope this helps?

---edit:

if i don't move the var folder and make a brand new install with a new var-folder and a new mysql database everything works fine

maybe there is an option to reimport my "old" gallery??!

--- edit2:

ok - sorry bharat - i think i found the problem:
i used a customized theme that i changed - and i also had to change some of the files that are NOT in the themes folder, this seems to cause the problem - if i switch back to the wind theme, and after that move the var folder to the new install there are no errors reported, although my images are not displayed anymore...

i think you changed some locations [for example the location of the themeroller folder] that may cause the errors...
the only strange thing is, that i upgraded another of my websites without any problems - and this website uses [nearly] the same customized theme...

i think it is my problem and i have to check it in detail during the next days....

thanx a lot
torsten

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Mon, 2010-09-06 21:44

Ok whew! To fix your broken images, try going to Admin > Maintenance and running the "Fix" task and see if that resolves it.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git