Articles in this section

Menu "Extensions" in Plesk and/or extensions' menus fail to open: ERROR: Declaration of DI\CompiledContainer::get($name) must be compatible with DI\Container::get(string $id): mixed (CompiledContainer.php:41)

kb: bug Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

  • Cannot log in to Plesk:

    ERROR: Declaration of DI\Definition\Source\DefinitionFile::getDefinition(string $name) must be compatible with DI\Definition\Source\DefinitionArray::getDefinition(string $name): ?DI\Definition\Definition (DefinitionFile.php:36)

  • On a Plesk for Linux server, the menu Extensions fails to open:

    ERROR: Declaration of DI\CompiledContainer::get($name) must be compatible with DI\Container::get(string $id): mixed (CompiledContainer.php:41)


    PHP Fatal error: Declaration of DI\CompiledContainer::get($name) must be compatible with DI\Container::get(string $id): mixed in /usr/local/psa/admin/plib/modules/nodejs/vendor/php-di/php-di/src/CompiledContainer.php on line 41

  • The menus of various extensions, like Domains > example.com > Node.js fail to open with the same error.
  • Errors that are similar to the following are found in the log file /var/log/plesk/panel.log:

    CONFIG_TEXT: [2025-07-06 14:18:07.172] 17132:686a5b6f29c04 ERR [panel] ERROR: Declaration of DI\CompiledContainer::get($name) must be compatible with DI\Container::get(string $id): mixed (CompiledContainer.php:41)
    [2025-07-06 14:18:07.439] 17075:686a5b6f6b05e ERR [panel] DI\Proxy\ProxyFactory::__construct(): Argument #1 ($proxyDirectory) must be of type ?string, false given, called in /usr/local/psa/admin/plib/modules/advisor/vendor/php-di/php-di/src/ContainerBuilder.php on line 166:

  • URL contains the extension name when Plesk UI shows the error

Cause

Extension(s) mentioned in the error is not up-to-date.

The bug PPPM-14988 was created to improve the behaviour in future Plesk versions.

Resolution

  1. Connect to the server via SSH
  2. Reinstall all extensions:

    # plesk bin extension --list | awk '{print $1}' | xargs -n1 plesk bin extension --install

Was this article helpful?

Comments

4 comments
Date Votes
  • Had similar issue “ERROR: Declaration of DI\Definition\Source\DefinitionFile::getDefinition(string $name) must be compatible with DI\Definition\Source\DefinitionArray::getDefinition(string $name): ?DI\Definition\Definition (DefinitionFile.php:36)” but with all extensions not just one and no updates available for any of them, Alma 9 and latest Plesk version, only fixed by modifying this file:

    /usr/local/psa/admin/plib/modules/performance-booster/vendor/php-di/php-di/src/Definition/Source/DefinitionFile.php

     

    From:<     public function getDefinition(string $name)
    ---
    To:  >     public function getDefinition(string $name): ?\\DI\\Definition\\Definition

    Hope it helps someone.
     

    0
  • i tried the same but no luck, i am using ubuntu 22 with plesk latest version
    my error is 
    ERROR: Declaration of DI\Definition\Source\NoAutowiring::autowire(string $name, ?DI\Definition\ObjectDefinition $definition = null) must be compatible with DI\Definition\Source\Autowiring::autowire(string $name, ?DI\Definition\ObjectDefinition $definition = null): ?DI\Definition\ObjectDefinition (NoAutowiring.php:17)

    0
  • Hello Ionut Bochis,

    We do not recommend modifying Plesk files, as this could cause additional issues and is likely to be overwritten by Plesk updates.

    If the above solution does not work, please open a support ticket.

    0
  • Yes Vincent, totally agree, but as a temporary solution it worked fine to get Plesk working again, problem was with server not reaching out for the extension updates .. but no indication of such in the logs.

    0

Please sign in to leave a comment.