Magento 2.3 bug on Windows: «Command line user does not have read and write permissions on generated directory»

Magento 2 had a similar issue with Windows in 2016:

1. Magento\Framework\Console\Exception\GenerationDirectoryAccessException::__construct()

2. Magento\Setup\Console\CompilerPreparation::handleCompilerEnvironment()

3. Magento\Framework\Console\GenerationDirectoryAccess::check()

4. Magento\Framework\Filesystem\Directory\Write::isWritable()

5. Magento\Framework\Filesystem\Driver\File::isWritable()


It looks like the same issue: «Can’t create directory generated/code/Magento/Framework/App/ResourceConnection/.» in Windows

Magento 2.3 wrongly creates the generated folder’s subfolders (code and metadata) as read-only:

Magento\Framework\Filesystem\Directory\Write::create()

It sets the 511 (it is the same as 0777) permissions for a created folder:

The solution is to delete the generated folder.

The same problem: Magento 2.3 bug: «Class Magento\Store\Api\Data\WebsiteExtensionInterface does not exist» on «setup:static-content:deploy»

I struggled with this for hours and then figured out my docker instance was out of space.

Deleted all var/log files and everything started working again.

A symptom was that everytime I would run start my docker swarm it would indeed start 2 or 3 of the services needed for Magento. The expected output if you start your docker swarm multiple times is that it should just tell you each of the services are “up to date” instead of starting any of them.

Hope this helps somebody.

1 Like

See also: windows-filesystem tagged topics.