-
Notifications
You must be signed in to change notification settings - Fork 630
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
Vague error when /storage/runtime/temp isn't writable #2814
Comments
We wouldn’t want to expose the original PHP error, because it will likely contain a file path, which is considered sensitive. However I’ve just updated the exception handling so that it will at least log the original error. So if this crops up again, you can search your logs for “An error occurred when saving an asset”, and you fill find the full exception logged right after that (including the original error). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
For some reason I was unable to upload files on my live server. When trying this, I was given a simple JavaScript alert saying "There was a problem with uploading the file.". After some digging and commenting out code, I discovered that this was because
/storage/runtime/temp
was not writable.A possible fix would be to improve
\craft\controllers\AssetsController::_getUploadedFileTempPath
. Right nowthrow new UploadFailedException(0);
is thrown when\craft\web\UploadedFile::saveAsTempFile
throws an exception. Having the exception message of\yii\base\ErrorException
shown in the JavaScript alert (orweb.log
) would have made it less confusing to me.Steps to reproduce
/storage/runtime/temp
is not writable.Additional info
Note: I am using Docker, which is why file permissions are a bit more complicated.
The text was updated successfully, but these errors were encountered: