Hi,
I am using a docker installation in version 5.5.65
.
When I upload an image file, I get an error message saying:
ImageCodecException: Failed to detect image file format using the file header. File header was empty.
However, the image is uploaded correclty and is available via the download url. So I guess it is just missing the preview.
I then tried several other files. PDF, PNG, JPG, JPEG and SVG. This resulted in empty previews and it shows filesize: 0KB.
The Download URL does not work in this case and when I tried to delete these images, I received this error:
400: No query results for model [App\Models\Document].
What have I done wrong?
There is no error in the production log. The laravel log shows this error when trying to upload a file where the preview fails.
[2023-02-03 08:14:41] production.ERROR: file_get_contents(https://crm.ecomsilio.de/storage/bWzSb15UdCi27L95Z9g0lG3u1QO8NX3W/documents/ebUXk75gNjl4uNSlLgnYVD5qbvLngMreenYGvIBK.jpg): Failed to open stream: Connection refused {"userId":1,"exception":"[object] (ErrorException(code: 0): file_get_contents(https://crm.ecomsilio.de/storage/bWzSb15UdCi27L95Z9g0lG3u1QO8NX3W/documents/ebUXk75gNjl4uNSlLgnYVD5qbvLngMreenYGvIBK.jpg): Failed to open stream: Connection refused at /var/www/app/app/Http/Controllers/DocumentController.php:125)
[stacktrace]
#0 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(266): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError()
#1 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}()
#2 /var/www/app/app/Http/Controllers/DocumentController.php(125): file_get_contents()
#3 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(145): App\\Http\\Controllers\\DocumentController->App\\Http\\Controllers\\{closure}()
#4 /var/www/app/vendor/symfony/http-foundation/StreamedResponse.php(92): Illuminate\\Routing\\ResponseFactory->Illuminate\\Routing\\{closure}()
#5 /var/www/app/vendor/symfony/http-foundation/Response.php(377): Symfony\\Component\\HttpFoundation\\StreamedResponse->sendContent()
#6 /var/www/app/public/index.php(61): Symfony\\Component\\HttpFoundation\\Response->send()
#7 {main}
"}
These errors appear when a file is uploaded with 0KB filesize.
[2023-02-03 08:16:13] production.ERROR: file_get_contents(https://crm.ecomsilio.de/storage/bWzSb15UdCi27L95Z9g0lG3u1QO8NX3W/documents/qsk0nMLpfzRbpgE4x0Ow3V3b8v7s3QPpGfkMz51G.jpg): Failed to open stream: Connection refused {"userId":1,"exception":"[object] (ErrorException(code: 0): file_get_contents(https://crm.ecomsilio.de/storage/bWzSb15UdCi27L95Z9g0lG3u1QO8NX3W/documents/qsk0nMLpfzRbpgE4x0Ow3V3b8v7s3QPpGfkMz51G.jpg): Failed to open stream: Connection refused at /var/www/app/app/Http/Controllers/DocumentController.php:125)
[stacktrace]
#0 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(266): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError()
#1 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}()
#2 /var/www/app/app/Http/Controllers/DocumentController.php(125): file_get_contents()
#3 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(145): App\\Http\\Controllers\\DocumentController->App\\Http\\Controllers\\{closure}()
#4 /var/www/app/vendor/symfony/http-foundation/StreamedResponse.php(92): Illuminate\\Routing\\ResponseFactory->Illuminate\\Routing\\{closure}()
#5 /var/www/app/vendor/symfony/http-foundation/Response.php(377): Symfony\\Component\\HttpFoundation\\StreamedResponse->sendContent()
#6 /var/www/app/public/index.php(61): Symfony\\Component\\HttpFoundation\\Response->send()
#7 {main}
"}
[2023-02-03 08:16:13] production.ERROR: file_get_contents(https://crm.ecomsilio.de/storage/bWzSb15UdCi27L95Z9g0lG3u1QO8NX3W/documents/6lClNvCdlRZdnEDQZQ7CwERqfmDcKrm2F0xzc7NQ.jpg): Failed to open stream: Connection refused {"userId":1,"exception":"[object] (ErrorException(code: 0): file_get_contents(https://crm.ecomsilio.de/storage/bWzSb15UdCi27L95Z9g0lG3u1QO8NX3W/documents/6lClNvCdlRZdnEDQZQ7CwERqfmDcKrm2F0xzc7NQ.jpg): Failed to open stream: Connection refused at /var/www/app/app/Http/Controllers/DocumentController.php:125)
[stacktrace]
#0 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(266): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError()
#1 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}()
#2 /var/www/app/app/Http/Controllers/DocumentController.php(125): file_get_contents()
#3 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(145): App\\Http\\Controllers\\DocumentController->App\\Http\\Controllers\\{closure}()
#4 /var/www/app/vendor/symfony/http-foundation/StreamedResponse.php(92): Illuminate\\Routing\\ResponseFactory->Illuminate\\Routing\\{closure}()
#5 /var/www/app/vendor/symfony/http-foundation/Response.php(377): Symfony\\Component\\HttpFoundation\\StreamedResponse->sendContent()
#6 /var/www/app/public/index.php(61): Symfony\\Component\\HttpFoundation\\Response->send()
#7 {main}
"}
[2023-02-03 08:16:13] production.ERROR: file_get_contents(https://crm.ecomsilio.de/storage/bWzSb15UdCi27L95Z9g0lG3u1QO8NX3W/documents/ebUXk75gNjl4uNSlLgnYVD5qbvLngMreenYGvIBK.jpg): Failed to open stream: Connection refused {"userId":1,"exception":"[object] (ErrorException(code: 0): file_get_contents(https://crm.ecomsilio.de/storage/bWzSb15UdCi27L95Z9g0lG3u1QO8NX3W/documents/ebUXk75gNjl4uNSlLgnYVD5qbvLngMreenYGvIBK.jpg): Failed to open stream: Connection refused at /var/www/app/app/Http/Controllers/DocumentController.php:125)
[stacktrace]
#0 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(266): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError()
#1 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}()
#2 /var/www/app/app/Http/Controllers/DocumentController.php(125): file_get_contents()
#3 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(145): App\\Http\\Controllers\\DocumentController->App\\Http\\Controllers\\{closure}()
#4 /var/www/app/vendor/symfony/http-foundation/StreamedResponse.php(92): Illuminate\\Routing\\ResponseFactory->Illuminate\\Routing\\{closure}()
#5 /var/www/app/vendor/symfony/http-foundation/Response.php(377): Symfony\\Component\\HttpFoundation\\StreamedResponse->sendContent()
#6 /var/www/app/public/index.php(61): Symfony\\Component\\HttpFoundation\\Response->send()
#7 {main}
"}
[2023-02-03 08:16:13] production.ERROR: file_get_contents(https://crm.ecomsilio.de/storage/bWzSb15UdCi27L95Z9g0lG3u1QO8NX3W/documents/ROLpOUtluoXwPNAHi69bHUi5fXLFCLopjfzDl4Sw.png): Failed to open stream: Connection refused {"userId":1,"exception":"[object] (ErrorException(code: 0): file_get_contents(https://crm.ecomsilio.de/storage/bWzSb15UdCi27L95Z9g0lG3u1QO8NX3W/documents/ROLpOUtluoXwPNAHi69bHUi5fXLFCLopjfzDl4Sw.png): Failed to open stream: Connection refused at /var/www/app/app/Http/Controllers/DocumentController.php:125)
[stacktrace]
#0 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(266): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError()
#1 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}()
#2 /var/www/app/app/Http/Controllers/DocumentController.php(125): file_get_contents()
#3 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(145): App\\Http\\Controllers\\DocumentController->App\\Http\\Controllers\\{closure}()
#4 /var/www/app/vendor/symfony/http-foundation/StreamedResponse.php(92): Illuminate\\Routing\\ResponseFactory->Illuminate\\Routing\\{closure}()
#5 /var/www/app/vendor/symfony/http-foundation/Response.php(377): Symfony\\Component\\HttpFoundation\\StreamedResponse->sendContent()
#6 /var/www/app/public/index.php(61): Symfony\\Component\\HttpFoundation\\Response->send()
#7 {main}
"}
[2023-02-03 08:16:13] production.ERROR: file_get_contents(https://crm.ecomsilio.de/storage/bWzSb15UdCi27L95Z9g0lG3u1QO8NX3W/documents/LVOTLAIGfxyCQ09QNb1tBqAZvTIYJxCakLDP3J4l.png): Failed to open stream: Connection refused {"userId":1,"exception":"[object] (ErrorException(code: 0): file_get_contents(https://crm.ecomsilio.de/storage/bWzSb15UdCi27L95Z9g0lG3u1QO8NX3W/documents/LVOTLAIGfxyCQ09QNb1tBqAZvTIYJxCakLDP3J4l.png): Failed to open stream: Connection refused at /var/www/app/app/Http/Controllers/DocumentController.php:125)
[stacktrace]
#0 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(266): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError()
#1 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}()
#2 /var/www/app/app/Http/Controllers/DocumentController.php(125): file_get_contents()
#3 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(145): App\\Http\\Controllers\\DocumentController->App\\Http\\Controllers\\{closure}()
#4 /var/www/app/vendor/symfony/http-foundation/StreamedResponse.php(92): Illuminate\\Routing\\ResponseFactory->Illuminate\\Routing\\{closure}()
#5 /var/www/app/vendor/symfony/http-foundation/Response.php(377): Symfony\\Component\\HttpFoundation\\StreamedResponse->sendContent()
#6 /var/www/app/public/index.php(61): Symfony\\Component\\HttpFoundation\\Response->send()
#7 {main}
"}
There are no error when trying to delete a file, except from the error displayed in the app.
Many thanks,
Gijs