Search code examples
dockerphpstorm

Docker cannot read file which has been changed in PhpStorm


Docker cannot read mounted file which has been edited in PhpStorm. It looks like this in docker:

enter image description here

And the cat composer.json shows then:

cat: composer.json: Input/output error

Sometimes cat helps to return file back to live.

At the same time there is no problem with Sublime usage. Therefore I guess there reason is hidden somewhere in PhpStorm setting, but which ones?


Solution

  • My main (and only) suspect is Settings (Preferences on macOS) | Appearance & Behavior | System Settings | Synchronization | Use "safe write".

    When enabled (which is by default) it writes into temp file first, then deletes original and renames temp file. When doing that the new file may loose owner/access permissions info (at very least it was in some cases in the past).

    Try disabling that option and see how it goes.