[Installation] Other modules won't install in step 8

RwD
RwD's picture

Joined: 2005-01-09
Posts: 383
Posted: Sun, 2005-01-09 22:20

I was trying the latest nightly build (but the versions before had the same prob) and at step 8 the program tells me "Unable to initialize our Gallery data".

After changing some lines of code I found the problem occurs in file \install\steps\InstallOtherModulesStep.class at function loadTemplateData (on line 32 the message is created). I echoed the stacktrace directly after it happened:

Error (ERROR_STORAGE_FAILURE)
in c:\inetpub\wwwroot\gallery2\modules\core\classes\GalleryStorage\DatabaseStorage.class at line 735 (gallerystatus::error) 
in c:\inetpub\wwwroot\gallery2\modules\core\classes\GalleryStorage.class at line 220 (mysqldatabasestorage::search) 
in c:\inetpub\wwwroot\gallery2\modules\core\classes\Gallery.class at line 184 (gallerystorage::search) 
in c:\inetpub\wwwroot\gallery2\modules\core\classes\helpers\GalleryPluginHelper_simple.class at line 234 (gallery::search) 
in c:\inetpub\wwwroot\gallery2\modules\core\classes\helpers\GalleryPluginHelper_simple.class at line 175 (gallerypluginhelper_simple::fetchallparameters) 
in c:\inetpub\wwwroot\gallery2\modules\core\classes\GalleryCoreApi.class at line 180 (gallerypluginhelper_simple::getparameter) 
in c:\inetpub\wwwroot\gallery2\modules\core\classes\Gallery.class at line 468 (gallerycoreapi::getpluginparameter) 
in c:\inetpub\wwwroot\gallery2\modules\core\classes\Gallery.class at line 440 (gallery::getactivelanguagecode) 
in c:\inetpub\wwwroot\gallery2\init.php at line 129 (gallery::inittranslator) 
in c:\inetpub\wwwroot\gallery2\install\steps\InstallOtherModulesStep.class at line 30
in c:\inetpub\wwwroot\gallery2\install\index.php at line 160 (installothermodulesstep::loadtemplatedata) 

I think this problem has some relation to the query in this file:
\modules\core\classes\GalleryStorage\DatabaseStorage\schema\platform\mysql\GalleryPluginParameterMap.sql
Because when I ignore the problem of the installation then gallery2 doesn't work. It gives the following db error: mysqlt error: [1146: Table 'gallery2.g2_pluginparametermap' doesn't exist]StakTrace for this was:

Error (ERROR_STORAGE_FAILURE) : 
in c:\inetpub\wwwroot\gallery2\modules\core\classes\GalleryStorage\DatabaseStorage.class at line 735 (gallerystatus::error) 
in c:\inetpub\wwwroot\gallery2\modules\core\classes\GalleryStorage.class at line 220 (mysqldatabasestorage::search) 
in c:\inetpub\wwwroot\gallery2\modules\core\classes\Gallery.class at line 184 (gallerystorage::search) 
in c:\inetpub\wwwroot\gallery2\modules\core\classes\helpers\GalleryPluginHelper_simple.class at line 234 (gallery::search) 
in c:\inetpub\wwwroot\gallery2\modules\core\classes\helpers\GalleryPluginHelper_simple.class at line 175 (gallerypluginhelper_simple::fetchallparameters) 
in c:\inetpub\wwwroot\gallery2\modules\core\classes\GalleryCoreApi.class at line 180 (gallerypluginhelper_simple::getparameter) 
in c:\inetpub\wwwroot\gallery2\modules\core\classes\Gallery.class at line 468 (gallerycoreapi::getpluginparameter) 
in c:\inetpub\wwwroot\gallery2\modules\core\classes\Gallery.class at line 440 (gallery::getactivelanguagecode) 
in c:\inetpub\wwwroot\gallery2\init.php at line 129 (gallery::inittranslator) 
in c:\inetpub\wwwroot\gallery2\main.php at line 32

The query in the file I mentioned is wrong because the unique key length is over 1000 characters according to MySQL, I count varchar 128+128+128 + whatever the length of an int(11) is. So I do not really get it but I created the query and ran it on my MySQL 4.1.7-NT. This is the result:

SQL-query: 

CREATE TABLE g2_PluginParameterMap(

g_pluginType varchar( 128 ) NOT NULL ,
g_pluginId varchar( 128 ) NOT NULL ,
g_itemId int( 11 ) NOT NULL ,
g_parameterName varchar( 128 ) NOT NULL ,
g_parameterValue varchar( 255 ) NOT NULL ,
UNIQUE KEY ( g_pluginType, g_pluginId, g_itemId, g_parameterName ) ,
INDEX ( g_pluginType, g_pluginId, g_itemId ) ,
INDEX ( g_pluginType ) 
) TYPE = MYISAM 
MySQL returned:  

