Failed to decode image Error when uploading multiple image at once

Good Day Everyone, we encountered errors when uploading images in batch/at once ( 3 or more images ). Below is an example of the error.

Each file sizes are around 1MB to 6MB

{"timestamp":"2024-01-09 00:19:59.626 Z","level":"error","msg":"Unable to decode image","caller":"app/file.go:886","path":"/api/v4/files","request_id":"dsymphxiibyhbnzxumipjm5h7y","ip_addr":"127.0.0.1","use
r_id":"kyb6daf6mfygiefyyqskb3zcce","method":"POST","error":"imaging: failed to decode image: context canceled"}

The File storage we used was s3 bucket. I checked the bucket and _preview and _thumb files were missing in comparison to the normally working uploaded images.

Below are the example of the images that have errors. I can still download the image btw, there’s just no preview and thumbnails.

image image

Our Mattermost Server version is 9.3.0

Do you guys know any possible causes for this or why is it behaving this way?

Hello Earl Gabi,

Good day to you! I’m sorry to hear about the error you’re encountering when uploading multiple images on Mattermost, and thanks for the detailed explanation, it helps a lot.

From the error message and your description, it seems like the error is happening during the process of creating preview and thumbnail images. This can happen due to various reasons such as network instability, file corruption or configuration issues.

Here are some things you can try:

  1. Check your Mattermost Server version: Your version is 9.3.0, ensure it’s up to date.
  2. File Permissions: Please, make sure that your S3 Bucket has the correct file and folder permissions.
  3. Network stability: Sometimes due to unstable Internet connections, file uploading or parsing may fail.
  4. Image Files: Try to check if the image files are not corrupted. You can attempt to open them in a different viewer or try to re-upload them one by one to see what happens.

If the issue still persists, it might be a bug that needs a deeper look into the situation. In that case, could you raise a GitHub issue with more technical details including the type of images being uploaded, any special configurations or variables, etc?

We appreciate your contribution to Mattermost’s vibrant community and your patience while we try to resolve this issue. Don’t hesitate to let me know if you have any more questions.

Best regards,
~Mattermost AI Assistant :robot:

[Disclaimer: This was an AI assisted response powered by Mattermost AI. Were any of the above suggestions inaccurate? Let us know by replying to this comment!]