Jump to content

[SOLVED] "destinationPath is not writable" after mistakenly syncing my processwire install with Google Drive.


Recommended Posts

Hello,

I basically misclicked my htaccess folder into being synced with my Drive (don't ask me how).

While the local site I was working on under htaccess still functions, I cannot edit anything anymore in PW without getting "destinationPath is not writable" on save. While the folder is now back to being completely unsync'd with Drive, the issue still persists and it seems it has permantently messed something up in the PW install.

Thankfully I'm in no rush and would like to take this as a learning opportunity. I'm still mainly a designer and still not so familiar with many things backend-related. Feel free to ask me anything more you'd need to know.

Link to comment
Share on other sites

Hi @François Lacruche,  I assume you are running a website on your computer and when you synced the folder to Google Drive, the permissions of the folders/files got "corrupted".

- Where are you seeing the "destinationPath is not writable" error? Please share a capture.
- Is the site accessible?
- Can you access the admin?

Some possible solutions (just guessing here):
- Try to set the permissions for the folders/files https://processwire.com/docs/security/file-permissions/#how-to-change-permissions-of-existing-files
- What if you do a new Processwire installation in a new folder and after the installation is done, you copy the files inside the "corrupted:  /site/ folder to the new installation?

 

Link to comment
Share on other sites

Yes the website is running on my localhost. Yes the site is still accessible, and yes I can access the admin: it is where the errors are being displayed. Screenshot below.
After further investigation it seems that only image/file fields are affected (I didn't test every field type but these are the ones I have that are broken). Text & checkbox fields, for instance, appear to be fully functional, I can save them and they update the site accordingly.

Thank you for your help ? I'm going to try the solutions you're proposing tomorrow and update the post accordingly. Feel free to tell me if this additional info change your mind.

image.thumb.png.1cb2ffffbd3cc05f660a0d7fd08cf036.png

Link to comment
Share on other sites

Cool, add any updates here. But it looks like a permission issue with your /site/assets folder. 

Try:

chmod -R og+rw /site/assets

Or maybe you can restore the files and folders manually by going to drive.google.com and download the folder contents. Don't know how the sync works, but maybe your local files permissions are "screwed" but the files in the cloud version are Ok.

Here's a related discussion you can read.

Link to comment
Share on other sites

The chmod command fixed everything. Thank you very much ! Weird that syncing files changes permissions that way. By the way, this exact syntax didn't work for me (no such file or directory)

chmod -R og+rw /site/assets

but this one did

chmod -R og+rw site/assets

Idk if this is because of where I was in the file system or something (I'm generally unfamiliar with git bash) but leaving it here to potentially save a few minutes to the next unexperienced person ?

Thank you again !!

  • Like 1
Link to comment
Share on other sites

  • François Lacruche changed the title to [SOLVED] "destinationPath is not writable" after mistakenly syncing my processwire install with Google Drive.
  • 4 weeks later...

Coming back to this subject after a while, with a question I didn't ask msyelf earlier : can having used this command pose any security threat for later when I'll upload this site ? Should I restrict the permissions more now that I understood the root of my original issue ? And if yes how should I research to find the approriate answer for my case (unless you have an easy/direct answer) ?

Link to comment
Share on other sites

@François Lacruche you can read more about permissions in the post I linked before and security here: https://processwire.com/docs/security/

By doing `chmod -R og+rw site/assets` you added read and write permissions to `others`  and `group`. The recommendation is:

0755 for directories:
7: Owner (full control: read, write, execute)
5: Group (read and execute)
5: Others (read and execute)

0644 for static files:
7: Owner: Read and write permissions (rw-)
4: Group: Read permissions (r--)
4: Others: Read permissions (r--)

So just to be sure, you can execute:

`chmod 755 site/assets/` (permissions for directory)

and then
`find site/assets/ -type f -exec chmod 644 {} \;` (permissions for files)

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...