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.
Comments
Comment #1
Anonymous (not verified) commentedConfirmed 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
Comment #2
chx commentedThis might be fixed. Please re-check.
Comment #3
jantoine commentedI can confirm that I was able to specify a password in the db_url using the latest from git.
Comment #4
chx commentedComment #5
jantoine commentedChx 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.
Comment #6
eliza411 commentedI'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.
Comment #7
chx commentedI wonder whether this helps.
Comment #8
eliza411 commentedYay, 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:
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 :)
Comment #9
chx commentedIf this helps then please commit it; but also the issue title is awfully misleading as the problem has nothing to do with passwords. Fixed.
Comment #10
benjy commentedIs there anyway we can add a test for this?
Comment #11
chx commentedPerhaps a unit test ... theoretically everything can be done with a unit test, right?
Comment #12
benjy commentedMoving to the core issue queue so we can get this in before the D6-D8 patch coming soon.
Comment #13
alexpottComment #14
alexpottGo testbot go. No credit for me please - I'm just uploading the patch to get a testbot run in
Comment #15
benjy commented14: 2181775_7.patch queued for re-testing.
Comment #16
andypostI'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
Comment #17
Anonymous (not verified) commentedThis patch is a reroll for PSR-4 support.
It works on my local install just as the old one did.
Comment #18
benjy commentedThis looks good and is causing a few issues around the place (as discussed on our weekly call) so lets get it in.
Comment #19
andypostApproach makes sense so each source plugin able to override the method
NW for doc block
this needs doc block
and empty line
Comment #20
benjy commentedDocs and newline added.
Comment #22
alexpottlol 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.
Comment #23
benjy commentedI moved the interdiff to here: https://www.drupal.org/node/2289555