Problem/Motivation

Some drush commands prevented because of duplicated service key.

e. G.

drupal@drupal-virtualbox:/var/www/drupal$ drush sql:drop

 Do you really want to drop all tables in the database drupal? (yes/no) [yes]:
 > y

drupal@drupal-virtualbox:/var/www/drupal$ drush si --locale=de

 You are about to:
 * DROP all tables in your 'drupal' database.

 Do you want to continue? (yes/no) [yes]:
 > 

 [notice] Starting Drupal installation. This takes a while.
 [notice] Performed install task: install_select_language
 [notice] Performed install task: install_select_profile
 [notice] Performed install task: install_load_profile
 [notice] Performed install task: install_verify_requirements
 [notice] Performed install task: install_verify_database_ready
 [notice] Performed install task: install_base_system
 [notice] Performed install task: install_bootstrap_full
 [notice] Performed install task: install_profile_modules
 [notice] Performed install task: install_profile_themes
 [notice] Performed install task: install_install_profile
 [notice] Translations imported: 9842 added, 0 updated, 0 removed.
 [notice] Performed install task: install_import_translations
 [notice] Performed install task: install_configure_form
 [notice] Performed install task: varbase_multilingual_configuration_form
 [notice] Performed install task: varbase_configure_multilingual
 [notice] Performed install task: varbase_extra_components
 [warning] The "block_content:b858d97d-eaa5-4cfe-af6f-b92c21bbca95" was not found
 [notice] Performed install task: varbase_assemble_extra_components
 [notice] Performed install task: varbase_development_tools
 [notice] Performed install task: varbase_assemble_development_tools
 [notice] Performed install task: install_finish_translations
 [notice] Cron run completed.
 [notice] Performed install task: install_finished
 [success] Installation complete.  User name: admin  User password: Qs8qUUSfbx
drupal@drupal-virtualbox:/var/www/drupal$ drush upwd admin 12345

In YamlSymfony.php line 40:
                                                
  Duplicate key "services" detected at line 6.  
                                                

In Parser.php line 335:
                                                
  Duplicate key "services" detected at line 6.  
                                                

drupal@drupal-virtualbox:/var/www/drupal$ 

Steps to reproduce

Install varbase via composer
add drush

try to change password of any user by useing upwd

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

Joachim Namyslo created an issue. See original summary.

Joachim Namyslo’s picture

Title: Drush works just partly currently » Drush 10.x works just partly currently
Status: Active » Closed (cannot reproduce)

it's a drush 10 related one so I cloesd the Issue here.

Rajab Natshah’s picture

Thanks Joachim for reporting

Yes you are right
I faced that Yesterday .. even basic drush en .. or drush cr

  • Drush 8
  • Drush 9
  • Drush 10

Drush 10 is the one having issues
The robot had issues with that too
on
drush pm-enable ( did not work )
drush cr ( did not work)
But drush site-install ( worked )
and drush runserver --default-server=builtin 8080 &>/dev/null & ( did not work too )

Not all things work with Drush 10 and Varbase 9.0.x
Trying to switch to Drupal Console.. But same for Drupal Console too
https://travis-ci.com/github/Vardot/varbase/builds/190868455

 ## Install with drush.
  - cd docroot
  - drush site-install varbase --yes --site-name='Test Varbase9000xxc' --account-name=webmaster --account-pass=dD.123123ddd --account-mail=webmaster@vardot.com --db-url="mysql://root:@localhost/test_varbase9000xxc" varbase_multilingual_configuration.enable_multilingual=true varbase_extra_components.vmi=true varbase_extra_components.varbase_heroslider_media=true varbase_extra_components.varbase_carousels=true varbase_extra_components.varbase_search=true varbase_extra_components.varbase_blog=true varbase_extra_components.varbase_auth=true varbase_extra_components.social_auth_google=true varbase_extra_components.social_auth_facebook=true varbase_extra_components.social_auth_twitter=true varbase_extra_components.social_auth_linkedin=true varbase_extra_components.varbase_api=true varbase_development_tools.varbase_development=true varbase_development_tools.varbase_styleguide=true
  - drupal config:override system.performance --key='css.preprocess' --value='0' --yes
  - drupal config:override system.performance --key='js.preprocess' --value='0' --yes
  - drupal config:override system.logging --key='error_level' --value='all' --yes
