FriendsOfSymfony / FOSRestBundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony
http://symfony.com/doc/master/bundles/FOSRestBundle/index.html
MIT License
2.79k stars 707 forks source link

error on cache:clear while composer install #2358

Open j4r3kb opened 2 years ago

j4r3kb commented 2 years ago

composer install

Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 1
!!  
!!   // Clearing the cache for the dev environment with debug                       
!!   // true                                                                        
!!  
!!  
!!  In XmlFileLoader.php line 407:
!!                                                                                 
!!    Unable to parse file "/app/vendor/friendsofsymfony/rest-bundle/DependencyIn  
!!    jection/../Resources/config/view.xml": The XML file "/app/vendor/friendsofs  
!!    ymfony/rest-bundle/DependencyInjection/../Resources/config/view.xml" is not  
!!     valid.                                                                      
!!                                                                                 
!!  
!!  In XmlUtils.php line 148:
!!                                                                                 
!!    The XML file "/app/vendor/friendsofsymfony/rest-bundle/DependencyInjection/  
!!    ../Resources/config/view.xml" is not valid.                                  
!!                                                                                 
!!  
!!  In XmlFileLoader.php line 684:
!!                                                                         
!!    Notice: tempnam(): file created in the system's temporary directory  
!!                                                                         
!!  
!!  cache:clear [--no-warmup] [--no-optional-warmers]
!!  
!!  

same with composer auto-scripts

composer.json used: https://pastebin.com/JtHk3ZiV

strange because calling symfony console cache:clear gives no errors The only not usual thing I'm using is the composer via docker this way:

#!/bin/sh

docker run --rm --interactive --tty \
    --user "$(id -u)":"$(id -g)" \
    --volume "$(pwd)":/app \
    --volume "${COMPOSER_HOME:-$HOME/.composer}":/tmp \
    --workdir /app \
    --env COMPOSER_HOME=/tmp \
    composer "$@"
j4r3kb commented 2 years ago

OK it seems the issue is from using the composer's docker image. When using for example composer.phar inside a container with PHP the problem is gone.

medbak commented 2 years ago

OK it seems the issue is from using the composer's docker image. When using for example composer.phar inside a container with PHP the problem is gone.

I have a similar issue with monolog, I tried as you mentioned to download composer.phar and use it inside the container but the same issue persists.