Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with permissions(can't upload product images) #79

Open
srgrbkl opened this issue Feb 24, 2021 · 14 comments
Open

problem with permissions(can't upload product images) #79

srgrbkl opened this issue Feb 24, 2021 · 14 comments

Comments

@srgrbkl
Copy link

srgrbkl commented Feb 24, 2021

I'm trying to upload images of product but I get an error(tested in m2.4.2): 'A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.'
system.log: main.CRITICAL: The permissions can't be changed for the "/home/vagrant/magento/pub/media/tmp/catalog/product/u/n/u.jpg" path. Warning!chmod(): Operation not permitted. [] []

@srgrbkl srgrbkl changed the title can't upload product images problem with permissions(can't upload product images) Feb 24, 2021
@AlexRoig
Copy link

AlexRoig commented Mar 1, 2021

I'm having exactly the same issue. Fresh VM install with CE 2.4.2.
Any hints?

@zepgram
Copy link
Owner

zepgram commented Mar 1, 2021

I'll take a look in few minutes.

@zepgram
Copy link
Owner

zepgram commented Mar 1, 2021

Ok, so this is related to this line: vendor/magento/framework/Filesystem/Driver/File.php::524 : Magento try to apply permission right after image creation.

On NFS mount, all permissions are forced to "u=rwx:g=rwx:o=rwx" with bindfs.
I'll try to disable bindfs and run installation with normal permissions.

@zepgram
Copy link
Owner

zepgram commented Mar 2, 2021

I made some change, can you confirm that everything is working on develop branch ?

If it's fine I'll merge into master.

@srgrbkl
Copy link
Author

srgrbkl commented Mar 2, 2021

tested develop branch with options:
mount: 'rsync'
path: 'root'
provision: 'all'

get error: (failed)net::ERR_CONNECTION_REFUSED

@AlexRoig
Copy link

AlexRoig commented Mar 2, 2021

I took my existing VM, shut it down, used your modified Vagrantfile and run 'vagrant up' again and it's working perfectly. I kept in my config the NFS mount.
Although when I started investigating the issue I faced a lot of problems with the CSP module on Magento and had to disable it.

@zepgram
Copy link
Owner

zepgram commented Mar 2, 2021

@AlexRoig Good news ! Thanks for testing.

@srgrbkl bindfs looks like mandatory for rsync mount, I'm investigating.

zepgram pushed a commit that referenced this issue Mar 2, 2021
@zepgram
Copy link
Owner

zepgram commented Mar 2, 2021

You can retry with a simple vagrant reload @srgrbkl, rsync should work correctly this time.
If you have an issue on first launch, run bin/magento setup:upgrade && permission.

zepgram pushed a commit that referenced this issue Mar 2, 2021
zepgram pushed a commit that referenced this issue Mar 2, 2021
@srgrbkl
Copy link
Author

srgrbkl commented Mar 2, 2021

@zepgram tested develop branch and its works fine now

@dutchwebdesign
Copy link

We have same problem with magento 2.4.3 inside pagebuilder:

main.CRITICAL: The permissions can't be changed for the "/home/vagrant/magento/pub/media/wysiwyg/oks-hero.jpg" path. Warning!chmod(): Operation not permitted. [] []

I used this code with and without Vagrantfile and both not working, also permission command does not fix it.

config.bindfs.default_options = {
force_user: 'vagrant',
force_group: 'www-data',
perms: 'u=rwx:g=rwx:o=rx'
}

@zepgram
Copy link
Owner

zepgram commented Sep 25, 2021

Well I tried it and it seems ok:
image

Could you describe what you did ?
What is your mount configuration (default / rsync / nfs) ?

@dutchwebdesign
Copy link

we use nfs -> in the pagebuilder use the image upload (from own computer)

@zepgram zepgram reopened this Oct 19, 2021
@dutchwebdesign
Copy link

We fixed it by disable in vagrantfile
#config.bindfs.bind_folder guestDirectory, guestDirectory, after: :provision
and using command on host
vagrant plugin uninstall vagrant-bindfs

see puphpet/puphpet#1756

@zepgram
Copy link
Owner

zepgram commented Nov 22, 2021

I'll take a look to find a solution, bindfs is supposed to be required to avoid issues with permissions while using NFS mount.

I did this commit a long time ago : 3b9e9e5

But this was creating an issue with RSYNC mount.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants