You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the problem
When running the updater and the EE system directory is on a different filesystem from the webroot directory the update will fail when attempting to move the updated theme files into place. I was updating from the CLI, however after reviewing the relevant updater code I believe this would affect upgrades from the control panel as well.
How To Reproduce
Steps to reproduce the behavior:
Create a new deployment from an EE version that isn't current
Relocate the webroot directory to a different filesystem
Version: Encountered when updating to EE 6.4.17, but I've reviewed the area of the updater where the failure occurred and it doesn't appear this has been changed recently.
PHP Version: 8.1.27
MySQL Version: MariaDB 10.6.12
OS: Ubuntu 22.04
Web Server: nginx 1.18.0
Possible Solution
This issue appears to be caused by the use of the PHP "rename" function in Filesystem.php's rename, which in turn is being called by the move function in FileUpdater.php
The php rename function does not support moving directories between filesystems, which is documented in this PHP bug report. This can be illustrated with the following snippet:
<?php
$source = "/tmp/testdir";
// where 'externalfs' is a mount point for a different filesystem than /tmp is located on
$dest = "/mnt/externalfs/testdirmoved";
rename($source, $dest);
Which will result in the error:
PHP Warning: rename(): The first argument to copy() function cannot be a directory in /root/test.php on line 7
PHP Warning: rename(/tmp/testdir,/mnt/externalfs/testdirmoved): Invalid cross-device link in /root/test.php on line 7
A possible solution would be performing a copy, then delete, with the disadvantage that this would be less efficient when the source and destination are on the same filesystem. It could be possible to first check whether the source and target are on the same filesystem using stat().
Additional context
My webroot directory is on shared filesystem, while each server in the cluster has its own copy of the system files (for performance reasons). I was able to work around this issue by unmounting my webroot directory and copying the themes directory from the share, then copying the themes directory back to the share and re-mounting after the update completed.
The text was updated successfully, but these errors were encountered:
Description of the problem
When running the updater and the EE system directory is on a different filesystem from the webroot directory the update will fail when attempting to move the updated theme files into place. I was updating from the CLI, however after reviewing the relevant updater code I believe this would affect upgrades from the control panel as well.
How To Reproduce
Steps to reproduce the behavior:
Error Messages
![image](https://private-user-images.githubusercontent.com/84423981/324481158-1c91097c-ca96-414f-b712-dfe470cf5263.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkyNjAyMTQsIm5iZiI6MTcxOTI1OTkxNCwicGF0aCI6Ii84NDQyMzk4MS8zMjQ0ODExNTgtMWM5MTA5N2MtY2E5Ni00MTRmLWI3MTItZGZlNDcwY2Y1MjYzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI0VDIwMTE1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI1ZGU0NWU1NDU4ZTVjNDgwMzYzNjQzZTEwY2RhMGRhODg4OWVmZDc5ZWNlZjEyODU0ZTFjYjFhY2FhYjcyZjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ZhC0w0IspnwjXYlxnXi1WNsTEb-WMmDekUcCWPBapWc)
Environment Details:
Possible Solution
This issue appears to be caused by the use of the PHP "rename" function in Filesystem.php's rename, which in turn is being called by the move function in FileUpdater.php
The php rename function does not support moving directories between filesystems, which is documented in this PHP bug report. This can be illustrated with the following snippet:
Which will result in the error:
A possible solution would be performing a copy, then delete, with the disadvantage that this would be less efficient when the source and destination are on the same filesystem. It could be possible to first check whether the source and target are on the same filesystem using stat().
Additional context
My webroot directory is on shared filesystem, while each server in the cluster has its own copy of the system files (for performance reasons). I was able to work around this issue by unmounting my webroot directory and copying the themes directory from the share, then copying the themes directory back to the share and re-mounting after the update completed.
The text was updated successfully, but these errors were encountered: