Errors related to missing MetatagServiceProvider.php after upgrading to 2.0

Created on 24 July 2023, over 1 year ago
Updated 25 July 2023, over 1 year ago

Problem/Motivation

After upgrading to 2.0 from 8.x-1.26 I am getting a pair of errors in the Drupal logs related to a missing MetatagServiceProvider.php file.

This error appears in the log every time the cache is manually cleared.

Warning: include(): Failed opening '/home/XXX/XXX/web/modules/contrib/metatag/src/MetatagServiceProvider.php' for inclusion

The module appears to be working as expected, but it would be nice to avoid these errors.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @jabeler
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Please rebuild your caches, that should make the problem go away, please let me know if it doesn't.

  • I've tried that a few times (also tried using drush cr). The action of clearing the caches is actually what triggers this in the logs.

    If I don't clear the caches there are no new errors like this in the logs.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Can you please check your site's codebase to see if anything else might reference MetatagServiceProvider? Thank you.

  • I've done a search and haven't found anything. Also searched the database, and no luck there either (except for references in Watchdog).

    The only other related plugin installed on this site is schema_metatag 3.0.1. I'm not aware of anything else that would be calling MetatagServiceProvider.php

    These are the full error messages I'm seeing.

    Warning: include(): Failed opening '/home/XXX/d10/web/modules/contrib/metatag/src/MetatagServiceProvider.php' for inclusion (include_path='/home/XXX/d10/vendor/pear/archive_tar:/home/XXX/d10/vendor/pear/console_getopt:/home/XXX/d10/vendor/pear/pear-core-minimal/src:/home/XXX/d10/vendor/pear/pear_exception:.:/opt/cpanel/ea-php81/root/usr/share/pear') in include() (line 571 of /home/XXX/d10/vendor/composer/ClassLoader.php)
    

    Warning: include(/home/XXX/d10/web/modules/contrib/metatag/src/MetatagServiceProvider.php): Failed to open stream: No such file or directory in include() (line 571 of /home/XXX/d10/vendor/composer/ClassLoader.php)

    Was installing 2.0 (via composer) directly on top of 8.x-1.26 the proper way to update, or should have I followed a special process?

    Thanks for the help!

  • Ok, as a last resort I did a quick restart of the server and can no longer reproduce these errors.

    Strange, but fixed I guess.

  • Status changed to Closed: cannot reproduce over 1 year ago
  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Thanks for letting me know. I suspect something was stuck in the opcache and it wasn't reloading the class list. I've updated the 2.0.0 release notes to mention this.

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

Production build 0.71.5 2024