following the directions at https://groups.drupal.org/node/398588 i ran the following command:

drush migrate-manifest mysql://drupal6:drupal6@localhost/drupal6 manifest-simple.yml

however, that failed until i modified the mysql user to not require a password to connect. until i did that i got the following error:

SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user 'drupal6'@'localhost' for table 'migrate_map_d6_node'

the variable $db_spec in

drush_migrate_manifest()

gets set correctly but the password is lost somewhere before the import actually runs.

Update by chx: it seems to me that the problem is mixing up connections and not passwords. When testing this please make sure the Drupal 8 user does not have access to the Drupal 6 database.

CommentFileSizeAuthor
#20 interdiff.txt870 bytesbenjy
#20 2181775-20.patch2.52 KBbenjy
#17 2181775_17.patch2.22 KBAnonymous (not verified)
#14 2181775_7.patch2.33 KBalexpott
#7 2181775_7.patch2.33 KBchx

Comments

Anonymous’s picture

Confirmed same problem on my laptop.

rcw@mojito:/var/www/imp$ drush migrate-manifest 'mysql://user:pass@localhost/db' manifest.yml
Migration failed with source plugin exception: SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user [error]
'user'@'localhost' for table 'migrate_map_d6_node': SELECT n.nid AS nid, n.vid AS vid, n.type AS type, n.language AS language, n.title AS
title, n.uid AS uid, n.status AS status, n.created AS created, n.changed AS changed, n.comment AS comment, n.promote AS promote, n.moderate AS
moderate, n.sticky AS sticky, n.tnid AS tnid, n.translate AS translate, nr.body AS body, nr.teaser AS teaser, nr.format AS format,
map.sourceid1 AS migrate_map_sourceid1, map.destid1 AS migrate_map_destid1, map.source_row_status AS migrate_map_source_row_status
FROM
{node} n
INNER JOIN {node_revisions} nr ON n.vid = nr.vid
LEFT OUTER JOIN imp.migrate_map_d6_node map ON n.nid = map.sourceid1
WHERE ( (map.sourceid1 IS NULL ) OR (map.source_row_status = :db_condition_placeholder_0) ); Array
(
[:db_condition_placeholder_0] => 1
)

PHP Fatal error: Uncaught exception 'Drupal\Core\Config\StorageException' with message 'Failed to write configuration file: sites/default/files/config_dcn5S7OemJKrfDwFqOI9UWGSKS8jsytNb_tUOOmqd5E/active/block.block.bartik_breadcrumbs.yml' in /var/www/imp/core/lib/Drupal/Core/Config/FileStorage.php:115
Stack trace:
#0 /var/www/imp/core/lib/Drupal/Core/Config/CachedStorage.php(120): Drupal\Core\Config\FileStorage->write('block.block.bar...', Array)
#1 /var/www/imp/core/lib/Drupal/Core/Config/Config.php(497): Drupal\Core\Config\CachedStorage->write('block.block.bar...', Array)
#2 /var/www/imp/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php(383): Drupal\Core\Config\Config->save()
#3 /var/www/imp/core/lib/Drupal/Core/Entity/Entity.php(298): Drupal\Core\Config\Entity\ConfigStorageController->save(Object(Drupal\block\Entity\Block))
#4 /var/www/imp/core/modules/block/block.module(297): Drupal\Core\Entity\Entity->save()
#5 /var/www/imp/core/modules/block/block.module(434): _block_rehash('bartik')
#6 [internal function]: in /var/www/imp/core/lib/Drupal/Core/Config/FileStorage.php on line 115
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Uncaught exception 'Drupal\Core\Config\StorageException' with message 'Failed to write configuration file:
sites/default/files/config_dcn5S7OemJKrfDwFqOI9UWGSKS8jsytNb_tUOOmqd5E/active/block.block.bartik_breadcrumbs.yml' in
/var/www/imp/core/lib/Drupal/Core/Config/FileStorage.php:115
Stack trace:
#0 /var/www/imp/core/lib/Drupal/Core/Config/CachedStorage.php(120): Drupal\Core\Config\FileStorage->write('block.block.bar...', Array)
#1 /var/www/imp/core/lib/Drupal/Core/Config/Config.php(497): Drupal\Core\Config\CachedStorage->write('block.block.bar...', Array)
#2 /var/www/imp/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php(383): Drupal\Core\Config\Config->save()
#3 /var/www/imp/core/lib/Drupal/Core/Entity/Entity.php(298):
Drupal\Core\Config\Entity\ConfigStorageController->save(Object(Drupal\block\Entity\Block))
#4 /var/www/imp/core/modules/block/block.module(297): Drupal\Core\Entity\Entity->save()
#5 /var/www/imp/core/modules/block/block.module(434): _block_rehash('bartik')
#6 [internal function]: in /var/www/imp/core/lib/Drupal/Core/Config/FileStorage.php, line 115

