FYI: symfony/filesystem version 6.4.7 breaks some console commands

mikko.ropanen
mikko.ropanen Spryker Solution Partner Posts: 29 ✨ - Novice

For example propel:install fails with

ErrorException - Exception: fileperms(): stat failed for /data/src/Orm/Propel/Schema//spy_acl.schema.xml

This is because of https://github.com/symfony/symfony/pull/54471 using the STFU operator @ to silence fileperms() in vendor/symfony/filesystem/Filesystem.php:689 and from what I understand, Spryker's error handler doesn't like that(?)

Tagged:

Comments

  • ynnoig
    ynnoig Technical Lead eBusiness Spryker Customer Posts: 13 ✨ - Novice

    Yes, for us too.. We had to constraint temporarly to 6.4.6

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,075 ⚖️ - Guardians (admin)

    Heyhey,
    does this happen with the ootb demoshop or after updating packages individually?

    Can you provide me more information about how to reproduce it?

    + it always helps to also create an official support case so I can better push the prio :)

    All the best,

    Florian

  • nicolas.messias773
    nicolas.messias773 Spryker Customer Posts: 1 🧑🏻‍🚀 - Cadet
    edited May 23

    Same for us.

    To fix it we've added the E_WARNING to the error level log only list.

    # default_config.php
    
    $config[ErrorHandlerConstants::ERROR_LEVEL_LOG_ONLY] = E_DEPRECATED | E_USER_DEPRECATED | E_WARNING;
    

    The downside is that these warnings are now being logged in the deployment pipelines and jenkins logs.

  • mikko.ropanen
    mikko.ropanen Spryker Solution Partner Posts: 29 ✨ - Novice

    Based on PR https://github.com/symfony/symfony/pull/54878 for Symfony 5.4 there's a pretty good chance they'll also fix/change that for 6.4.

    Offtopic but related: I have very little understanding of how different error levels work, but apparently I had at some point added a custom config (default_config.php):
    // This is a custom solution to keep deprecation messages from filling the logs
    // -Mikko
    $config[ErrorHandlerConstants::ERROR_LEVEL_DO_NOT_LOG] = E_DEPRECATED | E_USER_DEPRECATED;

    and used that to wrap error logging in \Pyz\Shared\ErrorHandler\ErrorHandlerEnvironment::setErrorHandler like:
    $doNotLogLevels = Config::get(ErrorHandlerConstants::ERROR_LEVEL_DO_NOT_LOG, 0);
    if (($severity & $doNotLogLevels) === 0) {
    ErrorLogger::getInstance()->log($exception);
    }

    Sorry for the formatting.

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,075 ⚖️ - Guardians (admin)

    Heyhey, me again :)

    Can you provide me more information about how to reproduce it in the ootb demoshop?

    All the best,

    Florian

  • mikko.ropanen
    mikko.ropanen Spryker Solution Partner Posts: 29 ✨ - Novice

    Should be just
    docker/sdk cli composer update
    or
    docker/sdk cli composer require symfony/filesystem:6.4.7

    and then
    docker/sdk console propel:install

    starts failing. Or I think more accurately propel:schema:copy is the step that does the thing in filesystem.

  • ynnoig
    ynnoig Technical Lead eBusiness Spryker Customer Posts: 13 ✨ - Novice
    edited June 3
  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,075 ⚖️ - Guardians (admin)

    Heyhey,
    so I followed @mikko.ropanen s steps now to reproduce and it seems to be fixed with the latest release as @ynnoig was mentioning 🙌

    Thank you all for your input! I love this collaboration in the community!!

    Have a nice day,

    all the best,

    Florian