error on symphony when dev build

Silverstripe Version: 4.11


I got error when I trying to run dev/build, with this error message:

Uncaught Symfony\Component\Filesystem\Exception\IOException: Failed to remove directory “/home/mypc/shared/silver/.graphql-generated/…YCz”: rmdir(/home/mypc/shared/silver/.graphql-generated/…YCz): Text file busy

GET /dev/build

Line 200 in /home/mypc/shared/silver/vendor/symfony/filesystem/Filesystem.php

I run dev/build according on : SilverStripe Lessons » Working with Multiple Templates » Silverstripe CMS

Q : How to fix this?

my operating system is : ubuntu 20.0

please help me


You need to grant write access for your web server to the .graphql-generated directory in your development environment, and if you aren’t committing it to your version control or creating it in a CI step then it also needs to have access in your production environment. This is mentioned in the filesystem permissions documentation.


Thanks for replied,

I had granted access to .graphql-generated directory with sudo chmod a+rwx -R directory

but the result is still same,

Note : this error message isn’t always appear, unless if the position in the events (odd and events) then the message appear,

for example : if I run dev/build at :
first attempt this error message not appear,
but on second attempt this error message appear,
the third attempt same as he first and the fourth same as the second

please help

Thank you

Ahh, I think I didn’t see part of the error message you showed which might explain this:

That seems to indicate that one of the files in the .graphql-generated directory is being read - either by the Silverstripe application or by something else on your system - at the time Silverstripe wants to clear it. This explains why it is happening only every second attempt - after the first attempt, there is some lingering process which is still accessing the file. By the time you attempt it a third time, that process has finished.

Try simply waiting a little bit longer between dev/build attempts.