I ran into this today. The problem appears to be that during the installation process (at least in my case) an exception is triggered during the file creation. This exception is suppressed unless the verbose mode of composer is installed: composer install -vvv
. In my case, it appears to be attempting creation of a directory on top of the symlink:
mkdir(): File exists
Debugging the following function, the error is clearer: https://github.com/magento/magento-composer-installer/blob/master/src/MagentoHackathon/Composer/Magento/DeployManager.php#L97
# Args:
# 0 ${APP_ROOT}/./pub/media/theme_customization
# 1 511
# 2 true # <-- Probably the problem
The line that appears to trigger the exception is: https://github.com/magento/magento-composer-installer/blob/master/src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php#L35
Hooking an strace
to that process while debugging shows the following:
stat("${DOCROOT}/pub/media", 0x7ffe47435c90) = -1 ENOENT (No such file or directory)
stat("${DOCROOT}/pub", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
mkdir("${DOCROOT}/pub/media", 0777) = -1 EEXIST (File exists)
In my case, I use a symlink for the media folder to persist it during releases (even during local dev). The recursive argument of PHP appears to be attempting to mkdir for that path, and failing.
The resolution (for me at least) was to just remove symlinks during the initial install:
find . -type l -exec rm {} \;
After that, it worked ok. Lodged https://github.com/magento/magento2/issues/10292