Skip to content

Log error when media generation fails #6875

Open
@andreasotto

Description

@andreasotto

Description

Failed generation of media image files, no log, no exception, no info (again, see previous discussions, closed as stale). The error handling still does not seem to be available at this point, because although no image could be created, the browser is redirected to a media URL that does not exist. This only leads to a 404 message from the web server. However, it would make sense in the code to go directly to an error handling routine at the point where no image could be created.

Where should I start looking for the error, since there is not a single information for me as a developer?

Expected behavior
As a developer, I expect an error message if images cannot be generated in the media folder so that I am able to solve the problem.
I also expect that if an error occurs, there is no redirect to a URL in the media folder, because there is no file there and it will inevitably lead to a 404 error. It would certainly be better to intercept the error and generate an error message for the operator. In addition, an error image could be displayed in the browser instead of an empty redirection to nowhere.
The error message could either be a log file with the error description on the server or a message in the HTTP response, which helps a developer to understand the error. At the moment I have no way of finding out. Do I have to start debugging the Kirby code installed via composer line by line with some print and echo statements? I hope there are other possibilities and am happy for hints.

Screenshots
d60b9186a73c17b02aa6ca20c6a78b0a694fb79a
588aebd8cc6a7da282ac0bca38694277beb3280c
eab6be671432330c789f2946d04db2b179e25afa

To reproduce

Upload an image, it gets already displayed broken in the panel, and thumb() function in frontend doesn't work also - broken images, because of redirect to not existing URL in media folder.

Your setup

Docker, php:8.3-apache
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp=/usr/include/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions