Skip to content

[3.0] Better error handling needed for failed image re-encode operations #8707

@mwegithub

Description

@mwegithub

Basic Information

I'm using a plain vanilla SMF 2.15 without any plug-ins or custom themes. It runs on Linux with PHP 8.4 and FastCGI enabled.

I've upgraded from the 2.14 to the 2.15 release yesterday. Immediately, the error log started to fill up.

I could fix the issue causing hundreds of log entries about $id being undefined in QueryString.php myself (there is already a pull request from another user for this). Also fixed it in Subs.php.

Now I have several hundred other log file entries (in a low-volume community) like this:

Bogus marker length `/www/htdocs/w0181784/example.com/community/attachments/13876_85d5997b92bca48be9188ac930fa3f11b9051feb.dat_thumb.tmp' @ error/jpeg.c/JPEGErrorHandler/339

coming from

/www/htdocs/w0181784/example.com/community/Sources/Subs-Graphics.php, line 503.

It seems every time ImageMagick is initialized with a temporary JPG SMF creates (?) it logs this entry. Is this a known issue? Can this be caused by the ImageMagick version my hoster has installed? I'm not sure where to start looking.

Another repeating error message I get with 2.15 but had never before is:

Unable to verify referring URL. Please go back and try again.

The backtrace shows:

https://www.example.com/community/index.php?action=likes;sa=view;ltype=msg;like=96800;a38606a896d=a8c260d8069ebb30c4224b32ff64b5f8

    Called from /www/htdocs/w0181784/example.com/community/Sources/Security.php on line 710
    #1: checkSession()
    Called from /www/htdocs/w0181784/example.com/community/Sources/Likes.php on line 152
    #2: call()
    Called from /www/htdocs/w0181784/example.com/community/index.php on line 185

I recall some PHP from older projects, but I don't know enough about SMF to figuring out why these new errors show up so often with the 2.15 release.

Steps to reproduce

  1. Just let the community run for a while and observe the log file.

Expected result

None of these error log entries should show. They did not with the 2.14 release.

Actual result

No response

Version/Git revision

2.15 from June 26.

Database Engine

All

Database Version

No response

PHP Version

No response

Logs

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions