Upgrade from 3.0.4 to 3.0.9: ORM Validation has failed

the_marx
the_marx's picture

Joined: 2013-11-18
Posts: 3
Posted: Mon, 2013-11-18 21:34

Hi all,

Ever since I tried to upgrade from 3.0.4 to 3.0.9, I get the ORM Validation has failed error in the upgrade tool and the Fix your Gallery script. I've heard about the double dot problem that might be the source, but I can't find any solution to my problem. Here's the recent log:

Quote:
2013-11-18 16:20:14 -05:00 --- error: ORM_Validation_Exception [ 44 ]: ORM Validation has failed for items model
/var/www/gallery/system/libraries/ORM_Validation_Exception.php [ 20 ]
#0 /var/www/gallery/system/libraries/ORM.php(755): ORM_Validation_Exception_Core::handle_validation('items', Object(Validation))
#1 /var/www/gallery/modules/gallery/models/item.php(887): ORM_Core->validate(NULL)
#2 /var/www/gallery/system/libraries/ORM.php(778): Item_Model_Core->validate()
#3 /var/www/gallery/modules/gallery/libraries/MY_ORM.php(34): ORM_Core->save()
#4 /var/www/gallery/modules/gallery/libraries/ORM_MPTT.php(79): ORM->save()
#5 /var/www/gallery/modules/gallery/models/item.php(457): ORM_MPTT_Core->save()
#6 /var/www/gallery/modules/gallery/helpers/gallery_installer.php(714): Item_Model_Core->save()
#7 [internal function]: gallery_installer::upgrade('49')
#8 /var/www/gallery/modules/gallery/helpers/module.php(230): call_user_func_array(Array, Array)
#9 /var/www/gallery/modules/gallery/controllers/upgrader.php(74): module_Core::upgrade('gallery')
#10 [internal function]: Upgrader_Controller->upgrade()
#11 /var/www/gallery/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Object(Upgrader_Controller), Array)
#12 [internal function]: Kohana_Core::instance(NULL)
#13 /var/www/gallery/system/core/Event.php(208): call_user_func_array(Array, Array)
#14 /var/www/gallery/application/Bootstrap.php(67): Event_Core::run('system.execute')
#15 /var/www/gallery/index.php(116): require('/var/www/galler...')
#16 {main}
2013-11-18 16:20:14 -05:00 --- error: Validation errors: Array
(
[parent_id] => invalid

And here is the details of the server it is running on:

Quote:
Platform information

Host name: nodoka
Operating system: Linux 3.2.0-4-686-pae
Apache: Apache/2.2.22 (Debian)
PHP: 5.4.4-14+deb7u5
MySQL: 5.5.31-0+wheezy1
Server load: 0.04 0.11 0.14
Graphics toolkit: gd

Gallery stats

Version: 3.0.9 (Chartres)
Albums: 119
Photos: 3967

Thanks in advance for your help!

 
the_marx
the_marx's picture

Joined: 2013-11-18
Posts: 3
Posted: Thu, 2013-11-21 15:49

UPDATE

I did find some photos that were empty, so I deleted them all and tried the upgrade and maintenance script; still got the same ORM Validation has failed for items model error.
I also tried the hack in the maintenance script described here: http://galleryproject.org/node/111361#comment-403401. Unfortunately, this doesn't work either. After 1 or 2 seconds, the window displays the same error.

Thanks in advance for your help!

 
the_marx
the_marx's picture

Joined: 2013-11-18
Posts: 3
Posted: Thu, 2013-11-21 22:56

I have found my problem:

Seems that some items had a NULL value in relative_path_cache and relative_url_cache. Deleting those items in Gallery solved the problem. Here is how I did it:

1. In phpmyadmin, I sorted the items table with relative_path_cache.
2. I deleted each item in Gallery.
3. Some of them wouldn't be found using Gallery's search bar, so I deleted them directly in phpmyadmin.
4. I ran the Fix your Gallery script.
5. Then I ran the updater.

Now everything is running smoothly, and I'm in the process of reimporting everything I deleted.

Hope this helps someone else!