After upgrading from 1.0-alpha1 to 1.0-beta1 I started getting the error

Cannot initialize entity translation path variables (invalid path scheme). in entity_translation/includes/translation.handler.inc line 1401

A drush cc all was enough to resolve the problem, but at the very least there needs to be an update hook to clear the cache.

Comments

webdrips’s picture

Same problem here, but I had to clear the cache using the UI since I was receiving errors using drush cc.

I am also not able to update the dB using either drush updb or the UI:
The following updates returned messages

entity_translation module

Update #7002
Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null: INSERT INTO {role_permission} (rid, permission, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 2 [:db_insert_placeholder_1] => edit node original values [:db_insert_placeholder_2] => ) in user_role_grant_permissions() (line 3054 of /modules/user/user.module).

EDIT: the dev version fixed the above dB update issue.

bforchhammer’s picture

Status: Active » Needs review
StatusFileSize
new511 bytes

This should fix the OP's issue.

Status: Needs review » Needs work

The last submitted patch, cache-clear-update-1833496-3.patch, failed testing.

bforchhammer’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Status: Needs work » Needs review

Hm, patches need to go against -dev.

bforchhammer’s picture

#2: cache-clear-update-1833496-3.patch queued for re-testing.

plach’s picture

I tested this multiple times and I was not able to reproduce it. I think it's probably caused by an interrupted update process since we have a gobal cache clear at the end of a regular update process:

http://drupalcode.org/project/drupal.git/blob/refs/heads/7.x:/includes/u...

For this reason I think the patch in #2 is useless and I'd like to mark this as a duplicate of #1829980: Upgrade to Beta1 results in "Integrity constraint violation: 1048 Column 'module' cannot be null".

I repeatedly tested the upgrade path between alpha2 and the latest dev without having any issue. Please confirm this is the case also for you ASAP, as I wish to release beta2 very soon.

ianthomas_uk’s picture

I'm not going to be able to attempt to reproduce this this week, so please don't hold beta2 waiting for me.

webdrips / bforchhammer - will you have time to test this?

plach’s picture

StatusFileSize
new807 bytes

After further testing I was able to see this by performing the update via drush. Overall I still think this is not ET's business but I guess the attached patch will save us some headache. I moved the fix to update 7004 since people at 7004 right now don't need it. And I don't want to force people on beta1 to perform a db update when moving to beta2.

plach’s picture

Status: Needs review » Reviewed & tested by the community

Benedikt?

bforchhammer’s picture

Status: Reviewed & tested by the community » Fixed

Yes, fine by me. Committed and pushed. :)

Status: Fixed » Closed (fixed)

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

familymangreg’s picture

Hi all,

I appreciate this thread is a bit old, but I'm stuck on 7.x-1.0-alpha2 and keep getting the following error when trying to upgrade:

WD php: Exception: Cannot initialize entity translation path variables (invalid path scheme). in EntityTranslationDefaultHandler->initPathVariables() (line 1411 of   [error] /var/www/...../sites/all/modules/contrib/entity_translation/includes/translation.handler.inc).

I've google and searched the forums but still can't work out how to move forwards with this.

I'm testing on a development site, but need to be quite confident that the upgrade is going to work before I upgrade a large live site which has a lot of entity translations in pace.

Currently on Drupal 7.17.

Any pointers would be much appreciated.

Many thanks,
:wq

ianthomas_uk’s picture

Are you trying to upgrade to beta2? You can't upgrade from alpah2 to beta1 - you have to go directly to beta2.
Have you run update.php?

plach’s picture

Try clearing all caches and running the upgrade again.

familymangreg’s picture

Hi,

Thanks #ianmthomasuk and #plach for help so far.

My existing version is 7.x-1.0-alpha2 and I'm trying to upgrade to 7.x-1.0-beta2. I've tried clearing caches, and running database updates first, but no luck.

See the following:

Editing to add that a couple of the lines below seem to look fine in the message source but are a bit out of order in the code preview. Hope it makes sense!:.

gregf$ drush cc all
'all' cache was cleared in /var/www/uk.co.dgfsolutions.office.sil#default                                                                                             [success]

gregf$ drush updatedb
No database updates required                                                                                                                                          [success]
Finished performing updates.                                                                                                                                          [ok]

gregf$ drush rl entity_translation
------- RELEASES FOR 'ENTITY_TRANSLATION' PROJECT -------
 Release         Date         Status                 
 7.x-1.x-dev     2013-Feb-08  Development            
 7.x-1.0-beta2   2012-Nov-21  Supported, Recommended 
 7.x-1.0-beta1   2012-Nov-02                         
 7.x-1.0-alpha2  2012-Jun-16  Installed              

gregf$ drush up entity_translation
........
........

