Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AssetMapper] importmap:install silently fail but say everything is ok on prod #54719

Closed
zorn-v opened this issue Apr 24, 2024 · 0 comments
Closed

Comments

@zorn-v
Copy link

zorn-v commented Apr 24, 2024

Symfony version(s) affected

6.4.6

Description

If you have no permissions to write to assets directrory you'll just get a php warning in prod enviroment (as warnings does not converts to exceptions there).
It is not right to say "all right" when it is not I think. And return exit code 0. bash scripts with set -e continue executing with not installed assets in CI (for example). Good that assets:compile throw exeption like "you did not run importmap:install", but problem was in another place.

21:14:28 WARNING   [php] Warning: file_put_contents(/var/www/html/assets/vendor/installed.php): Failed to open stream: No such file or directory ["exception" => ErrorException { …}]

                                                                                                                        
 [OK] Downloaded 1 package into assets/vendor.                                                                          
                                                                                                                        

How to reproduce

./bin/console imp:req bootstrap
rm -rf assets/vendor
echo 'APP_ENV=prod' >> .env.local
chmod 555 assets
./bin/console imp:inst

Possible Solution

Check that downloded package exists and throw exception otherwise.

Additional Context

@zorn-v zorn-v added the Bug label Apr 24, 2024
fabpot added a commit that referenced this issue Apr 27, 2024
…nandre)

This PR was squashed before being merged into the 6.4 branch.

Discussion
----------

[AssetMapper] Check asset/vendor directory is writable

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #54719
| License       | MIT

💐

Commits
-------

7c2da27 [AssetMapper] Check asset/vendor directory is writable
@fabpot fabpot closed this as completed Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants