Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-21360

eZFS2: binary images/files not deleted when object is removed

    Details

      Description

      After removing objects with images (ezimage) or files (ezbinaryfile) the source files are not removed from var/storage.

      • create a new image 'yourimage'
      • check that the file(s) exist in /var/storage/images/ <path/> yourimage
      • delete the image object in admin (do not move to trash)
        Result:
      • the object is deleted, the files are still present on disk

        Issue Links

          Activity

          Joao Inacio (Inactive) created issue -
          Joao Inacio (Inactive) made changes -
          Field Original Value New Value
          Link This issue relates to EZP-16800 [ EZP-16800 ]
          Joao Inacio (Inactive) made changes -
          Status Open [ 1 ] Confirmed [ 10037 ]
          Joao Inacio (Inactive) made changes -
          Issue Type Improvement [ 4 ] Bug [ 1 ]
          Gunnstein Lye made changes -
          Status Confirmed [ 10037 ] InputQ [ 10001 ]
          Hide
          Bertrand Dunogier added a comment -

          The problem here is that we can't use the approach we use in DB/DFS (they rely on a select query with a mix of scope and modification time), since we don't have an indexed list of clustered files + metadata.

          I am going to create a pull request based on Felix's patch.

          Show
          Bertrand Dunogier added a comment - The problem here is that we can't use the approach we use in DB/DFS (they rely on a select query with a mix of scope and modification time), since we don't have an indexed list of clustered files + metadata. I am going to create a pull request based on Felix's patch.
          Bertrand Dunogier logged work - 19/Aug/13 5:38 PM
          • Time Spent:
            3 hours
             
            <No comment>
          Hide
          Bertrand Dunogier added a comment -

          Pull request on ezpublish-legacy-ee: https://github.com/ezsystems/ezpublish-legacy-ee/pull/24.

          Show
          Bertrand Dunogier added a comment - Pull request on ezpublish-legacy-ee: https://github.com/ezsystems/ezpublish-legacy-ee/pull/24 .
          Bertrand Dunogier made changes -
          Remote Link This issue links to "PR (Web Link)" [ 12143 ]
          Bertrand Dunogier made changes -
          Status InputQ [ 10001 ] Development [ 3 ]
          Assignee Bertrand Dunogier [ bertrand.dunogier@ez.no ]
          Bertrand Dunogier made changes -
          Remaining Estimate 0 minutes [ 0 ]
          Time Spent 3 hours [ 10800 ]
          Worklog Id 38137 [ 38137 ]
          Bertrand Dunogier made changes -
          Status Development [ 3 ] Development review [ 10006 ]
          Bertrand Dunogier logged work - 20/Aug/13 10:14 AM
          • Time Spent:
            30 minutes
             

            Merged to stable-4.7: https://github.com/ezsystems/ezpublish-legacy-ee/commit/27b32c5f95c66446262f639a1f2abcca5ac24b22 (doesn't apply to master since FS2 has been removed in 5.0).

            Can be backported to all 4.x branches if required.

            Cleaning up expired files

            Existing files are not removed by this patch. The easiest, and tested, way to do so is to find files modified on 1977-05-26 00:00. Using GNU find, it would work like this:

            find var/*/storage/{original,images} -newermt "1977-05-25 00:00" ! -newermt "1977-05-26 00:01" -delete

          Hide
          Bertrand Dunogier added a comment - - edited

          Merged to stable-4.7: https://github.com/ezsystems/ezpublish-legacy-ee/commit/27b32c5f95c66446262f639a1f2abcca5ac24b22 (doesn't apply to master since FS2 has been removed in 5.0).

          Can be backported to all 4.x branches if required.

          Cleaning up expired files

          Existing files are not removed by this patch. The easiest, and tested, way to do so is to find files modified on 1977-05-26 00:00. Using GNU find, it would work like this:

          find var/*/storage/{original,images} -newermt "1977-05-25 00:00" ! -newermt "1977-05-26 00:01" -delete

          Show
          Bertrand Dunogier added a comment - - edited Merged to stable-4.7: https://github.com/ezsystems/ezpublish-legacy-ee/commit/27b32c5f95c66446262f639a1f2abcca5ac24b22 (doesn't apply to master since FS2 has been removed in 5.0). Can be backported to all 4.x branches if required. Cleaning up expired files Existing files are not removed by this patch. The easiest, and tested, way to do so is to find files modified on 1977-05-26 00:00. Using GNU find, it would work like this: find var/*/storage/{original,images} -newermt "1977-05-25 00:00" ! -newermt "1977-05-26 00:01" -delete
          Bertrand Dunogier made changes -
          Time Spent 3 hours [ 10800 ] 3 hours, 30 minutes [ 12600 ]
          Worklog Id 38176 [ 38176 ]
          Bertrand Dunogier made changes -
          Status Development review [ 10006 ] Development Review done [ 10028 ]
          Fix Version/s 4.7 Maintenance [ 12583 ]
          Bertrand Dunogier made changes -
          Status Development Review done [ 10028 ] Documentation done [ 10011 ]
          Pedro Resende (Inactive) logged work - 22/Aug/13 10:04 AM - edited
          • Time Spent:
            30 minutes
             

            Worked on story

          Pedro Resende (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Assignee Bertrand Dunogier [ bertrand.dunogier@ez.no ] Pedro Resende [ pedro.resende@ez.no ]
          Pedro Resende (Inactive) made changes -
          Time Spent 3 hours, 30 minutes [ 12600 ] 4 hours [ 14400 ]
          Worklog Id 38242 [ 38242 ]
          Pedro Resende (Inactive) made changes -
          Worklog Id 38242 [ 38242 ]
          Pedro Resende (Inactive) made changes -
          Status QA [ 10008 ] InputQ [ 10001 ]
          Assignee Pedro Resende [ pedro.resende@ez.no ]
          Hide
          Bertrand Dunogier added a comment - - edited

          In order to cleanup existing folders, use this: find var/*/storage -type d -depth | xargs rmdir --ignore-fail-on-non-empty

          I'll look into deletion from the code itself.

          Show
          Bertrand Dunogier added a comment - - edited In order to cleanup existing folders, use this: find var/*/storage -type d -depth | xargs rmdir --ignore-fail-on-non-empty I'll look into deletion from the code itself.
          Hide
          Bertrand Dunogier added a comment - - edited

          New pull request that takes care of empty directories: https://github.com/ezsystems/ezpublish-legacy-ee/pull/26

          Show
          Bertrand Dunogier added a comment - - edited New pull request that takes care of empty directories: https://github.com/ezsystems/ezpublish-legacy-ee/pull/26
          Bertrand Dunogier made changes -
          Remote Link This issue links to "PR #24 (Web Link)" [ 12204 ]
          Bertrand Dunogier logged work - 23/Aug/13 2:22 PM
          • Time Spent:
            2 hours
             
            <No comment>
          Bertrand Dunogier made changes -
          Status InputQ [ 10001 ] Development [ 3 ]
          Assignee Bertrand Dunogier [ bertrand.dunogier@ez.no ]
          Bertrand Dunogier made changes -
          Time Spent 4 hours [ 14400 ] 6 hours [ 21600 ]
          Worklog Id 38253 [ 38253 ]
          Bertrand Dunogier made changes -
          Status Development [ 3 ] Development review [ 10006 ]
          Pedro Resende (Inactive) made changes -
          Time Spent 6 hours [ 21600 ] 1 day, 30 minutes [ 30600 ]
          Worklog Id 38303 [ 38303 ]
          Pedro Resende (Inactive) logged work - 23/Aug/13 5:53 PM
          • Time Spent:
            2 hours, 30 minutes
             

            Worked on story

          Bertrand Dunogier made changes -
          Status Development review [ 10006 ] Development Review done [ 10028 ]
          Bertrand Dunogier made changes -
          Status Development Review done [ 10028 ] Documentation done [ 10011 ]
          Pedro Resende (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Assignee Bertrand Dunogier [ bertrand.dunogier@ez.no ] Pedro Resende [ pedro.resende@ez.no ]
          Pedro Resende (Inactive) made changes -
          Time Spent 1 day, 30 minutes [ 30600 ] 1 day, 1 hour, 30 minutes [ 34200 ]
          Worklog Id 38361 [ 38361 ]
          Pedro Resende (Inactive) made changes -
          Assignee Pedro Resende [ pedro.resende@ez.no ]
          Status QA [ 10008 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Pedro Resende (Inactive) logged work - 26/Aug/13 6:07 PM
          • Time Spent:
            1 hour
             

            Analyse and reproduce issue, write test case and verify the issue has been fixed.

          André Rømcke made changes -
          Workflow eZ Engineering Scrumban Workflow [ 57190 ] EZ* Development Workflow [ 84105 ]
          Alex Schuster made changes -
          Workflow EZ* Development Workflow [ 84105 ] EZEE Development Workflow [ 122741 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Confirmed Confirmed
          26m 18s 1 joao.inacio@ez.no 29/Jul/13 11:44 PM
          Confirmed Confirmed InputQ InputQ
          1d 12h 19m 1 Gunnstein Lye 31/Jul/13 12:04 PM
          QA QA InputQ InputQ
          17h 50m 1 pedro.resende@ez.no 23/Aug/13 11:15 AM
          InputQ InputQ Development Development
          19d 8h 40m 2 Bertrand Dunogier 23/Aug/13 2:22 PM
          Development Development Development Review Development Review
          31s 2 Bertrand Dunogier 23/Aug/13 2:22 PM
          Development Review Development Review Development Review done Development Review done
          3d 17h 39m 2 Bertrand Dunogier 26/Aug/13 3:26 PM
          Development Review done Development Review done Documentation Review done Documentation Review done
          1d 17m 2 Bertrand Dunogier 26/Aug/13 3:44 PM
          Documentation Review done Documentation Review done QA QA
          1d 7h 41m 2 pedro.resende@ez.no 26/Aug/13 4:13 PM
          QA QA Closed Closed
          54m 6s 1 pedro.resende@ez.no 26/Aug/13 5:08 PM

            People

            • Assignee:
              Unassigned
              Reporter:
              Joao Inacio (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 1 hour, 30 minutes
                1d 1h 30m