I've just upgraded from alpha-15 to current dev.

Adding a new index causes a crash:

Drupal\Core\Entity\EntityStorageException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'server_id' cannot be null: INSERT INTO {search_api_task} (type, server_id, index_id, data) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => trackItems [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => aaargh [:db_insert_placeholder_3] => a:2:{s:10:"datasource";s:11:"entity:node";s:4:"page";i:0;} ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 756 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

Comments

joachim created an issue. See original summary.

joachim’s picture

The new index is created successfully though -- once I go back to the main admin page I can see it and edit it.

igasi’s picture

I've the same bug, I upgrated from alpha-15 to alpha-16, the error appears when create a new index or edit it, and change datasources or bundles too. Any idea or clue to solve the problem?

The second problem is after create/edit an index, this appears, but the "Index now" options is disabled, and I couldn't see any node to be indexed, the progress bar show me 0/0 Indexed.

OlgaRabodzei’s picture

Hi!
I also faced this problem. As I suppose the module update has missed hook_update_N function. As a primary solution try to reinstall module, the one helped me.

borisson_’s picture

Category: Bug report » Support request
Priority: Critical » Normal
Status: Active » Fixed

During the alpha phase, we don't provide an upgrade path.

lucasgrecco’s picture

StatusFileSize
new925 bytes

For those who need this schema update, here it is!
Just run drush updb and be happy!

lnunesbr’s picture

Status: Fixed » Needs review

Status: Needs review » Needs work

The last submitted patch, 6: search_api_update_schema-20160816.patch, failed testing.

lnunesbr’s picture

Category: Support request » Bug report

don't look to be a support request but a real bug, if schema has changed in current versions, it should be expected to have schema updated for older versions as well through hook_update_n

lnunesbr’s picture

@lucasgrecco, please review guidelines to submit a patch at https://www.drupal.org/patch/submit

lucasgrecco’s picture

borisson_’s picture

Category: Bug report » Support request
Status: Needs work » Closed (works as designed)

don't look to be a support request but a real bug, if schema has changed in current versions, it should be expected to have schema updated for older versions as well through hook_update_n

It is explicitly mentioned that we don't support an upgrade path while still in alpha phase. Sorry that you feel this is a bug, but since it's well documented this is a support request.

lucasgrecco’s picture

Category: Support request » Bug report
Status: Closed (works as designed) » Needs work
borisson_’s picture

Category: Bug report » Support request

I'll leave this open for @drunken monkey to decide, but I'd prefer not to start putting in update hooks before the beta release, even if it's provided. We won't add update hooks for other api breaking things, during alpha, so that would create a really odd way of working.

In any case, this is not a bug report, because we stated that update hooks will not be provided.

I also think that we'd need to write tests for update hooks as well, similar to how core does it. Not sure about other's opinions about that though.

If this will get in, there's a couple of issues with the patch:

  1. index 0000000..94a25f7
    --- /dev/null
    
    --- /dev/null
    +++ b/.idea/vcs.xml
    

    Please make sure you don't commit .idea files.

    (This is something where a global gitignore will help you out: https://help.github.com/articles/ignoring-files/#create-a-global-gitignore)

  2. +++ b/search_api.install
    @@ -9,6 +9,22 @@ use Drupal\Component\Render\FormattableMarkup;
    +    search_api_update_8100();
    +  }
    

    Indentation here looks off.

  3. +++ b/search_api.install
    @@ -9,6 +9,22 @@ use Drupal\Component\Render\FormattableMarkup;
    +    $schema = Database::getConnection()->query("ALTER TABLE `search_api_task`
    +CHANGE COLUMN `server_id` `server_id` VARCHAR(50) NULL COMMENT 'The ID of the server for which this task should be executed' ;");
    +  }
    

    Indentation issues here as well.

drunken monkey’s picture

Status: Needs work » Fixed

Thanks, Joris, for handling this!
Please, everyone, read the release notes and just do such necessary changes manually when updating.

Status: Fixed » Closed (fixed)

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