attempt to upgrade from 7.x-3.x-dev to 7.x-3.3 breaks system

Created on 2 March 2024, 4 months ago
Updated 4 March 2024, 4 months ago

Hi. Sorry for adding to the issue queue, but reporting this to maybe help others who might run in the same issue

I previously had openlayers installed, 7.x-3.x-dev dated 2020-06-16 per the .info file. It was dependent on service container module, and my hosting provider upgraded php to v8.2, which surfaced all the issues with service container. I managed to get service container disabled, and then disabled all the openlayers modules (since they were dependent on service container) and my system was happy again (drupal core 7.99)

I read the comments about OL 3.2 no longer having a dependency on service container, so I tried upgrading to the latest version

(note, the main project page for OL says service container is a dependency. If this is no longer true, perhaps that comment should be corrected?)

The modules update page did not offer an option to upgrade OL (probably since it was disabled). So I replaced modules\openlayers with the latest version. The modules list now showed OL 3.3 and I tried enabling it. Doing that got a 500 error, and error_log shows

Uncaught Error: Class "Drupal\openlayers\DependencyInjection\ServiceProviderPluginManager" not found in sites/all/modules/openlayers/lib/OpenlayersServiceContainer.php:80

Note, my approach did not require an "install" of OL, so no dbUpdate got executed. Not sure if that is related

I tried disabling OL by setting status to 0 in system table for the openlayers row, but the error still happened

I did
DELETE FROM cache_bootstrap WHERE cid='system_list'
and that then brought my system back to life

I saw
https://www.drupal.org/project/openlayers/issues/3390983 πŸ› Uncaught Error: Class ServiceProviderPluginManager not found Active
reporting the same error, but it has not gotten a response

I saw
https://www.drupal.org/project/openlayers/issues/3317266 πŸ› Upgrade from 7.x-3.1 to 7.x-3.2 break site installation Fixed
Reporting a similar issue, and I see there is a patch that might help clean things up. Haven't tried that. Not sure if it works with 3.3
That issue also indicated that uninstalling and re-installing OL would require rebuilding all maps, which I was hoping to avoid, hence the approach I took with the update

I'll leave my system alone for the moment. Hoping there is an approach I can try to allow enabling OL

It looks like I have OL libraries 3, 3.11.2, and 5 installed. Not sure if upgrading the library would help

Thanks

πŸ› Bug report
Status

Active

Version

3.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States hanksterr7

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @hanksterr7
  • πŸ‡ΊπŸ‡ΈUnited States hanksterr7
  • πŸ‡ΊπŸ‡ΈUnited States hanksterr7
  • πŸ‡¬πŸ‡§United Kingdom ken-g

    Hello @hanksterr7,
    I am sorry that you are having problems in upgrading to Openlayers 7.x-3.3.

    The overall problem is that in 7.x-3.2 and 7.x-3.3 there are many new php classes that have been incorporated into the Openlayers module from the deprecated Service Container module. The Registry Autoload module should then autoload all of these new classes during the upgrade process or when the caches are cleared. However, for whatever reason, if the new classes don't get loaded, then all sorts of errors start appearing.

    The best way I have found to tidy up the system, and to remove any traces of the Service Container module, is to rebuild the Drupal registry (using the registry_rebuild module). Please try that and let me know if this works.

    Please note that PHP 8.2 did not exist two years ago when I was removing the dependency on the Service Container module, so if you come across any further issues with Openlayers 7.x-3.3 and PHP 8.2, then please raise a separate issue for me to look at.

  • πŸ‡ΊπŸ‡ΈUnited States hanksterr7

    Blah

    I ran registry_rebuild. First time it seemed to work ok, but got this error

    PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction: DELETE FROM {cache} WHERE (cid LIKE :db_condition_placeholder_0 ESCAPE '\\') ; Array ( [:db_condition_placeholder_0] => entity\_property\_info:% ) in cache_clear_all() (line 173 of /public_html/includes/cache.inc).

    Ran it a second time and got no errors

    Then tried enabling openlayers module but still get this

    PHP Fatal error: Uncaught Error: Class "Drupal\openlayers\DependencyInjection\ServiceProviderPluginManager" not found in /sites/all/modules/openlayers/lib/OpenlayersServiceContainer.php:80

  • πŸ‡ΊπŸ‡ΈUnited States hanksterr7

    So I know just enough drupal and php to be dangerous :)

    I see that
    class ServiceProviderPluginManager extends DefaultPluginManager
    is defined in
    openlayers\src\DependencyInjection\ServiceProviderPluginManager.php

    And
    sites/all/modules/openlayers/lib/OpenlayersServiceContainer.php
    says:
    use Drupal\openlayers\DependencyInjection\ServiceProviderPluginManager;
    $service_provider_manager = new ServiceProviderPluginManager();

    Why is the code not finding the ServiceProviderPluginManager class?

    Is there some code I can add around the call to get an instance of the ServiceProviderPluginManager class to test if it exists?

  • πŸ‡¬πŸ‡§United Kingdom ken-g

    Thanks. I have now corrected the OL project page to state that the separate Service Container module is no longer required for versions 7.x-3.2 onwards of this module.

  • πŸ‡ΊπŸ‡ΈUnited States hanksterr7

    ok, I finally got OL 3.3 installed. Wasn't pretty

    Did these steps:
    -- uninstalled OL module and all child modules, and deleted the openlayers folder from sites\all\modules
    -- disabled fast 404 (since might interfere with registry autoload) and IP Geoloc (since it had an openlayers2 view component) modules (but did not uninstall)
    -- deleted all references to openlayers in registry and registry_file tables
    -- ran registry rebuild several times
    -- installed OL 3.3 module and enabled it. Didn't crash system!
    -- renabled OL submodules, IP Geoloc and fast 404

    All good

  • πŸ‡¬πŸ‡§United Kingdom ken-g

    Hello @hanksterr7,

    I am pleased that you have now managed to successfully install OL 3.3 on your system. Whenever I have seen your original issue of the missing class(es), rebuilding the registry has always worked if clearing the the caches was insufficient. Therefore, I am not sure which one of your steps was the key to resolving your issue, but I am glad it has.

    On a related subject, I note that you said your hosting provider recently upgraded your system to PHP 8.2. I know that Drupal Core 7.99 will work with PHP 8.2, but I have not yet attempted to address this for this Openlayers module. Some initial testing over the past couple of days has shown loads of deprecation notices, so I have raised new issue #3425256 - Make Drupal 7 Openlayers compatible with PHP 8.2 πŸ› Make Drupal 7 Openlayers compatible with PHP 8.2 Needs review to address this.

    Also, following the release of OL 3.3, I had to make a further change to the Service Container code #3362402 - /lib fold not using PSR-0 correctly πŸ› /lib fold not using PSR-0 correctly. Fixed . This is already is OL 7.x-3.x-dev and will be released in OL 3.4 in a week or two once I have sorted the PHP 8.2 issues described above.

  • πŸ‡ΊπŸ‡ΈUnited States hanksterr7

    Ok, thanks. I'll keep an eye on the topics you mention and let you know if I find any php 8.2 problems not addressed by your upcoming fixes

  • πŸ‡ΊπŸ‡ΈUnited States hanksterr7

    Note, the link in the requirements error message takes me to https://github.com/openlayers/openlayers/releases/download//-dist.zip which is a broken link

Production build 0.69.0 2024