Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • Sign in / Register
Minds Backend - Engine
Minds Backend - Engine
  • Project overview
  • Repository
  • Issues 294
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 40
  • CI / CD
  • Security & Compliance
  • Packages
  • Wiki
  • Snippets
  • Members
  • Collapse sidebar
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Minds
  • Minds Backend - EngineMinds Backend - Engine
  • Issues
  • #1132

Closed
Open
Opened 2 weeks ago by Mark Edworthy@medworthy
Report abuse New issue

Possible issue with large image file sizes (specifically animated gifs)

Summary

Whilst viewing the following post (see below) I noticed that the included animated gif wasn't displaying (at the time of originally viewing this image, I was presented with a broken image icon and placeholder, which then was rendered to the Minds lightbulb image).

On further investigation, I found the following error:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 13989992 bytes) in /var/www/Minds/engine/Controllers/fs/v1/thumbnail.php on line 51

This error suggests that there is a maximum allowable image file size of 13.98MB (decimal - base 10 standard) / 13.34 MiB (IEC binary - base 2 standard). According to the above error, it seems that the original image has a file size that amounts to just over 134MB (128MiB).

Strangely, it seems that several other users can view the animated gif and there has only been one other user that has reported having a similar experience as myself (reported this issue within a comment which was added to the post).

So considering that this issue seems to be effecting only a minority of users, I am very intrigued and would like to gain a better understanding of what is causing this issue (I am wondering if this has something to do with either the end-users ISP provisions and / or Minds CDN provisions).

Steps to reproduce

If the image within the following post is not being displayed correctly then using Mozilla Firefox (or a Firefox derivative / Quantum rendering engine based browser) or Chromium (or Chromium derivative / Blink rendering engine based browser), view the resulting modal box (which should result in displaying the spinning "loading" wheel within the modal dialog box) then right click on the resulting rendering ("loading" image) and select the "view image" (Firefox) or "open image in new tab" (Chromium) menu item.

Platform information

Seems to be end-user platform neutral. Checked using x86_64bit versions of Mozilla Firefox (version 69.0.1 - Quantum rendering engine), Chromium (version 77.0.3865.90 - Blink rendering engine) and Midora (version 9.0 - Webkit rendering engine)

What is the current bug behavior?

See above

What is the expected correct behavior?

Animated Gif should be correctly displaying.

Relevant logs and/or screenshots

See above for error message.

Reference:

  • Original Post (also see the comments which I added within the @Perennial_Plant_YaMon / Tim Berrrrr comment thread)
    https://www.minds.com/newsfeed/1040311506174717952

  • Corresponding Media File
    https://www.minds.com/media/1033911929074921472

Edited 2 weeks ago by Mark Edworthy

Related issues
0

Related merge requests
1
  • Memory limit hit getting mime type / Gif upload broken
    !397
  • Discussion 9
  • Designs 0
  • Mark Edworthy @medworthy changed the description 2 weeks ago

    changed the description

  • Mark Edworthy @medworthy changed the description 2 weeks ago

    changed the description

  • Nicholas Lewis @javanick added Priority::2 - Normal Product::Media Type::Bug (Triage) scoped labels 2 weeks ago

    added scoped labels

  • Ben Hayward @benhayward.ben added Product::Pro Type::Bug scoped labels and automatically removed Product::Media Type::Bug (Triage) labels 2 weeks ago

    added scoped labels and automatically removed labels

  • Adrian Hernandez
    Adrian Hernandez :cactus: @unlixghost · 2 weeks ago

    I am encountering the same issue.

    Device: Note 10+ Browser: Chrome 78.0.3904.96

    Placeholder is Minds Lightbulb, however drilling into the actual post it's just a black overlay.

  • Ben Hayward
    Ben Hayward @benhayward.ben · 2 weeks ago
    Developer

    Should have been fixed with #1120 (closed)

    Can you guys try Canary later today?

  • Ben Hayward
    Ben Hayward @benhayward.ben · 2 weeks ago
    Developer

    And / or !397 (merged)

  • Mark Edworthy
    Mark Edworthy @medworthy · 4 days ago

    @benhayward.ben,
    The animated GIF image that I referenced above is now being displayed within similar conditions as was used within my previous investigation, therefore I am closing this ticket.

    Edited by Mark Edworthy 4 days ago
  • Mark Edworthy @medworthy closed 4 days ago

    closed

  • Mark Edworthy @medworthy reopened 3 days ago

    reopened

  • Mark Edworthy
    Mark Edworthy @medworthy · 3 days ago

    @benhayward.ben,
    After testing this out with the following image that @luculent provided (which is an animated GIF that equates to 39.91MiB / 41.84MB), I noticed that whilst the file is uploading, the cached version is displayed but when completed, the image disappears and results with the file not being attached to the corresponding post (I have tested this via the same versions of Firefox and Chromium that I mentioned within this ticket's body).

    Considering this issue, I have reopened this ticket and the issue needs further examining.Also due to the size restrictions that are imposed by Gitlab's issue section (which allows a maximum of 10MiB), I am providing a URL to the image file (plus a compressed .tar.gz which also contain the image file) for further testing purposes (btw, I tried compressing the file for the purpose of uploading to Gitlab using several compression techniques but due to the fact that the image file is fairly well optimised already, it wasn't compressing to a that much of a suitable size).

    Reference:

    • https://www.mcosi.org/cloud/index.php/s/long-pour-final
    Edited by Mark Edworthy 1 day ago
  • Mark Edworthy @medworthy mentioned in issue minds#913 (closed) 3 days ago

    mentioned in issue minds#913 (closed)

  • Ben Hayward
    Ben Hayward @benhayward.ben · 1 day ago
    Developer

    @gthouret is this related to the above merge requests?

  • Guy Thouret
    Guy Thouret @gthouret · 43 minutes ago
    Developer

    The root cause is us passing the entire contents of the media file as a var instead of passing a file handle. This runs through multiple call layers so not a straightforward fix.

    The specific case of hitting process memory limit in the issue description has been resolved by only passing the file header to finfo not the entire file contents.

    After I fixed that I was able to upload files in excess of 100M without getting that error.

  • Guy Thouret
    Guy Thouret @gthouret · 41 minutes ago
    Developer

    If this is a live issue still you should be able to pull the logs for the failure.

  • Guy Thouret
    Guy Thouret @gthouret · 36 minutes ago
    Developer

    The only other upload related issue I know of is hard memory limits on the containers. PHP uploads files to /tmp which by default is tmpfs in our containers - i.e. memory. An image upload generates two copies of an image in /tmp. Only when the HTTP request ends does the PHP process clean these up.

    If something happens and that process can not clean up (i.e. SIGKILL because we hit the hard limit) those tmp files get left, increasing the likelihood that the next file upload request will also received a SIGKILL compounding the issue.

Please register or sign in to reply
0 Assignees
None
none
Epic
None
None
Milestone
None
Time tracking
No estimate or time spent
None
Due date
None
3
Labels
Priority::2 - Normal Product::Pro Type::Bug
None
Weight
None
Confidentiality
Not confidential
Lock issue
Unlocked
5
5 participants
user avatar
Guy Thouret
user avatar
Mark Edworthy
user avatar
Ben Hayward
user avatar
Adrian Hernandez
user avatar
Luculent
Reference: minds/engine#1132