This is what I get after installing the 7.x-1.0-beta1 version on Drupal 7.0-rc1

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'devdb.apachesolr_server' doesn't exist: SELECT * FROM {apachesolr_server} WHERE server_id = :server_id; Array ( [:server_id] => solr ) in apachesolr_server_id_load() (line 1612 of /srv/www/dev.vladgh.com/sites/all/modules/apachesolr/apachesolr.module).

Comments

VladGh’s picture

I forgot to mention that the above error appears when trying to access the configuration page (admin/config/search/apachesolr).

pwolanin’s picture

Did you previously install the module? If so, did you run update.php?

VladGh’s picture

The install was a little messy because it didn't allow installing both the framework and search at once, but I uninstalled it and reinstalled it again, all steps with running update.php. I will try it again with a fresh install of drupal maybe it will work. I will come back with results...

VladGh’s picture

Steps:

Existing Drupal 7.0-rc1 site, with all non-core modules disabled and without a previous install of Apache Solr.

drush @dev dl apachesolr-7.x-1.0-beta1
cd /srv/www/dev.vladgh.com/sites/all/modules/apachesolr/
svn checkout -r22 http://solr-php-client.googlecode.com/svn/trunk/ SolrPhpClient
chown -R www-data:www-data /srv/www/dev.vladgh.com

Install Apache Solr Framework

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes: CREATE TABLE {apachesolr_server} ( `asid` INT NOT NULL auto_increment COMMENT 'Integer primary key.', `server_id` VARCHAR(64) NOT NULL COMMENT 'Unique identifier for the server', `name` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Human-readable name for the server', `scheme` VARCHAR(10) NOT NULL DEFAULT 'http' COMMENT 'Preferred scheme for the registered server', `host` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Host name for the registered server', `port` VARCHAR(10) NOT NULL DEFAULT '' COMMENT 'Port number for the registered server', `path` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Path to the registered server', `service_class` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Optional class name to use for connection', PRIMARY KEY (`asid`), UNIQUE KEY `server_id` (`server_id`), UNIQUE KEY `host_post_path` (`host`, `port`, `path`) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'The Solr server table.'; Array ( ) in db_create_table() (line 2554 of /srv/www/dev.vladgh.com/includes/database/database.inc).

It remains checked, like it is installed.

Install Apache Solr search submodule -- OK, no errors

Go to Config Page (admin/config/search/apachesolr)
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'testvgh.apachesolr_server' doesn't exist: SELECT * FROM {apachesolr_server} WHERE server_id = :server_id; Array ( [:server_id] => solr ) in apachesolr_server_id_load() (line 1612 of /srv/www/dev.vladgh.com/sites/all/modules/apachesolr/apachesolr.module).
VladGh’s picture

The same errors appear with complete fresh install of drupal 7.0-rc1 (standard and minimal profiles)

pwolanin’s picture

Let me try to reproduce this.

pwolanin’s picture

A fresh install on a clean Drupal 7 standard profile install is fine for me.

However, I see the real error that matters is:

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes: 

Not sure why you are seeing this error but I am not. What SQL server or what version are you using?

VladGh’s picture

I have an Ubuntu 10.10 default install with mysql 5.1.49. But I think that the real problem is at the bottom of that error:

ENGINE = InnoDB DEFAULT CHARACTER SET utf8

I have InnoDB disabled in my.cnf. I will try with it enabled to see what happens, and I will come back...

pwolanin’s picture

I am also using innodb - that's the default for Drupal 7, but with MySQL 5.0. However, I don't see any error on MySQL 5.1 either.

pwolanin’s picture

The 1000 byte key length restriction is in MyISAM, NOT InnoDB. http://dev.mysql.com/doc/refman/5.1/en/myisam-storage-engine.html

Perhaps your server is missing the InnoDB engine? I can reproduce the error if I force the engine to MyISAM.

Still, we want this to work on MyISAM too.

VladGh’s picture

I went back and enabled InnoDB in my.cnf and I was able to install the framework and search without any errors. So it works only with innodb which is not quite fair because on small machines the first thing people do is to add skip-innodb to my.cnf.
Anyway it works until one point: when I try to add a new server or edit the existing one I get the follwing error:

Warning: Parameter 1 to apachesolr_server_edit_form() expected to be a reference, value given in drupal_retrieve_form() (line 766 of /srv/www/dev.vladgh.com/includes/form.inc).

The only way I could add my own server (custom port and path) was to edit the mysql table directly and it works. Maybe I should open another issue with this. It looks like a php 5.3... error

VladGh’s picture

Still, we want this to work on MyISAM too.

That would be great...

pwolanin’s picture

Title: Errors installing 7.x-1.0-beta1 » Key length greater tha 1000 bytes causes install error on MyISAM

Discussing with Crell, we don't really need this unique constraint anyhow.

pwolanin’s picture

Title: Key length greater tha 1000 bytes causes install error on MyISAM » Key length greater than 1000 bytes causes install error on MyISAM
StatusFileSize
new7.74 KB

mostly untested patch to fix up the schema and API funcs.

pwolanin’s picture

StatusFileSize
new8.07 KB

oops, missed a couple changes.

Crell’s picture

If we're switching to just a machine name for servers (which is good), why not use the new machine_name form element type in D7 for consistency?

pwolanin’s picture

Status: Active » Needs review
StatusFileSize
new8.97 KB

fixed a couple stale function calls.

@Crell- that form element was already being used - this patch shows it, since the exists function changes.

pwolanin’s picture

StatusFileSize
new10.37 KB

some more admin fixes.

pwolanin’s picture

StatusFileSize
new10.38 KB

re-roll

pwolanin’s picture

StatusFileSize
new12.7 KB

improved (?) update functions.

pwolanin’s picture

Status: Needs review » Fixed

committed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

chx’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Priority: Normal » Critical
Status: Closed (fixed) » Needs review
StatusFileSize
new806 bytes
chx’s picture

StatusFileSize
new398 bytes

Better idea (from feeds): just decrease the index size.

pwolanin’s picture

chx points out that {field_config_instance} has: entity_type | varchar(32)

pwolanin’s picture

StatusFileSize
new3.62 KB

Here's a more complete fix.

pwolanin’s picture

StatusFileSize
new7.12 KB

more complete removal of t() calls

pwolanin’s picture

StatusFileSize
new7.19 KB

also fix apachesolr_update_7012()

chx’s picture

Status: Needs review » Reviewed & tested by the community

Go 4 it.

pwolanin’s picture

Version: 7.x-1.x-dev » 6.x-3.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

committed to 7.x

gnucifer’s picture

I had this probem on the "apachesolr_index_bundles" in 6.x-3.x (using myISAM). Reducing the bundle key size to 32 solves this for me. Would be great if the appropriate patch could be backported and commited also to the 6.x-3.x-brach.

Or should I submit a new patch?

nick_vh’s picture

Status: Patch (to be ported) » Fixed
StatusFileSize
new2.98 KB

Commited to 6.x-3.x

nick_vh’s picture

Status: Fixed » Closed (fixed)