Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon Are there any known issues with Laravel Media Library and S3 in version 9.11.4


Are there any known issues with Laravel Media Library and S3 in version 9.11.4


there are a few key points regarding issues with Laravel Media Library and Amazon S3 in version 9.11.4:

1. AWS SDK Version Issue: The search results indicate that a bug was introduced in the `aws/aws-sdk-php` library version 3.209.31, which caused issues with deleting files from S3. Upgrading to version 3.211.x or later should resolve the problem.

2. Permissions Issue: Ensure that the IAM user or role used by your application has the necessary permissions to delete objects from the S3 bucket. The policy should include the `s3:DeleteObject` action.

3. Soft Deletes: If you are using soft deletes in your Eloquent model, the package may not be able to properly delete the associated media files. Try using the `forceDelete()` method instead of the regular `delete()` method.

4. Disk Configuration: Double-check your S3 disk configuration in the `config/filesystems.php` file, including the bucket name, region, and any other necessary settings.

5. Downgrading to 9.11.3: Some users reported that reverting to version 9.11.3 of the Laravel Media Library package resolved the issue with deleting files from S3.

6. Temporary Uploads: There were also reports of issues with temporary uploads to S3 when using the Media Library Pro package. Switching to a local disk for temporary uploads and then moving the files to S3 seemed to work as a workaround.

In summary, the main issues appear to be related to a bug in the AWS SDK library, permissions problems, and potential conflicts with soft deletes. Trying the suggested solutions, such as upgrading the AWS SDK, checking permissions, and using `forceDelete()`, should help resolve the problems you're experiencing with version 9.11.4 of the Laravel Media Library package.

If you continue to have issues, it's recommended to open a new issue on the package's GitHub repository and provide the relevant details, as the maintainers may be able to provide further assistance.

Citations:
[1] https://github.com/spatie/laravel-medialibrary/issues/2854
[2] https://github.com/spatie/laravel-medialibrary/discussions/3151
[3] https://github.com/spatie/laravel-medialibrary/issues/2816
[4] https://stackoverflow.com/questions/70976347/problem-storing-laravel-medialibrary-pro-media-to-aws-s3
[5] https://www.reddit.com/r/laravel/comments/xxjbnl/whats_up_with_spatie_not_touching_s3/