[SOLVED] Error in upgrade from beta1 .8 to beta1 .9

johnc

Joined: 2003-06-10
Posts: 17
Posted: Mon, 2005-03-07 16:34

Hello Everyone,

Installed beta 2 v.8 it wants to automagically upgrade to .9 today, and this is the error message I am receiving. Any tips?

Thanks!

JC

Stack Trace:
Error (ERROR_STORAGE_FAILURE, ERROR_UNKNOWN)

* in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 1162 (gallerystatus::error)
* in modules/core/classes/GalleryStorage.class at line 241 (mysqldatabasestorage::execute)
* in modules/core/CoreModuleExtras.inc at line 330 (gallerystorage::execute)
* in modules/core/module.inc at line 512 (coremoduleextras::upgrade)
* in modules/core/classes/GalleryModule.class at line 137 (coremodule::upgrade)
* in upgrade/steps/UpgradeCoreModuleStep.class at line 68 (coremodule::installorupgrade)
* in upgrade/index.php at line 155 (upgradecoremodulestep::loadtemplatedata)

Debug Output:

(mysql): SHOW TABLES

realpath(/home/johnc/public_html/gallery2/modules/core/classes/../../..)
Binding text domain: modules_core ->
/home/johnc/public_html/gallery2/modules/core/locale
file_exists(/home/johnc/public_html/gallery2/g2data//versions.dat)
file_exists(/home/johnc/public_html/gallery2/modules/core/classes/GalleryStorage/../../../../modules/core/classes/GalleryStorage/DatabaseStorage/schema/platform/mysql)
opendir(/home/johnc/public_html/gallery2/modules/core/classes/GalleryStorage/../../../../modules/core/classes/GalleryStorage/DatabaseStorage/schema/platform/mysql)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
readdir(Resource id #40)
closedir(Resource id #40)

(mysql): SHOW TABLES

(mysql): SELECT g_name, g_major, g_minor FROM g2_Schema

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-03-07 16:40

johnc, are you sure that's the whole output? at the end, it should go on...

mindless, why does it query the same db query again and again? is this just inefficient because there's no efficiency required in the upgrade process or something else?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-03-07 16:53

valiant, I think file caching is turned off in the upgrader.
johnc, look for the error message near the bottom of the debug output and post that instead of trying to post the whole thing, which appears to be truncated. Also, there is no "beta 2" and if you're really upgrading from ".8" I wouldn't expect that to work (alpha-2 or 3?).. what exact core version does the upgrader say you're upgrading from?

 
johnc

Joined: 2003-06-10
Posts: 17
Posted: Mon, 2005-03-07 16:58

sorry about the post length. It said to post it all, and for all I knew, the part you would need was right in the middle. =)

Here's the error message at the bottom.

1051: Unknown table 'g2_ItemPropertiesMap'

adodb_mysql._execute(
DROP TABLE g2_ItemPropertiesMap
, false) % line 833, file: adodb.inc.php
adodb_mysql.execute(
DROP TABLE g2_ItemPropertiesMap
, Array[0]) % line 1156, file: DatabaseStorage.class
mysqldatabasestorage.execute(
DROP TABLE [GalleryItemPropertiesMap]
, Array[0]) % line 241, file: GalleryStorage.class
gallerystorage.execute(
DROP TABLE [GalleryItemPropertiesMap]
) % line 330, file: CoreModuleExtras.inc
coremoduleextras.upgrade(Object:coremodule, null) % line 512, file: module.inc

realpath(/home/johnc/public_html/gallery2/modules/core/classes/../../../)

Also, sorry for the improper terminology. It's beta 1 of gallery 2.

Downloaded this file:

gallery-2.0-beta-1.tar.gz

After the initial setup, it worked last week. Needed to re-install, and this week, after the initial setup, it goes into this upgrade mode.

JC

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-03-07 17:08

Why did you have to reinstall? Because of errors?
If you do a reinstall, you have to empty your g2data directory. Make it really empty, no files or directories should be left before you start the installer again. And make sure to drop the database or drop all G2 tables before you reinstall.

 
johnc

Joined: 2003-06-10
Posts: 17
Posted: Mon, 2005-03-07 22:19

Nuked the entire directory, dropped all of the tables, reinstalled....same error.

1051: Unknown table 'g2_ItemPropertiesMap'

adodb_mysql._execute(
DROP TABLE g2_ItemPropertiesMap
, false) % line 833, file: adodb.inc.php
adodb_mysql.execute(
DROP TABLE g2_ItemPropertiesMap
, Array[0]) % line 1156, file: DatabaseStorage.class
mysqldatabasestorage.execute(
DROP TABLE [GalleryItemPropertiesMap]
, Array[0]) % line 241, file: GalleryStorage.class
gallerystorage.execute(
DROP TABLE [GalleryItemPropertiesMap]
) % line 330, file: CoreModuleExtras.inc
coremoduleextras.upgrade(Object:coremodule, null) % line 512, file: module.inc

realpath(/home/johnc/public_html/gallery2/modules/core/classes/../../../)

 
johnc

Joined: 2003-06-10
Posts: 17
Posted: Mon, 2005-03-07 22:22

The fairly obvious answer is that the table g2_ItemPropertiesMap doesn't exist.

+--------------------------+
| Tables_in_johnc_db |
+--------------------------+
| evo_antispam |
| evo_blogs |
| evo_blogusers |
| evo_categories |
| evo_comments |
| evo_groups |
| evo_hitlog |
| evo_locales |
| evo_postcats |
| evo_posts |
| evo_settings |
| evo_users |
| g2_AlbumItem |
| g2_AnimationItem |
| g2_ChildEntity |
| g2_Comment |
| g2_CustomFieldMap |
| g2_DataItem |
| g2_Derivative |
| g2_DerivativeImage |
| g2_DerivativePrefsMap |
| g2_DescendentCountsMap |
| g2_Entity |
| g2_ExifPropertiesMap |
| g2_ExternalIdMap |
| g2_FactoryMap |
| g2_FileSystemEntity |
| g2_G1MigrateMap |
| g2_Group |
| g2_ImageBlockCacheMap |
| g2_ImageBlockDisabledMap |
| g2_Item |
| g2_ItemAttributesMap |
| g2_Lock |
| g2_MovieItem |
| g2_PendingUser |
| g2_PermissionMap |
| g2_PermissionSetMap |
| g2_PhotoItem |
| g2_PluginMap |
| g2_PluginParameterMap |
| g2_Schema |
| g2_SequenceId |
| g2_SequenceLock |
| g2_ThumbnailImage |
| g2_TkOperatnMap |
| g2_TkOperatnMimeTypeMap |
| g2_TkOperatnParameterMap |
| g2_TkPropertyMap |
| g2_TkPropertyMimeTypeMap |
| g2_UnknownItem |
| g2_User |
| g2_UserGroupMap |
| g2_WatermarkImage |
+--------------------------+
54 rows in set (0.00 sec)

So, anyone know where this was supposed to be created? Can anyone tell me the structure of the table?

JC

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-03-07 22:37

smells like a corrupted codebase.
delete g2data, drop the db.
delete home/johnc/public_html/gallery2/* and reupload gallery2 to your server.
my guess is that you mixed gallery2 code/files from your previous install with the current install
or
that you ignored a "missing files" message during the G2 installation.

remember: don't use winzip to unarchive G2, it may corrupt the directory structure. use another program.
and if possible, don't use FTP to upload G2 to your server. if possible, upload G2 archived as gallery2.tar.gz or gallery.tar.gz to your server and unarchive it on the server.

 
johnc

Joined: 2003-06-10
Posts: 17
Posted: Mon, 2005-03-07 22:42

This is exactly what I did. Running linux. Did a:

1) rm -rf public_html/gallery2
2) Dropped all g2_* tables from mysql
3) Got no "missing files" messages

Using tar -zxvf <filename> to un-archive.

Downloading gallery2 with wget straight to the machine.

Dunno...any other ideas?

JC

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-03-07 22:48

i haven't debugged in detail, but the most likely cause of this is a versions.dat file already exists in the g2data storage directory you provide. make sure it is completely empty... (no mention of this in your steps above, unless your g2data dir was under your gallery2 dir). maybe clear cookies too before installing?
if this isn't the problem i can try to debug on your server if you PM me ssh/ftp access.

 
johnc

Joined: 2003-06-10
Posts: 17
Posted: Mon, 2005-03-07 22:51

OK....I fixed it.....just added a table.....

mysql> create table g2_ItemPropertiesMap (
-> my_id bigint(11)
-> );

And it then went through.

JC

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-03-07 23:08

oh well, that doesn't help us fix it for other people....

 
johnc

Joined: 2003-06-10
Posts: 17
Posted: Tue, 2005-03-08 16:17

Yes, my g2data directory was under my gallery2 directory. Anything and everything to do with gallery2 was completely removed from the file system.

Unfortunately the server I'm on doesn't have EXEC set up for apache, so any files that apache creates, I can't delete. I'd start from scratch again, but I have to get the admin to nuke the directory, and it's a PITA.

JC

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-03-08 16:22

you can delete the files.. you just have to do it through the webserver..
<?php system("rm -r /path/to/g2data/*"); ?>
make a test.php file that does what you want and access it with your browser (then remove the php file!)

 
johnc

Joined: 2003-06-10
Posts: 17
Posted: Tue, 2005-03-08 17:24

huh....that was a damn good idea, but it doesn't seem to work.

[johnc@degas ~/public_html]$ cat temp.php
<html>
<body>
Hello, time to delete!

<?php system("rm -rf /home/johnc/public_html/gallery2/g2data/*"); ?>

</body>
</html>

I tried executing it from the command line, and from a web browser....neither work.

Any other ideas?

JC

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-03-08 17:44

that should work if the path is correct..
you can try other commands in the system call to see what's wrong..
ls
pwd
touch

 
johnc

Joined: 2003-06-10
Posts: 17
Posted: Tue, 2005-03-08 18:14

it's strange, I can get it to touch a file (creates it as apache:apache) and I can get it to delete that file, but it won't delete the existing directory structure under g2data.

JC

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-03-08 18:28

execute this script:
<?php
exec('whoami', $ret);
print 'whoami: '.join('',$ret).'<br>';
exec('ls -la /home/johnc/public_html/gallery2/g2data/*', $ret);
foreach ($ret as $val) print $val.'<br>';
?>

to see if the webserver user owns these files. IMO you can delete these files with a ftp client. you uploaded them, right?

 
johnc

Joined: 2003-06-10
Posts: 17
Posted: Tue, 2005-03-08 18:35

No. Didn't upload any files. Everything in the g2data directory was created by gallery2, thus the apache:apache ownership.

I also checked to see if safemode was on in PHP, and it is not. This may help.

http://cherbini.net/install/phpinfo.php

Results of your script below...

Hello, time to delete! whoami: apache
apache
/home/johnc/public_html/gallery2/g2data/albums:
total 48
drwxr-xr-x 12 apache apache 4096 Mar 7 16:12 .
drwxrwxrwx 7 johnc johnc 4096 Mar 8 11:10 ..
drwxr-xr-x 6 apache apache 4096 Mar 7 15:55 Dogs
drwxr-xr-x 19 apache apache 4096 Mar 7 15:55 Family
drwxr-xr-x 26 apache apache 4096 Mar 7 15:56 Friends
drwxr-xr-x 5 apache apache 4096 Mar 7 15:56 Woodworking
drwxr-xr-x 2 apache apache 4096 Mar 7 16:12 album48
drwxr-xr-x 2 apache apache 4096 Mar 7 16:12 album48_0
drwxr-xr-x 9 apache apache 4096 Mar 7 15:54 katie_and_i
drwxr-xr-x 4 apache apache 4096 Mar 7 15:54 miscellaneous
drwxr-xr-x 16 apache apache 4096 Mar 7 15:54 outdoor_fun
drwxr-xr-x 25 apache apache 4096 Mar 7 15:53 travels_0

/home/johnc/public_html/gallery2/g2data/cache:
total 24
drwxr-xr-x 6 apache apache 4096 Mar 7 15:48 .
drwxrwxrwx 7 johnc johnc 4096 Mar 8 11:10 ..
drwxr-xr-x 2 apache apache 4096 Mar 8 10:19 derivative
drwxr-xr-x 12 apache apache 4096 Mar 7 15:52 entity
drwxr-xr-x 8 apache apache 4096 Mar 7 15:48 layout
drwxr-xr-x 41 apache apache 4096 Mar 7 15:48 module

/home/johnc/public_html/gallery2/g2data/locks:
total 48
drwxr-xr-x 12 apache apache 4096 Mar 7 14:41 .
drwxrwxrwx 7 johnc johnc 4096 Mar 8 11:10 ..
drwxr-xr-x 12 apache apache 4096 Mar 7 14:41 0
drwxr-xr-x 12 apache apache 4096 Mar 7 14:41 1
drwxr-xr-x 12 apache apache 4096 Mar 7 14:41 2
drwxr-xr-x 12 apache apache 4096 Mar 7 14:41 3
drwxr-xr-x 12 apache apache 4096 Mar 7 14:41 4
drwxr-xr-x 12 apache apache 4096 Mar 7 14:41 5
drwxr-xr-x 12 apache apache 4096 Mar 7 14:41 6
drwxr-xr-x 12 apache apache 4096 Mar 7 14:41 7
drwxr-xr-x 12 apache apache 4096 Mar 7 14:41 8
drwxr-xr-x 12 apache apache 4096 Mar 7 14:41 9

/home/johnc/public_html/gallery2/g2data/sessions:
total 16
drwxr-xr-x 2 apache apache 4096 Mar 7 21:51 .
drwxrwxrwx 7 johnc johnc 4096 Mar 8 11:10 ..
-rw-r--r-- 1 apache apache 6156 Mar 7 21:53 2b774bc8e4f859680c9d8ed11206a28c

/home/johnc/public_html/gallery2/g2data/smarty:
total 12
drwxr-xr-x 3 apache apache 4096 Mar 7 14:41 .
drwxrwxrwx 7 johnc johnc 4096 Mar 8 11:10 ..
drwxr-xr-x 4 apache apache 4096 Mar 7 15:49 templates_c

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-03-08 18:46

sorry, confused g2data with gallery2 folder.
what we see here is quite strange. you say you can create delete files with php scripts, but you cannot delete the contents of g2data with it.

i don't see any reason why you a php script executed as apache couldn't rm -rf /home/johnc/public_html/gallery2/g2data/smarty and other folders in g2data.
and rm -rf /home/johnc/public_html/gallery2/g2data/ didn't work either?

 
johnc

Joined: 2003-06-10
Posts: 17
Posted: Tue, 2005-03-08 19:32

Everything you said is correct. If I put this in the file,

<?php exec('touch /home/johnc/public_html/gallery2/g2data/johnc_temp.temp'); ?>

I get this:

[johnc@degas ~/public_html]$ ls -la gallery2/g2data/
total 28
drwxrwxrwx 7 johnc johnc 4096 Mar 8 12:29 .
drwxr-xr-x 3 johnc johnc 4096 Mar 8 10:17 ..
drwxr-xr-x 12 apache apache 4096 Mar 7 16:12 albums
drwxr-xr-x 6 apache apache 4096 Mar 7 15:48 cache
-rw-r--r-- 1 apache apache 0 Mar 8 12:29 johnc_temp.temp
drwxr-xr-x 12 apache apache 4096 Mar 7 14:41 locks
drwxr-xr-x 2 apache apache 4096 Mar 7 21:51 sessions
drwxr-xr-x 3 apache apache 4096 Mar 7 14:41 smarty
[johnc@degas ~/public_html]$

Then I put this in:

<?php exec('rm -rf /home/johnc/public_html/gallery2/g2data/johnc_temp.temp'); ?>

And I get:

[johnc@degas ~/public_html]$ ls -la gallery2/g2data/
total 28
drwxrwxrwx 7 johnc johnc 4096 Mar 8 12:30 .
drwxr-xr-x 3 johnc johnc 4096 Mar 8 10:17 ..
drwxr-xr-x 12 apache apache 4096 Mar 7 16:12 albums
drwxr-xr-x 6 apache apache 4096 Mar 7 15:48 cache
drwxr-xr-x 12 apache apache 4096 Mar 7 14:41 locks
drwxr-xr-x 2 apache apache 4096 Mar 7 21:51 sessions
drwxr-xr-x 3 apache apache 4096 Mar 7 14:41 smarty
[johnc@degas ~/public_html]$

So, it definitely works. I have no idea why it won't nuke the rest of the directory.

No matter which part of the directory structure I point it at, I get permission denied.

JC

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-03-08 20:38

try /bin/rm instead of rm
maybe there is an alias for rm or something.

 
johnc

Joined: 2003-06-10
Posts: 17
Posted: Tue, 2005-03-08 21:03

No dice. This is quite odd.

JC

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-03-08 22:55

well, i'm marking this topic as solved as we've now strayed into a different problem that isn't really gallery related. good luck!