Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • Sign in / Register
Minds Backend - Engine
Minds Backend - Engine
  • Project overview
  • Repository
  • Issues 299
  • Merge Requests 39
  • 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
  • Merge Requests
  • !397

Merged
Opened 4 days ago by Guy Thouret@gthouret
Report abuse

Memory limit hit getting mime type / Gif upload broken

We have been getting OOM messages from finfo calls that get the mime type from a file buffer. See #1120 for full details.

This MR touches a number of different API endpoints for fetching and also changes the S3 Service write method so affects any media file upload.

/api/fs/v1/avatars

/api/fs/v1/banners

/api/fs/v1/paywall

/api/fs/v1/thumbnail <- This was producing the most errors given the number of times it gets hit

Some steps for reproduction:

  1. Try to post a media file that exceeds 13M in size to the nesfeed.
  2. POST /api/v1/media request will return a 200 OK status with Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 146703512 bytes) in /var/www/Minds/engine/Core/Storage/Services/S3.php on line 67 as the response

When this gets to staging, accessing the following URL should be successful, currently fails in production: https://www.minds.com/fs/v1/thumbnail/1026508015016828928/xlarge

Edited 2 days ago by Guy Thouret
Request to merge fix/1120-thumbnail-oom into master
Pipeline #96189482 passed for d99e67aa on fix/1120-thumbnail-oom
          Merge request approved. Approved by
          Mark Harding
          Mark Harding
          Olivia Madrid
          Olivia Madrid
          Emiliano Balbuena
          Emiliano Balbuena
          Ben Hayward
          Ben Hayward
          Marcelo Rivera
          Marcelo Rivera
          Rami Albatal
          Rami Albatal

          Merged by Mark Harding 23 minutes ago

          The changes were merged into master with 7a379e7d

          The source branch has been deleted

          Mentions #1120

          Pipeline #96621644 waiting for manual action for 7a379e7d on master
                        • Discussion 0
                        • Commits 7
                        • Pipelines 4
                        • Changes 9
                        • Guy Thouret @gthouret added MR::Awaiting Review Priority::1 - High Regression::Production Squad::Blue scoped labels 4 days ago

                          added scoped labels

                        • Guy Thouret @gthouret added 1 commit 4 days ago

                          added 1 commit

                          • f8fddc82 - (chore) Lint new File class - #1120

                          Compare with previous version

                        • Guy Thouret @gthouret marked as a Work In Progress 4 days ago

                          marked as a Work In Progress

                        • Guy Thouret @gthouret changed the description 4 days ago

                          changed the description

                        • Guy Thouret @gthouret added 1 commit 4 days ago

                          added 1 commit

                          • af223984 - (chore) Move File from Core to Helpers namespace - #1120

                          Compare with previous version

                        • Guy Thouret @gthouret added 2 commits 2 days ago

                          added 2 commits

                          • 1c80f2d0 - (fix) Unset handle (S3Client object) when serialize is called on ElggFile as...
                          • d99e67aa - (fix) Trim leading slash from filename in Media\Assets\Image::upload method - #1120

                          Compare with previous version

                        • Guy Thouret @gthouret unmarked as a Work In Progress 2 days ago

                          unmarked as a Work In Progress

                        • Guy Thouret @gthouret changed title from WIP: Memory efficient method of getting Mime Types to Memory limit hit getting mime type / Gif upload broken 2 days ago

                          changed title from to

                        • Ben Hayward @benhayward.ben mentioned in issue minds#920 (closed) 13 hours ago

                          mentioned in issue minds#920 (closed)

                        • Mark Harding @markeharding approved this merge request 24 minutes ago

                          approved this merge request

                        • Mark Harding @markeharding merged 23 minutes ago

                          merged

                        • Mark Harding @markeharding mentioned in commit 7a379e7d 23 minutes ago

                          mentioned in commit 7a379e7d

                        Please register or sign in to reply
                        0 Assignees
                        None
                        None
                        Milestone
                        None
                        Time tracking
                        No estimate or time spent
                        4
                        Labels
                        MR::Awaiting Review Priority::1 - High Regression::Production Squad::Blue
                        Lock merge request
                        Unlocked
                        10
                        10 participants
                        user avatar
                        Olivia Madrid
                        user avatar
                        Emiliano Balbuena
                        user avatar
                        Ben Hayward
                        user avatar
                        Marcelo Rivera
                        user avatar
                        Rami Albatal
                        user avatar
                        Martin Santangelo
                        user avatar
                        Brian Hatchet
                        Reference: minds/engine!397