Incompatible with newest version of the php-ffmpeg (v0.19.0) package, Drupal 10 compatibility

Created on 1 January 2022, almost 3 years ago
Updated 5 January 2024, 12 months ago

Problem/Motivation

The following error appears after updating composer packages:

PHP Fatal error:  Uncaught TypeError: Argument 3 passed to FFMpeg\FFProbe::create() must be an instance of Psr\Cache\CacheItemPoolInterface or null, instance of Drupal\php_ffmpeg\PHPFFMpegCache given, called in /var/www/html/web/modules/contrib/php_ffmpeg/src/PHPFFMpegFactory.php on line 76 and defined in /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php:220
Stack trace:
#0 /var/www/html/web/modules/contrib/php_ffmpeg/src/PHPFFMpegFactory.php(76): FFMpeg\FFProbe::create(Array, Object(Drupal\Core\Logger\LoggerChannel), Object(Drupal\php_ffmpeg\PHPFFMpegCache))
#1 /var/www/html/web/modules/contrib/php_ffmpeg/src/PHPFFMpegFactory.php(63): Drupal\php_ffmpeg\PHPFFMpegFactory->getFFMpegProbe()
#2 [internal function]: Drupal\php_ffmpeg\PHPFFMpegFactory->getFFMpeg()
#3 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(255): call_user_func_array(Array, Array)
#4 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container-> in /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php on line 220

This seems to be related to a change in the php-ffmpeg/php-ffmpeg package introduced in https://github.com/PHP-FFMpeg/PHP-FFMpeg/commit/7eace8852ac40ff2c38d90d8... which is part of the latest release.

Steps to reproduce

Update composer packages with "composer update"

Proposed resolution

Either lock the version of the dependency to v0.18.0, or alter PHPFFMpegCache to implement Psr\Cache\CacheItemPoolInterface.

Remaining tasks

- choose a resolution
- implement it

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇩🇪Germany semiaddict

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇭🇷Croatia Aporie

    Thanks a lot Volman for the patch.

    With the last version of Drupal 10 I was getting errors from functions not being compatible with Symfony\Component\Cache\Adapter\AbstractAdapter interface.

    Attached is a patch to make them compatible. Some might need a few tweaks to respect their return types though, but haven't got time to get there yet.

  • 🇭🇷Croatia Aporie

    Ok, so as expected, patch #18 is useless because functions don't return their expected return type.

    I investigated, and I wonder if Drupal caches are compatible with function definitions in symfony.

    If I check in vendor/symfony/cache/Traits/AbstractAdapterTrait.php::doSave(), the function should return @return array|bool The identifiers that failed to be cached or a boolean stating if caching succeeded or not.

    Though Drupal backend cache throw errors on failure.

    I ended up returning TRUE for each function. At least it does work now.

  • 🇮🇳India bhanu951

    Anyone got any suggestion on how to fix this issue. Seems Neither the patch from #9 nor #19 can resolve this issue.

  • 🇮🇳India bhanu951

    #9 fixes the issue but only with "php-ffmpeg/php-ffmpeg" version "0.19.0"

  • 🇭🇷Croatia Aporie

    You should check the version of FFmpeg installed on your server. It's possible you have an incompatibility between the PHP library and your server version.

    ffmpeg -version

  • ivnish Kazakhstan

    Patch #19 looks good

  • First commit to issue fork.
  • 🇨🇭Switzerland berdir Switzerland

    Berdir changed the visibility of the branch 7.x-1.x to hidden.

  • Merge request !6Resolve #3256578 "Cache d10" → (Merged) created by berdir
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MariaDB 10.3.22
    last update 12 months ago
    Waiting for branch to pass
  • 🇨🇭Switzerland berdir Switzerland

    Totally forgot I was a maintainer here. Looking into this now and starting a new MR with the changes.

    To be able to test this, I merged in the D10 rector patch from 📌 Automated Drupal 10 compatibility fixes Needs review and also enabled Gitlab CI.

    I'm not sure why we allow 0.19 *and* 1.1 at this point, #21 mentions this only works with 0.19, will try to do some real tests now to see how this works.

  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MariaDB 10.3.22
    last update 12 months ago
    Waiting for branch to pass
    • Berdir committed 3c409c30 on 8.x-1.x
      Issue #3256578 by retiredpro, Aporie, volman, hatuhay, vadim s. sabinich...
  • Status changed to Fixed 12 months ago
  • 🇨🇭Switzerland berdir Switzerland

    Did some basic tests for our use case, that works with version 1.1. Keeping the version string as it is for now.

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

Production build 0.71.5 2024