Can someone explain how to get Lightning updated? I am not sure I'm doing this right.

I've installed Lightning from BLT about four months ago. Tonight I did "composer update" but I get the following error output:

 - Applying patches for drupal/core
    https://www.drupal.org/files/issues/2752961-90.patch (Clear Twig caches on deploys)
    https://www.drupal.org/files/issues/1356276-408--8.4.x.patch (1356276 - Allow profiles to provide a base/parent profile and load them in the correct order)
   Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/1356276-408--8.4.x.patch
    https://www.drupal.org/files/issues/2880374-remove-experimental-warnings-6.patch (2880374 - Experimental modules should not have warnings after being installed)
    https://www.drupal.org/files/issues/2880445-remove-config-write-warning-2.patch (2880445 - Config sync should not throw a warning when not being writable)
   Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2880445-remove-config-write-warning-2.patch

Comments

kevinquillen created an issue. See original summary.

kevinquillen’s picture

Issue summary: View changes
balsama’s picture

Hi. It looks like the version of core you're getting is incompatible with the version of Lightning. This is usually a result of core updating, but not Lightning.

The latest version of Lightning is 3.0.1. It's possible (likely) that you're constrained to the 2.x branch. If you change your Lightning constraint to:

acquia/lightning:~3.0.1

...and run composer update, that will pull in core 8.4.4 with the correct patches. You might need to run update twice since the new version of Lightning will define new patches for some of its dependencies.

kevinquillen’s picture

When I try that, I get this:

Removing package drupal/core so that it can be re-installed and re-patched.
  - Removing drupal/core (8.4.4)
Deleting docroot/core - deleted
Loading composer repositories with package information
Updating dependencies (including require-dev)                                          
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - drupal/lightning_media 1.0.0-alpha2 requires drupal/dropzonejs 2.0.0-alpha3 -> satisfiable by drupal/dropzonejs[2.0.0-alpha3] but these conflict with your requirements or minimum-stability.
    - acquia/lightning 3.0.1 requires drupal/lightning_media 1.0.0-alpha2 -> satisfiable by drupal/lightning_media[1.0.0-alpha2].
    - Installation request for acquia/lightning ~3.0.1 -> satisfiable by acquia/lightning[3.0.1].


Installation failed, reverting ./composer.json to its original content.
balsama’s picture

It looks like you have a requirement on dropzonejs that's incompatible with lightning_media. If I had to guess, I'd say that you probably have a requirement on the 1.x branch of dropzonejs. The 2.x branch (which Lightning >= 2.2.4 requires) has some changes to support core media.

kevinquillen’s picture

Interesting, looks like at some point someone added dropzonejs after the fact. I removed it via Composer since it is listed in Lightning. Now I get this:

  Problem 1
    - Can only install one of: drupal/media_entity_image[1.x-dev, 1.2.0].
    - Can only install one of: drupal/media_entity_image[1.2.0, 1.x-dev].
    - Can only install one of: drupal/media_entity_image[1.x-dev, 1.2.0].
    - drupal/lightning_media 1.0.0-alpha2 requires drupal/media_entity_image 1.x-dev -> satisfiable by drupal/media_entity_image[1.x-dev].
    - acquia/lightning 3.0.1 requires drupal/lightning_media 1.0.0-alpha2 -> satisfiable by drupal/lightning_media[1.0.0-alpha2].
    - Installation request for acquia/lightning ~3.0.1 -> satisfiable by acquia/lightning[3.0.1].
    - Installation request for drupal/media_entity_image (locked at 1.2.0) -> satisfiable by drupal/media_entity_image[1.2.0].

But this is not listed as a dependency in my composer.json.

So what I tried then was:

composer update acquia/lightning --with-dependencies
composer require acquia/lightning:~3.0.1

Then I ran drush updb. No errors.

I should probably nuke this branch and start again clean just to ensure it worked fine.

kevinquillen’s picture

How do you clean up errors like this?

User warning: The following module is missing from the file system: lightning_scheduled_updates in drupal_get_filename() (line 250 of core/includes/bootstrap.inc).
drupal_get_filename('module', 'lightning_scheduled_updates') (Line: 273)
drupal_get_path('module', 'lightning_scheduled_updates') (Line: 134)
module_load_include('install', 'lightning_scheduled_updates') (Line: 93)
module_load_install('lightning_scheduled_updates') (Line: 82)
drupal_load_updates() (Line: 109)
Drupal\system\SystemManager->listRequirements() (Line: 49)
Drupal\system\Controller\SystemInfoController->status()
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 153)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 67)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 38)
Drupal\jsonapi\StackMiddleware\FormatSetter->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 657)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
balsama’s picture

Ugh. Those dependencies on the HEAD of media_entity_image and media_entity_document are a workaround to a dependency issue in those packages. You should be able to get it to work though. I think the commands you posted above are actually reversed. You would need::

composer require acquia/lightning:~3.0.1 --no-update
composer update

A couple other thoughts:

  1. If you're on 2.2.3, I assume you have already run the migration to core media from 2.2.1. Make sure that's the case before updating to the 3.x branch.
  2. I think you should be OK, because alpha2 of Lightning Workflow included the Scheduled Updates module. But you might want to update to the last version of the 2.x branch before switching to 3.x just in case (2.2.7 is the last release on the 2.x branch)
  3. Lightning often has manual update steps in addition to database updates. Make sure you take a look at our UPDATE.md file or read the release notes for each release.
kevinquillen’s picture

We started with 2.2.3, do we need to run any media migration?

balsama’s picture

> We started with 2.2.3, do we need to run any media migration?

Nope! You should be good. You _will_ need to trigger the migration to Content Moderation and Workflows. See the 2.2.4 update instructions for more information: https://github.com/acquia/lightning/releases/tag/2.2.4

And you'll actually need to do that before updating to 3.0.1 because 3.0.1 doesn't have the Scheduled Update module (which is disabled as part of the 2.2.4 update).

kevinquillen’s picture

What if we haven't used Workflow or Content Moderation yet?

balsama’s picture

You still need to run the updates to convert Lightning's configuration even if you haven't done anything with it. (Unless you have it completely excluded and uninstalled with a sub-profile).

kevinquillen’s picture

Alright, thanks.

edit:

So I should not just jump right to 3.0.1? I did that and had to manually remove lightning_scheduled_updates from config and the database since it went missing - it never got used.

balsama’s picture

I would recommend updating to 2.2.7 first... just so you can be sure that the migrations went ok. As an alternative, you could add a stub lightning_scheduled_updates module to your codebase and uninstall it, or do as you said. But that's not foolproof.

phenaproxima’s picture

Status: Active » Closed (outdated)

Lightning 2.x is no longer maintained, so I'm closing this issue.