#1071 - Specified key was too long; max key length is 1000 bytes 

I just hope anybody has a suggestion. This is the first gallery I encounter of which the html setup seems good (no use of tables for design is basically the big issue for me, I want to play with css :P)

----

Gallery2 version: @version $Revision: 1.8 $ $Date: 2005/01/06 07:07:28 $
Webserver (with version): IIS (whichever comes with xp (4 or 5))
Datatabase (with version): MySQL 4.1.7
PHP version (eg 4.2.1): 4.3.10
phpinfo URL (optional):
Graphics Toolkit(s):
Operating system: winXP professional SP2
Web browser/version: any; IE6 FF1.0

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2005-01-10 05:16

That's strange! The key length is nowhere near 1000 bytes. I tried it on Window:

C:\apps\apachefriends\xampp\mysql\bin>mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.0.21-debug-log
...
mysql> CREATE TABLE g2_PluginParameterMap(
    ->
    -> g_pluginType varchar( 128 ) NOT NULL ,
    -> g_pluginId varchar( 128 ) NOT NULL ,
    -> g_itemId int( 11 ) NOT NULL ,
    -> g_parameterName varchar( 128 ) NOT NULL ,
    -> g_parameterValue varchar( 255 ) NOT NULL ,
    -> UNIQUE KEY ( g_pluginType, g_pluginId, g_itemId, g_parameterName ) ,
    -> INDEX ( g_pluginType, g_pluginId, g_itemId ) ,
    -> INDEX ( g_pluginType )
    -> ) TYPE = MYISAM ;
Query OK, 0 rows affected (0.02 sec)

mysql> describe g2_PluginParameterMap;
+------------------+--------------+------+-----+---------+-------+
| Field            | Type         | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+-------+
| g_pluginType     | varchar(128) |      | PRI |         |       |
| g_pluginId       | varchar(128) |      | PRI |         |       |
| g_itemId         | int(11)      |      | PRI | 0       |       |
| g_parameterName  | varchar(128) |      | PRI |         |       |
| g_parameterValue | varchar(255) |      |     |         |       |
+------------------+--------------+------+-----+---------+-------+
5 rows in set (0.00 sec)

And on Debian:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 125 to server version: 4.0.22-log
...
mysql> CREATE TABLE g2_PluginParameterMap(
    -> 
    -> g_pluginType varchar( 128 ) NOT NULL ,
    -> g_pluginId varchar( 128 ) NOT NULL ,
    -> g_itemId int( 11 ) NOT NULL ,
    -> g_parameterName varchar( 128 ) NOT NULL ,
    -> g_parameterValue varchar( 255 ) NOT NULL ,
    -> UNIQUE KEY ( g_pluginType, g_pluginId, g_itemId, g_parameterName ) ,
    -> INDEX ( g_pluginType, g_pluginId, g_itemId ) ,
    -> INDEX ( g_pluginType )
    -> ) TYPE = MYISAM
    -> ;
Query OK, 0 rows affected (0.01 sec)
mysql> describe g2_PluginParameterMap;
+------------------+--------------+------+-----+---------+-------+
| Field            | Type         | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+-------+
| g_pluginType     | varchar(128) |      | PRI |         |       |
| g_pluginId       | varchar(128) |      | PRI |         |       |
| g_itemId         | int(11)      |      | PRI | 0       |       |
| g_parameterName  | varchar(128) |      | PRI |         |       |
| g_parameterValue | varchar(255) |      |     |         |       |
+------------------+--------------+------+-----+---------+-------+

I cut and paste the SQL from your post so I know it's exactly the same. Perhaps this is some strange MySQL configuration setting? I looked in my.cnf and didn't see anything related to key sizes. Maybe it's a difference between 4.0 and 4.1? If so, sounds like it might be a bug to me...

 
RwD
RwD's picture

Joined: 2005-01-09
Posts: 383
Posted: Mon, 2005-01-10 05:55

I found out what the problem is about that query.

It is the (stupid) collation setting I set it to UTF8_general_ci by default which cuases less problems in querys for some reason. When I try the query in a table having the collation set to latin1_swedish_ci (the phpMyAdmin default I think) then it works perfectly.

I tried setting the collation to latin1_swedish_ci and my problems disappeared!

So that is the solution and defenately something you need to take into account for the setup!! You can specify the collation in the create statements so you should be ok.