When re-uploading an image I get error " chmod(): Operation not permitted "
Describe the bug
Uploading an image is not possible, when the cover-image was already uploaded once.
Steps to reproduce
- Create a new podcast with some cover
- Try to change the cover with a little changed image
- Workaround: create just a new podcast and upload the cover there
Expected behavior
It should be possible to upload again an image, even though there was already an image added. That image should be overwritten.
Actual behavior
The error message appears (the image is still uploaded on the server, but only partially used.
Relevant logs and/or screenshots
ErrorException: chmod(): Operation not permitted in /opt/castopod/vendor/codeigniter4/framework/system/Images/Handlers/GDHandler.php:281
Stack trace:
#0 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler(2, 'chmod(): Operat...', '/opt/castopod/v...', 281)
#1 /opt/castopod/vendor/codeigniter4/framework/system/Images/Handlers/GDHandler.php(281): chmod('media/podcasts/...', 420)
#2 /opt/castopod/app/Entities/Media/Image.php(90): CodeIgniter\Images\Handlers\GDHandler->save('media/podcasts/...')
#3 /opt/castopod/app/Entities/Media/Image.php(67): App\Entities\Media\Image->saveSizes()
#4 /opt/castopod/app/Entities/Episode.php(185): App\Entities\Media\Image->setFile(Object(CodeIgniter\HTTP\Files\UploadedFile))
#5 /opt/castopod/modules/Admin/Controllers/EpisodeController.php(320): App\Entities\Episode->setCover(Object(CodeIgniter\HTTP\Files\UploadedFile))
#6 /opt/castopod/modules/Admin/Controllers/EpisodeController.php(61): Modules\Admin\Controllers\EpisodeController->attemptEdit()
#7 /opt/castopod/vendor/codeigniter4/framework/system/CodeIgniter.php(901): Modules\Admin\Controllers\EpisodeController->_remap('attemptEdit', '3', '17')
#8 /opt/castopod/vendor/codeigniter4/framework/system/CodeIgniter.php(457): CodeIgniter\CodeIgniter->runController(Object(Modules\Admin\Controllers\EpisodeController))
#9 /opt/castopod/vendor/codeigniter4/framework/system/CodeIgniter.php(340): CodeIgniter\CodeIgniter->handleRequest(NULL, Object(Config\Cache), false)
#10 /opt/castopod/public/index.php(73): CodeIgniter\CodeIgniter->run()
#11 {main}
Context
- Castopod: [which version (or branch, if applicable) the bug is in]
- OS: Debian
- Browser: Safari
- Web server: Nginx
- Docker installation