Code updates will be made to the following projects: Entity Translation [entity_translation-7.x-1.0-beta2]

Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.
Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.
Do you really want to continue with the update process? (y/n): y
Project entity_translation was updated successfully. Installed version is now 7.x-1.0-beta2.
Backups were saved into the directory /home/gregf/drush-backups/sil/20130222115904/modules/entity_translation.                                                        [ok]
WD php: Exception: Cannot initialize entity translation path variables (invalid path scheme). in EntityTranslationDefaultHandler->initPathVariables() (line 1411 of   [error]
/var/www/uk.co.dgfsolutions.office.sil/sites/all/modules/contrib/entity_translation/includes/translation.handler.inc).
Drush command terminated abnormally due to an unrecoverable error.                                                                                                    [error]
Exception: Cannot initialize entity translation path variables (invalid path scheme). in EntityTranslationDefaultHandler->initPathVariables() (line 1411 of /var/www/uk.co.dgfsolutions.office.sil/sites/all/modules/contrib/entity_translation/includes/translation.handler.inc).
Backups were restored successfully.                                                                                                                                   [ok]

gregf$ 

Many thanks,
:wq

plach’s picture

Try to perform the update from the GUI, drush was to reported to have some trouble.

familymangreg’s picture

Hi,

Thanks plach, I downloaded beta2 and then ran update.php as the administrator via the GUI. I got the following exception thrown:

Error message

Exception: Cannot initialize entity translation path variables (invalid path scheme). in EntityTranslationDefaultHandler->initPathVariables() (line 1411 of /var/www/uk.co.dgfsolutions.office.sil/sites/all/modules/contrib/entity_translation/includes/translation.handler.inc).
The website encountered an unexpected error. Please try again later.

Now, when I try and access the site I just get the following error:

The website encountered an unexpected error. Please try again later.

Clearing the cash I now get:

gregf$ drush cc
WD php: Exception: Cannot initialize entity translation path variables (invalid path scheme). in EntityTranslationDefaultHandler->initPathVariables() (line 1411 of   [error]
/var/www/uk.co.dgfsolutions.office.sil/sites/all/modules/contrib/entity_translation/includes/translation.handler.inc).
Drush command terminated abnormally due to an unrecoverable error.                                                                                                    [error]
Exception: Cannot initialize entity translation path variables (invalid path scheme). in EntityTranslationDefaultHandler->initPathVariables() (line 1411 of /var/www/uk.co.dgfsolutions.office.sil/sites/all/modules/contrib/entity_translation/includes/translation.handler.inc).

So unfortunately I now can't get onto the site at all. Any suggestions on how I can proceed without referring to a backup?

Many thanks,
:wq

plach’s picture

Comment line 1411 in translation.handler.inc and perform a drush cc. Then you should get only some notices. Try to ensure all the db updates have run, if so try the latest dev, otherwise try to complete the upgrade and then restore the commented line.

Hope this helps.

familymangreg’s picture

Hi,

Apologies I haven't been able to look at this again between Friday and now.

Thanks plach, commenting out line 1411 did the trick for me. For anyone else who has this same issue, here's what I did:

1. Manually downloaded latest version of entity_translation.
2. Edited entity_translation/includes/translation.handler.inc, commenting out line 1411. The function then looked like this:

  /**
   * Initializes handler path variables based on the active path scheme.
   *
   * @throws Exception
   */
  private function initPathVariables() {
    if (empty($this->pathScheme) || !isset($this->entityInfo['translation']['entity_translation']['path schemes'][$this->pathScheme])) {
      // throw new Exception("Cannot initialize entity translation path variables (invalid path scheme).");
    }
.......

3. Used drush to run db update manually, i.e. drush updatedb, which gave the following output:

The following updates are pending:

entity_translation module : 
  7002 -   Grant 'edit original values' and 'edit shared field' permissions to roles which have entity editing permissions. 
  7003 -   Configure node and comment language settings to the prior default behavior. 
  7004 -   Rebuild entity information to update the path scheme settings. 

Do you wish to run all pending updates? (y/n): y
Performed update: entity_translation_update_7002                                                                                                                      [ok]
Performed update: entity_translation_update_7003                                                                                                                      [ok]
Performed update: entity_translation_update_7004                                                                                                                      [ok]
Finished performing updates.                                                                                                                                          [ok]

4. Cleared the cache.
5. Edited entity_translation/includes/translation.handler.inc again to uncomment line 1411.

All was good.

:wq

  • Commit 94890fd on 7.x-1.x, et-permissions-1829630, factory, et-fc, revisions by bforchhammer:
    Issue #1833496 by bforchhammer, plach: Fixed Upgrade to Beta1 results in...

  • Commit 94890fd on 7.x-1.x, et-permissions-1829630, factory, et-fc, revisions, workbench by bforchhammer:
    Issue #1833496 by bforchhammer, plach: Fixed Upgrade to Beta1 results in...