Forum

Thread tagged as: Problem

Bucket Permissions Error

Hi

I'm getting a permissions error with buckets in assets.

I've doubled and doubled checked and all folders and files in the resources folder are all set to 777 but I get this error...

Warning: mkdir(): Permission denied in /home/supreme/433S5G0O/htdocs/cms/core/lib/PerchResourceBucket.class.php on line 123

I can upload to the resources folder (default) but not to any of the folders within resources. It won't even save/use an image that's already uploaded within assets.

I've checked with our hosting and they're happy that permissions are all ok too.

It's only started today after I put the site live. The site was already on the web server when it was in development, the only thing I've changed is to move all the files into the public /htdocs folder (which is what I normally do without any issues)

Any help would be much appreciated.

Perch: 3.0.8, PHP: 7.0.15, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (3.0.8), assets (3.0.8), categories (3.0.8), perch_blog (5.6.1), perch_forms (1.9)
App runtimes: <?php $apps_list = [ 'perch_forms', 'perch_blog', ];
PERCH_LOGINPATH: /cms
PERCH_PATH: /home/supreme/433S5G0O/htdocs/cms
PERCH_CORE: /home/supreme/433S5G0O/htdocs/cms/core
PERCH_RESFILEPATH: /home/supreme/433S5G0O/htdocs/cms/resources
Image manipulation: GD Imagick
PHP limits: Max upload 128M, Max POST 128M, Memory: 256M, Total max file upload: 128M
F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7
Resource folder writeable: Yes
HTTP_HOST: supreme-windows.co.uk
DOCUMENT_ROOT: /home/supreme/433S5G0O/htdocs/
REQUEST_URI: /cms/core/settings/diagnostics/
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
Glen Piggott

Glen Piggott 0 points

  • 4 years ago

Which user owns the resources folder and ''cms''?

Lexi McGee said:

Which user owns the resources folder and ''cms''?

apache owns all the bucket folders as they were created within Perch. supreme owns all the other folders.

This is normal and has worked on all our other 30+ Perch sites

The message I get on the Perch edit page is

Your resources folder is not writable. Make this folder (/cms/resources/hero-images) writable to upload images.

...but the folder is set as 777 with owner as apache

Try creating the resources folder with the supreme user.

Lexi McGee said:

Try creating the resources folder with the supreme user.

The /resources folder is currently setup with supreme as the owner. All the bucket folders within /resources are set to apache as the owner.

We did have all folders and files set to supreme but that didn't work either.

I've just renamed the bucket in the template tag to bucket="hero" and it created a new folder, uploaded and inserted a test image perfectly.

I then went to select another image in the existing /resources/hero-images/ folder and it won't insert the image into the page.

Debug from Perch admin page...

Debug Message - Perch 3.0.8
[1] SELECT u.*, r.* FROM perch3_users u, perch3_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='14b0539ddebb30b03101e4e05db2a31b' LIMIT 1
UPDATE perch3_users SET userHash='ce7d247b06e85be956743a150103bc52' WHERE userID='1'
[39] SELECT p.privKey FROM perch3_user_privileges p
[21] SELECT settingID, settingValue, userID FROM perch3_settings WHERE userID=1 OR userID=0 ORDER BY userID ASC
[8] SELECT itemValue FROM perch3_menu_items WHERE itemType='app'
[1] SELECT * FROM perch3_content_regions WHERE regionID=169 LIMIT 1
[1] SELECT * FROM perch3_pages WHERE pageID='14' LIMIT 1
Using template: /templates/content/header_banner.html
[1] SELECT * FROM perch3_content_items c WHERE c.regionID=169 AND c.itemRev=5 ORDER BY c.itemOrder ASC
Using template: /templates/content/header_banner.html
[1] SELECT * FROM perch3_content_items c WHERE c.regionID=169 AND c.itemRev=5 ORDER BY c.itemOrder ASC
Using template: /templates/content/header_banner.html
Form not posted or did not validate
[1] SELECT * FROM perch3_menu_items WHERE itemActive=1 AND itemType='menu' AND parentID=0 ORDER BY itemOrder ASC LIMIT 0, 1
[3] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=1 ORDER BY mi.itemOrder ASC
[1] SELECT itemTitle FROM perch3_menu_items WHERE itemType='app' AND itemValue='content' LIMIT 1
[1] SELECT * FROM perch3_menu_items WHERE itemActive=1 AND itemType='menu' AND parentID=0 ORDER BY itemOrder ASC LIMIT 1, 10
[2] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=2 ORDER BY mi.itemOrder ASC
File: /core/apps/content/modes/edit.form.post.php
[1] SELECT * FROM perch3_resources WHERE resourceID='611' LIMIT 1
adding: Your resources folder is not writable. Make this folder (
adding: ) writable to upload images.
Mode: edit.form
Queries: 16
Memory: 3.6912
Array
(
    [type] => 2
    [message] => mkdir(): Permission denied
    [file] => /home/supreme/433S5G0O/htdocs/cms/core/lib/PerchResourceBucket.class.php
    [line] => 123
)

Solved.

We've managed to track it down to the paths in the /config/buckets.php files, which were incorrect.

Updated these paths and problem solved.

Thanks for your help Lexi