Trying to analyze and upgrade views_dow and getting the following error:

drush @drupal8.dev dmu-analyze views_dow --path=modules/views_dow
Indexing...done.
 [error]  exception 'InvalidArgumentException' with message '$string ("") must be a string.' in /var/www/drupal8.dev/drupal/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:140

This is an install of drupal-8.1.8

Here's the full Trace:

Stack trace:
#0 /var/www/drupal8.dev/drupal/core/lib/Drupal/Core/StringTranslation/StringTranslationTrait.php(71): Drupal\Core\StringTranslation\TranslatableMarkup->__construct(NULL, Array, Array, Object(Drupal\Core\StringTranslation\TranslationManager))
#1 /var/www/drupal8.dev/drupal/modules/drupalmoduleupgrader/src/Plugin/DMU/Analyzer/FlagHookDeriver.php(47): Drupal\drupalmoduleupgrader\DeriverBase->t(NULL, Array)
#2 /var/www/drupal8.dev/drupal/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(100): Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer\FlagHookDeriver->getDerivativeDefinitions(Array)
#3 /var/www/drupal8.dev/drupal/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(86): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array)
#4 /var/www/drupal8.dev/drupal/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(274): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions()
#5 /var/www/drupal8.dev/drupal/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(174): Drupal\Core\Plugin\DefaultPluginManager->findDefinitions()
#6 /var/www/drupal8.dev/drupal/modules/drupalmoduleupgrader/drupalmoduleupgrader.drush.inc(108): Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
#7 /var/www/drupal8.dev/drupal/modules/drupalmoduleupgrader/drupalmoduleupgrader.drush.inc(244): _dmu_plugin_list('analyzer')
#8 [internal function]: drush_drupalmoduleupgrader_dmu_analyze('views_dow')
#9 /usr/local/share/drush/includes/command.inc(366): call_user_func_array('drush_drupalmod...', Array)
#10 /usr/local/share/drush/includes/command.inc(217): _drush_invoke_hooks(Array, Array)
#11 [internal function]: drush_command('views_dow')
#12 /usr/local/share/drush/includes/command.inc(185): call_user_func_array('drush_command', Array)
#13 /usr/local/share/drush/lib/Drush/Boot/BaseBoot.php(73): drush_dispatch(Array)
#14 /usr/local/share/drush/includes/preflight.inc(88): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#15 /usr/local/share/drush/drush.php(12): drush_main()
#16 {main}

Comments

markie created an issue. See original summary.

jhoe08’s picture

Do you have any idea on how to solve this issues?

Thanks,
Newbie Jhoe...

ivavictoria’s picture

Same error just happened to me when using dmu_analyze. However, dmu_upgrade ran with no errors.

joelpittet’s picture

Version: 8.x-1.2 » 8.x-1.x-dev

With the latest dev it is showing this instead

Indexing...done.
Argument 2 passed to Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer\FlagHookDeriver::__construct() must be of the type array, null given, called in      [error]
/Users/joel/Sites/d8/html/modules/drupalmoduleupgrader/src/Plugin/DMU/Analyzer/FlagHookDeriver.php on line 28 and defined FlagHookDeriver.php:16
E_RECOVERABLE_ERROR encountered; aborting. To ignore recoverable errors, run again with --no-halt-on-error                                                [error]
Drush command terminated abnormally due to an unrecoverable error.
deepa_lissa’s picture

I got the same problem when I used the dmu-analyze. Have any idea on how to solve this issue?

dman’s picture

When using the normal drush dl drupalmoduleupgrader and composer update install instructions, I got results identical to those described in the OP.

When using composer require drupal/drupalmoduleupgrader:8.x-1.x-devinside a lightning-project install base drupal/core:8.2.0 (in the hopes that that would treat the composer dependencies better) but that actually sent me into composer dependency hell ( phpdocumentor/reflection-docblock and grom358/pharborist FWIW )

I did a fuller composer upgrade and tried again.
Half an hour later , I could download drupalmoduleupgrader again ( drupal/core (8.2.1), drupal/lightning (8.1.11) plus many others) .. and found that, despite appearing to be composer-friendly, drupalmoduleupgrader does not in fact use the drupal/core or drupal-project autoloaders after all.
After yet another in-project composer install (at least this time things were well cached)
I have indeed progressed to the error reported by @joelpittet in #4. Same goes for dmu-upgrade .
Attempting --no-halt-on-error did not go well either.

My sample mode was admin_actions - which I suspect needs a full rewrite anyway, so I'll go back to basics for this - I just thought it was worth a try to get dmu to convert some scaffolding for me.

cosmicdreams’s picture

Hi all:

I've been watching this issue and have something interesting to report.

I installed drupalmoduleupgrader using the installation steps described on it's module page for Drupal 8.2.4 and ran into the issue described here whenever I do a
drush dmu-analyze [MODULE_NAME]

But it doesn't fail the same way for
drush dmu-upgrade [MODULE_NAME]

It actually looks like it did it's job.

geek-merlin’s picture

Status: Active » Needs review
StatusFileSize
new2.04 KB

Patch flying in that fixes the issue for me.

dman’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm that patch #8 does make this error go away for me.

Applies to todays drupalmoduleupgrader 8.x-1.2
and running
Drupal 8.2.7-dev
Drush 8.1.8
And now produces the right result.

Visual code review ... looks sane enough.
(I can't comment on wider ways this problem could be avoided, but the patch certainly fixes the symptom in as tidy a way as could be expected)

sher1’s picture

I can also confirm the patch worked against Drupal 8.2.7(not dev), Drush 8.1.2

jcnventura’s picture

Version: 8.x-1.x-dev » 8.x-1.2
Status: Reviewed & tested by the community » Closed (duplicate)

This is a duplicate of #2635944: InvalidArgumentException' with message '$string (""), that is already committed to the -dev version, but not yet in drupalmoduleupgrader 8.x-1.2.