Environment: Win7, Acquia dev desktop.

We installed Drupal via browser and installation went ok. After visiting the site first time we are getting the following warning:
Warning: rename(C:\Users\Username\Sites\drupal/sites/d8.localhost/files/php/service_container/.service_container_prod.php,C:\Users\Username\Sites\drupal/sites/d8.localhost/files/php/service_container/service_container_prod.php/58a1afbbaaba3ad71b02586ce30febed3a8bc77c1d45cc8c2f8ce18d067a17b4.php) [function.rename]: Access is denied. (code: 5) in Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage->save() (line 124 of core\lib\Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage.php).

We did git revert 701d4e6 and reinstalled Drupal from scratch again. The warning message didn't appear again.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chx’s picture

We need more Windows 7 testers and someone to debug this :/

cosmicdreams’s picture

Assigned: Unassigned » cosmicdreams

I have a similar setup. Looking into it.

cosmicdreams’s picture

OK, I installed D8 on my Windows 7 box (using commit 37949fe37843eed62b09aba8f2612e832df2953e) and didn't get any warnings or errors during the installation.

I'm using Acquia Dev Desktop version 7.22.24

cosmicdreams’s picture

Status: Active » Postponed (maintainer needs more info)

tonku, what are your environment's specifications?

tonku’s picture

I have also Acquia Dev Desktop version 7.22.24 (with php version 5.3.18, apache 2.2.22, mysql 5.1.66-community).
I didn't get any warnings or errors during the installation, but after installation I clicked "Visit your new site." link and then the message appeared. After page refresh the error message disappears. There's no log entries in Drupal regarding that warning message.

Steps to reproduce the problem:
1. Install Acquia Dev Desktop in Windows 7
2. Use git to download Drupal 8: git clone --branch 8.x http://git.drupal.org/project/drupal.git
3. Import site from Acquia Dev Desktop
4. Install the site via browser
5. Click "Visit your new site." link

In the community tools workshop the lady sitting next to me got the same warning message. She had Win7 and used git to download the files but unfortunately I don't know more info about the setup she was having.

I tried the same steps with another computer:
Mac with Oracle VirtualBox and Windows 7
Acquia Dev Desktop version 7.23.25 (with php version 5.3.18, apache 2.2.22, mysql 5.1.66-community)
...and got the same warning message.

Tell me if you need some more information or tests from me.

StuartJNCC’s picture

I see the same thing. My setup has nothing to do with Acquia Dev Desktop!

Windows 7 professional Service pack 1, 64-bit, 3Gb RAM
Apache/2.2.25 (Win32)
PHP 5.3.27
MySQL 5.6.13

Get latest Drupal 8 either via GIT clone or downloading from https://drupal.org/node/572834

After finishing install and first going to "Visit your new site." link, I get a red message:

Warning: rename(D:\webstuff\www\drupal/sites/default/files/php/service_container/.service_container_prod.php,D:\webstuff\www\drupal/sites/default/files/php/service_container/service_container_prod.php/5e35ab8aedeb892bab51cdbb00193c21ee85e99cf7b779b0b9fa7787c2de49a8.php): Access is denied. (code: 5) in Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage->save() (line 124 of core\lib\Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage.php).

Do anything else on the site and the message does not occur again and things seem to work OK.

mradcliffe’s picture

Is it possible that the file has an open resource handle because I think that is one of the causes for rename() to fail on Windows.

salvis’s picture

Assigned: cosmicdreams » Unassigned
Status: Postponed (maintainer needs more info) » Needs review
FileSize
497 bytes

Sorry for butting in, but I need this to work. I have the same issue on Win7, upon installation and when installing/uninstalling modules.

If I help it along and manually do the rename() (aka moving), then the warning goes away, but watchdog still keeps logging

Container cannot be written to disk

The problem is that #1908440-111: Relax MTimeProtectedFileStorage permissions for DX, drush integration and world domination removed the chmod() call to make the file(s) writable (in spite of the promise in the comment above). Under Windows you cannot delete a read-only file without first removing the read-only flag, and subsequently you cannot delete the non-empty directory.

The attached patch fixes this issue.

amateescu’s picture

I have the same issue and can confirm that the patch fixes it. Won't set it to RTBC though until we get more confirmations and approval from @chx :)

chx’s picture

Status: Needs review » Reviewed & tested by the community

Oh hrm, Windows :( okay let's do it.

webchick’s picture

Status: Reviewed & tested by the community » Needs work

Can we throw a quick comment there that explains why we're doing this so that someone doesn't try and "optimize" this code in the future and remove the call once again?

salvis’s picture

Status: Needs work » Needs review
FileSize
923 bytes

Comments adjusted.

Status: Needs review » Needs work

The last submitted patch, FileStorage_under_Win.2099671.12.patch, failed testing.

salvis’s picture

Status: Needs work » Needs review

I don't think that's caused by the updated patch, which only changed some comments compared to #8...

amateescu’s picture

chx’s picture

Status: Needs review » Reviewed & tested by the community

Try #2

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 28077fa and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.