Warning: touch(): Utime failed

Created on 25 April 2016, over 8 years ago
Updated 18 July 2023, over 1 year ago

Warning: touch(): Utime failed: Operation not permitted in Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage->save() (line 98 of /drupal/core/lib/Drupal/Component/PhpStorage/MTimeProtectedFastFileStorage.php).

πŸ› Bug report
Status

Active

Version

9.5

Component
BaseΒ  β†’

Last updated 2 days ago

Created by

πŸ‡ΈπŸ‡¦Saudi Arabia 3eidoz Riyadh

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡§πŸ‡ͺBelgium DuneBL

    Same as #26 but on D9.5.1/Ubuntu 22.04 with php 8.1.14

  • πŸ‡§πŸ‡ͺBelgium DuneBL

    It happens each time I uninstall a module with the GUI. (But it happens also on other occasions, but I don't see a pattern)

  • πŸ‡§πŸ‡ͺBelgium DuneBL

    I found the reason why this warning pop-up: this is because the PHP touch() function works only if the file or directory being touched is owned by the PHP user (www-data for apache). If the file or directory have only the group set as www-data it will not work.
    As a requirement we must say that all Drupal temp files must be www-data:www-data

  • πŸ‡ͺπŸ‡ͺEstonia ragnarkurm

    We are experiencing this problem on NFS based filesystem.

    What seems to be happening is this:

    1. Drupal creates a file
    2. NFS starts to sync file creation operation to the NFS server
    3. Drupal tries to touch the file, but NFS thinks the file is not there (yet)
    4. Drupal issues error/warning
    5. NFS completes file creation operation (say in 1 sec), and the file is now seen on the NFS client system
    6. Note: the file sometimes has a random mtime, usually far in the past
  • πŸ‡·πŸ‡ΊRussia _kom__

    I've got the similar warnings when I've tried to mount 'drupal' folder on the host via nfs+bindfs plugin into guest machine managed by Vagrant+Virtualbox. Mount configuration is:

    config.vm.synced_folder "drupal", "/vagrant-nfs", type: "nfs", nfs_udp: false
    config.bindfs.bind_folder "/vagrant-nfs", "/var/www/drupal",
          u: 'vagrant',
          g: 'vagrant',
          perms: 'u=rwX:g=rwD',
          o: 'nonempty'
      config.nfs.map_uid = Process.uid
      config.nfs.map_gid = Process.gid

    Vagrant and www-data are members of both groups 'vagrant' and 'www-data'.

    On the other hand, there is no warnings when using native vboxsf with same user:group:

    config.vm.synced_folder "drupal", "/var/www/drupal", owner: "vagrant", group: "vagrant"
    

    No errors observed on production server with totally same configuration: Drupal 9.5.8, Ubuntu 22.04.2
    PHP 8.1.18, Apache 2.4.52 with another 'sysadmin:sysadmin' user and no mount directories.

  • This error can be fixed by deleting the public://php/ folder and clearing the site cache with drush cr. The site will recreate the folder with www-data as the owner and `drwxrwxrwx` (777) permissions.

  • πŸ‡«πŸ‡·France fgm Paris, France

    Not necessarily: it will recreate with the user running drush as owner. And in many cases this means a user that is not www-data (or is equivalent on other distros) but which has www-data as its primary group. That's a situation I encounter quite frequently when doing audits.

Production build 0.71.5 2024