Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Perforce sync write permission error

📅 2018-Feb-02 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ error, p4 ⬩ 📚 Archive

Problem

I tried to sync a Perforce client and got this error:

$ p4 sync
open for write: /home/joe/p4_workspace/foobar/tmp.30935.46: Permission denied

The strange thing is that there is no tmp.30935.46 in this repository!

Solution

Turns out that Perforce writes some temporary files to subdirectories during the sync operation. This error indicates that it is failing in this write because the directory does not have write permissions.

The error went away and the sync worked once I added write permissions to that directory:

$ chmod +w /home/joe/p4_workspace/foobar