Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"There is currently no session available" error when "drush cim" deletes a view #6184

Open
prudloff-insite opened this issue Dec 23, 2024 · 0 comments

Comments

@prudloff-insite
Copy link
Contributor

Describe the bug
When drush cim tries to delete a view, it fails with this error:

There is currently no session available

To Reproduce

  1. Call drush cex.
  2. Create a view.
  3. Call drush cim.

Expected behavior
No error.

Actual behavior

In ConfigImportCommands.php line 291:
                                                                                                                                   
  The import failed due to the following reasons:                                                                                  
  Erreur inattendue lors de l'importation avec l'opération delete pour views.view.test : There is currently no session available.  
                                                                                                                                   

In ConfigImportCommands.php line 278:
                                 
  Errors occurred during import  

Workaround
Relaunching drush cim again works (because the view was actually deleted, it just fails at the post delete step).

System Configuration

Q A
Drush version? 13.3.3.0
Drupal version? 11.0.9
PHP version 8.3.6
OS? Linux

Additional information
I think this happens because since https://www.drupal.org/project/drupal/issues/3413153 Drupal core assumes a request always has a session, but that's not true when using Drush.
View::postDelete() calls SharedTempStoreFactory::get() which tries to access the session and fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant