craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.28k stars 637 forks source link

[5.x]: Volume Exception – craft\errors\VolumeException Unable to create directory for temporary uploads. #16169

Closed harry2909 closed 5 days ago

harry2909 commented 5 days ago

What happened?

Description

I get this error when trying to access the asset manager.

I have added the file system to the CMS "servdTemp"

I have set this handle in the general config for temp uploads.

When I look in the DB under Volumes and Volumes folders, nothing is showing for this created volume.

I have tried creating new filesystems, with no luck.

If I dd $temporaryUploadFolder = Craft::$app->getAssets()->getUserTemporaryUploadFolder(); in the elements/Asset.php file when the site is working (which is when servdTemp is set to a local folder) it outputs

craft\models\VolumeFolder {#1187 ▼
  -_events: []
  -_eventWildcards: []
  -_behaviors: []
  -_errors: null
  -_validators: null
  -_scenario: "default"
  +id: 14
  +parentId: 1
  +volumeId: null
  +name: "Temporary Uploads"
  +path: "user_1/"
  +uid: "2368537d-8ffe-4727-848c-65ea2ae0ea7b"
  -_children: null
}

Whiich is odd because there's no volume ID, and the path isn't what I've set in teh general config for tempAssetUploadFs

After some more digging, if I log the exception here on line 1039 in services/assets.php

I get

craft\errors\FsException {#1709 ▼
  #message: "Unable to check existence for: user_1/"
  #code: 0
  #file: "/var/www/html/cms/vendor/craftcms/flysystem/src/base/FlysystemFs.php"
  #line: 221
  -previous: League\Flysystem\UnableToCheckDirectoryExistence {#1658 ▶}
  trace: {▶}
}

Image

Steps to reproduce

  1. Create volume for temp assets
  2. Set the handle in general config
  3. Access asset manager

Expected behavior

Craft created folder in new filesystem for temp uploads

Actual behavior

Error

Craft CMS version

5.5.2

PHP version

8.3.12

Operating system and version

No response

Database type and version

SQL 8

Image driver and version

No response

Installed plugins and versions

"require": { "craftcms/ckeditor": "4.4.0", "craftcms/cms": "5.5.2", "mindseeker-media/craft-related-elements": "^1.1.0", "mmikkel/cp-field-inspect": "2.0.2", "nystudio107/craft-retour": "5.0.3", "nystudio107/craft-seomatic": "5.1.6", "nystudio107/craft-vite": "5.0.1", "servd/craft-asset-storage": "4.0.9", "studioespresso/craft-scout": "^5.0.1", "vandres/craft-matrix-extended": "^v3.6.1", "verbb/cp-nav": "^5.0.2", "verbb/expanded-singles": "3.0.1", "verbb/formie": "3.0.12", "verbb/navigation": "3.0.5", "vlucas/phpdotenv": "^5.4.0", "wbrowar/craft-admin-bar": "5.0.0" },

harry2909 commented 5 days ago

Realised this may actually be an issue with one of the plugins we're using.