before_script:
  - drush runserver --default-server=builtin 8080 &>/dev/null &
  - sleep 5

It's working well with Drush 9 and Varbase 8.8.x
https://travis-ci.com/github/Vardot/varbase/builds/190875563

  ## Install with drush.
  - cd docroot
  - drush site-install varbase --yes --site-name='Test Varbase808xxc' --account-name=webmaster --account-pass=dD.123123ddd --account-mail=webmaster@vardot.com --db-url="mysql://root:@localhost/test_varbase808xxc" varbase_multilingual_configuration.enable_multilingual=true varbase_extra_components.vmi=true varbase_extra_components.varbase_heroslider_media=true varbase_extra_components.varbase_carousels=true varbase_extra_components.varbase_search=true varbase_extra_components.varbase_blog=true varbase_extra_components.varbase_landing=true varbase_extra_components.varbase_auth=true
  - drush pm-enable varbase_development --yes
  - drush pm-enable varbase_styleguide --yes
  - drush pm-enable varbase_media_instagram --yes
  - drush pm-enable varbase_media_twitter --yes
  - drush pm-enable varbase_api --yes
  - drush pm-enable social_auth_google --yes
  - drush pm-enable social_auth_facebook --yes
  - drush pm-enable social_auth_twitter --yes
  - drush pm-enable social_auth_linkedin --yes
  - drush pm-enable varbase_content_planner --yes
  - drush config-set system.performance css.preprocess 0 --yes
  - drush config-set system.performance js.preprocess 0 --yes
  - drush config-set system.logging error_level all --yes
  - drush cr
before_script:
  - drush runserver --default-server=builtin 8080 &>/dev/null &

Rajab Natshah’s picture

Status: Closed (cannot reproduce) » Active

Having the issue back to Active
More reading and researching on the Drush 10 documentation. The status for working with production websites.
https://www.drush.org/commands/10.x/all/
https://drushcommands.com/drush-9x/ ( no doc for drush 10 yet )
Looking for better documentation and clear working examples

Needed for the automated functional testing

Joachim Namyslo’s picture

Ok tested a bit more and asked for some help here : https://github.com/drush-ops/drush/issues/4577

It seems that is not a drush problem at all.

If Drupal 9 core plus drush plus console is installed everything works fine. So the problem must be within a module used by varbase right now. No clue how to find out wich one it is. What I would do is install and uninstall modules one by one to find the module that causes the issue. But I bet automated testing can do this much faster than myself.

Maybe is one of theese modules:

 [debug] Found drush.services.yml for simple_sitemap Drush commands [0.37 sec, 14.98 MB]
 [debug] Found drush.services.yml for token Drush commands [0.37 sec, 14.98 MB]
 [debug] Found drush.services.yml for ultimate_cron Drush commands [0.37 sec, 14.98 MB]

Added RajabNatshah to the conversation in d9readyness-channel on slack.

Rajab Natshah’s picture

Thank you Joachim for following up on issues
Having a scan for all custom drush commands in all contributed components
We do have one in Varbase Core too
#3120775: Drush 10 compatibility with Drupal 9 compatibility for all custom drush commands

yasmeensalah’s picture

@rajabnatshah This issue is caused by "Varbase update helper/Update helper" module, i've disabled it and drush works fine.

Rajab Natshah’s picture

Thank you Yasmeen so much for the note
You have saved me a 1-day work
#3024165: [PATCH] Enhancements, Better messages for the unable to apply updates, drush command

David had a new patch

did not notice that
https://www.drupal.org/project/update_helper/issues/3024165#comment-1382...

#40 is duplicating the "services" key on the drush.services.yml file. Here is a patch fixing it.

I think this is it
I will switch the patch
and do a quick release for varbase_core module 9.0.0-alpha2

Rajab Natshah’s picture

Title: Drush 10.x works just partly currently » Fix Drush 10.x works just partly currently
Project: Varbase - The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) » Varbase Core

Moving the issue to Varbase Core module

Rajab Natshah’s picture

Rajab Natshah’s picture

Assigned: Unassigned » Mohammed J. Razem
Status: Active » Needs review
Issue tags: +varbase-9.0.0, +varbase-9.0.0-beta1
Rajab Natshah’s picture

Assigned: Mohammed J. Razem » Unassigned
Rajab Natshah’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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