chx’s picture

This might be fixed. Please re-check.

jantoine’s picture

Status: Active » Reviewed & tested by the community

I can confirm that I was able to specify a password in the db_url using the latest from git.

chx’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Active
jantoine’s picture

Chx is on the right path. Using two separate users (one for the d6 database and one for the d8 database), with no passwords, fails.

*Edit
To clarify, both mysql users did not have a password set and could be used to access the database without a password.

eliza411’s picture

I'm still getting an error when I try to connect as a user with the recommended privileges on a regular Drupal install.

If the migration manifest is indeed a temporary thing, as mikeryan has indicated to me, then this may not need to be addressed. We should close this as "won't fix" and document the requirement that the user must connect without a password.

If it's going to stick around a while as the expedient way to run a partial migration, it seems more important to fix this - testing with the expected permissions for in-the-wild use cases usually turns out to be prudent.

chx’s picture

StatusFileSize
new2.33 KB

I wonder whether this helps.

eliza411’s picture

Status: Active » Reviewed & tested by the community

Yay, this allowed me to connect successfully with a password.

If I try to connect with an invalid username, password, or database name, the error message is:

Migration d6_aggregator_feed did not meet the requirements                         [error]
Migration d6_aggregator_item did not meet the requirements                         [error]

It would probably help reduce troubleshooting confusion is there were a more clear error message, but it seems to me like it's worth getting this much committed :)

chx’s picture

Title: drush migrate-manifest argument db_url does not allow specifying passwords » SQL idmap broke when using separate mysql users for source and destination

If this helps then please commit it; but also the issue title is awfully misleading as the problem has nothing to do with passwords. Fixed.

benjy’s picture

Is there anyway we can add a test for this?

chx’s picture

Perhaps a unit test ... theoretically everything can be done with a unit test, right?

benjy’s picture

Project: IMP » Drupal core
Version: » 8.x-dev
Component: Code » migration system

Moving to the core issue queue so we can get this in before the D6-D8 patch coming soon.

alexpott’s picture

Status: Reviewed & tested by the community » Needs review
alexpott’s picture

StatusFileSize
new2.33 KB

Go testbot go. No credit for me please - I'm just uploading the patch to get a testbot run in

benjy’s picture

14: 2181775_7.patch queued for re-testing.

andypost’s picture

Issue tags: +Needs tests

I'm used different approach in duplicate issue #2271919-1: Conditional map table join

#14 looks good but no way to manually disallow mapjoin in source constructor, so protected property should allow override introduced logic

Anonymous’s picture

StatusFileSize
new2.22 KB

This patch is a reroll for PSR-4 support.

It works on my local install just as the old one did.

benjy’s picture

Status: Needs review » Reviewed & tested by the community

This looks good and is causing a few issues around the place (as discussed on our weekly call) so lets get it in.

andypost’s picture

Status: Reviewed & tested by the community » Needs work

Approach makes sense so each source plugin able to override the method

NW for doc block

  1. +++ b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php
    @@ -192,4 +193,21 @@ public function getIterator() {
    +  protected function mapJoinable() {
    

    this needs doc block

  2. +++ b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php
    @@ -192,4 +193,21 @@ public function getIterator() {
    +  }
     }
    

    and empty line

benjy’s picture

Status: Needs work » Needs review
StatusFileSize
new2.52 KB
new870 bytes

Docs and newline added.

Status: Needs review » Needs work

The last submitted patch, 20: 2181775-20.patch, failed testing.

alexpott’s picture

Status: Needs work » Fixed

lol I committed this. sorry

Committed 1dbabca and pushed to 8.x. Thanks!

Lets open a followup issue to fix @andypost's comments and add tests.

benjy’s picture

I moved the interdiff to here: https://www.drupal.org/node/2289555

Status: Fixed » Closed (fixed)

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