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

Fatal errors on Windows stash fails with mkdir(): Invalid path

    Details

    • Sprint:
      Ventoux Sprint 3

      Description

      Cache paths generated by eZ Publish needs to be shorter for UserHandler::loadRoleAssignmentsByGroupId().

      The path generated by stash is too long for windows systems. Windows is of course not a target plattform, but this is one blockers why eZ is not running von windows.

      <?php
      // Warning: vendor/tedivm/stash/src/Stash/Driver/FileSystem.php line 186 - mkdir(): Invalid path

      // Test path exists, works
      mkdir( 'C:/workspace/ez5/ezpublish-community/ezpublish/cache/prod/stash/0fea6a13c52b4d47/25368f24b045ca84/a1e4f174919d040af6d06113d677c9e0/ee11cbb19052e40b/07aac0ca060c23ee/29a7e96467b69a9f/5a93332e29e9b0de/17b32329e5419153/7595822b7b2794a3', 0777, true);

      // Invalid, but real eZ Publish cache path, too long doesn`t work
      mkdir( 'C:/workspace/ez5/ezpublish-community/ezpublish/cache/prod/stash/0fea6a13c52b4d47/25368f24b045ca84/a1e4f174919d040af6d06113d677c9e0/ee11cbb19052e40b/07aac0ca060c23ee/29a7e96467b69a9f/5a93332e29e9b0de/17b32329e5419153/7595822b7b2794a3/a8b43746d096f4c3/7974afede1b81dcb/f3b050372bef406e', 0777, true);

        Issue Links

          Activity

          Björn Dieding@xrow.de created issue -
          Gaetano Giunta (Inactive) made changes -
          Field Original Value New Value
          Link This issue is duplicated by EZP-20967 [ EZP-20967 ]
          Hide
          André Rømcke added a comment -

          For some more info, see #EZP-20967

          Show
          André Rømcke added a comment - For some more info, see # EZP-20967
          André Rømcke made changes -
          Summary vendor/tedivm/stash/src/Stash/Driver/FileSystem.php line 186 - mkdir(): Invalid path Fatal errors on Windows stash fails with mkdir(): Invalid path
          André Rømcke made changes -
          Status Open [ 1 ] Backlog [ 10000 ]
          André Rømcke made changes -
          Link This issue is duplicated by EZP-20875 [ EZP-20875 ]
          Hide
          Elie Theocari added a comment - - edited

          Hi,

          Where I work, we work on Windows environments. We encountered the same issue and this took us time to find a workaround.

          For anyone in the same situation : Stash allows you to define the path where you want the cache files to be generated.

          stash:
              caches:
                  default:
                      handlers:
                          - FileSystem
                      inMemory: true
                      registerDoctrineAdapter: false
                      FileSystem:
                          path: 'D:\stash'
          

          This is a bit dirty, but it works, as long as it is not longer than 260 characters.

          Elie

          Show
          Elie Theocari added a comment - - edited Hi, Where I work, we work on Windows environments. We encountered the same issue and this took us time to find a workaround. For anyone in the same situation : Stash allows you to define the path where you want the cache files to be generated. stash: caches: default: handlers: - FileSystem inMemory: true registerDoctrineAdapter: false FileSystem: path: 'D:\stash' This is a bit dirty, but it works, as long as it is not longer than 260 characters. Elie
          Hide
          Robert Hafner added a comment - - edited

          Stash author here. One of the reasons the paths are long is that we simply md5 the keys to make unique paths that are sanitized really quickly. However, the algorithm used for creating those paths configurable exactly for this reason (literally, the pull request we got for it was part of our big windows push a year ago).

          Here's the configuration from above with the changed hash. This should drop the size of the paths by almost three quarters (there's an odd bit in there that throws it off). This configuration is only recommended for Windows users, but does solve this problem.

          stash:
              caches:
                  default:
                      handlers:
                          - FileSystem
                      inMemory: true
                      registerDoctrineAdapter: false
                      FileSystem:
                          keyHashFunction: 'crc32'
          

          Show
          Robert Hafner added a comment - - edited Stash author here. One of the reasons the paths are long is that we simply md5 the keys to make unique paths that are sanitized really quickly. However, the algorithm used for creating those paths configurable exactly for this reason (literally, the pull request we got for it was part of our big windows push a year ago). Here's the configuration from above with the changed hash. This should drop the size of the paths by almost three quarters (there's an odd bit in there that throws it off). This configuration is only recommended for Windows users, but does solve this problem. stash: caches: default: handlers: - FileSystem inMemory: true registerDoctrineAdapter: false FileSystem: keyHashFunction: 'crc32'
          Jérôme Vieilledent (Inactive) made changes -
          Priority Blocker [ 1 ] High [ 3 ]
          Component/s Caching [ 10786 ]
          Component/s Documentation [ 10793 ]
          Hide
          André Rømcke added a comment -

          Thanks Robert, we will attempt to update our doc to reflect this.

          Show
          André Rømcke added a comment - Thanks Robert, we will attempt to update our doc to reflect this.
          André Rømcke made changes -
          Rank Ranked higher
          André Rømcke made changes -
          Remaining Estimate 2 hours [ 7200 ]
          André Rømcke made changes -
          Original Estimate 2 hours [ 7200 ]
          André Rømcke made changes -
          Rank Ranked higher
          André Rømcke made changes -
          Sprint Ventoux Sprint 3 [ 24 ]
          André Rømcke made changes -
          Rank Ranked higher
          André Rømcke made changes -
          Rank Ranked higher
          André Rømcke made changes -
          Status Backlog [ 10000 ] InputQ [ 10001 ]
          André Rømcke made changes -
          Assignee Sarah Haïm-Lubczanski [ sahra.haim-lubczanski@ez.no ]
          Show
          Sarah Haïm-Lubczanski (Inactive) added a comment - - edited I updated the documentation for : 5.1 and further versions (re-using your samples and some of your words, thank you). https://confluence.ez.no/display/EZP/Persistence+cache+configuration#Persistencecacheconfiguration-FileSystem https://confluence.ez.no/display/EZP52/Persistence+cache+configuration#Persistencecacheconfiguration-FileSystem https://confluence.ez.no/display/EZP51/Persistence+cache+configuration#Persistencecacheconfiguration-FileSystem
          Sarah Haïm-Lubczanski (Inactive) made changes -
          Assignee sahra.haim-lubczanski@ez.no Sarah Haïm-Lubczanski [ sarah.haim-lubczanski@ez.no ]
          Sarah Haïm-Lubczanski (Inactive) made changes -
          Status InputQ [ 10001 ] Documentation [ 10010 ]
          Sarah Haïm-Lubczanski (Inactive) made changes -
          Remaining Estimate 2 hours [ 7200 ] 0 minutes [ 0 ]
          Time Spent 4 hours [ 14400 ]
          Worklog Id 44979 [ 44979 ]
          Sarah Haïm-Lubczanski (Inactive) made changes -
          Status Documentation [ 10010 ] Documentation done [ 10011 ]
          Affects Version/s 5.2 [ 12582 ]
          Affects Version/s 5.1 [ 11280 ]
          Affects Version/s Future [ 11071 ]
          Sarah Haïm-Lubczanski (Inactive) made changes -
          Status Documentation done [ 10011 ] Documentation [ 10010 ]
          Sarah Haïm-Lubczanski (Inactive) made changes -
          Status Documentation [ 10010 ] Documentation done [ 10011 ]
          Joao Pingo (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Assignee Sarah Haïm-Lubczanski [ sarah.haim-lubczanski@ez.no ] Joao Pingo [ joao.pingo@ez.no ]
          Hide
          Robert Hafner added a comment -

          Glad I could help!

          Show
          Robert Hafner added a comment - Glad I could help!
          Joao Pingo (Inactive) made changes -
          Status QA [ 10008 ] Development Acceptance Done [ 10030 ]
          Joao Pingo (Inactive) made changes -
          Status Development Acceptance Done [ 10030 ] Documentation [ 10010 ]
          Joao Pingo (Inactive) made changes -
          Status Documentation [ 10010 ] Documentation done [ 10011 ]
          Joao Pingo (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Joao Pingo (Inactive) made changes -
          Status QA [ 10008 ] InputQ [ 10001 ]
          Assignee Joao Pingo [ joao.pingo@ez.no ]
          Hide
          Joao Pingo (Inactive) added a comment - - edited

          @Dev
          This setting ( FileSystem: keyHashFunction ) is not available in our version of the stash bundle ( 0.2.* )
          This is implemented in ( 0.3.*) version so for this to work we need to update composer.json for ezpublish installation

          Show
          Joao Pingo (Inactive) added a comment - - edited @Dev This setting ( FileSystem: keyHashFunction ) is not available in our version of the stash bundle ( 0.2.* ) This is implemented in ( 0.3.*) version so for this to work we need to update composer.json for ezpublish installation
          Joao Pingo (Inactive) logged work - 22/Jan/14 3:51 PM
          • Time Spent:
            5 hours, 30 minutes
             

            Testing

          Joao Pingo (Inactive) made changes -
          Time Spent 4 hours [ 14400 ] 1 day, 1 hour, 30 minutes [ 34200 ]
          Worklog Id 45010 [ 45010 ]
          Gaetano Giunta (Inactive) made changes -
          Link This issue is duplicated by EZP-20875 [ EZP-20875 ]
          Gaetano Giunta (Inactive) made changes -
          Link This issue is duplicated by EZP-21950 [ EZP-21950 ]
          Yannick Roger (Inactive) made changes -
          Link This issue relates to EZP-22415 [ EZP-22415 ]
          Jérôme Vieilledent (Inactive) made changes -
          Status InputQ [ 10001 ] Development [ 3 ]
          Assignee Jérôme Vieilledent [ jerome.vieilledent@ez.no ]
          Jérôme Vieilledent (Inactive) made changes -
          Status Development [ 3 ] Documentation done [ 10011 ]
          Affects Version/s 2014.01 [ 12882 ]
          Affects Version/s Future [ 11071 ]
          Fix Version/s 5.3 [ 11282 ]
          Fix Version/s 5.1 Maintenance [ 12301 ]
          Fix Version/s 5.2 Maintenance [ 12782 ]
          Fix Version/s 2014.03 [ 13281 ]
          Jérôme Vieilledent (Inactive) made changes -
          Status Documentation done [ 10011 ] Documentation [ 10010 ]
          Jérôme Vieilledent (Inactive) made changes -
          Status Documentation [ 10010 ] InputQ [ 10001 ]
          Assignee Jérôme Vieilledent [ jerome.vieilledent@ez.no ]
          Jérôme Vieilledent (Inactive) made changes -
          Status InputQ [ 10001 ] Development [ 3 ]
          Assignee Jérôme Vieilledent [ jerome.vieilledent@ez.no ]
          Jérôme Vieilledent (Inactive) made changes -
          Comment [ A comment with security level 'Employees' was removed. ]
          Hide
          Jérôme Vieilledent (Inactive) added a comment -

          @all: See EZP-22415 for Stash upgrade

          Show
          Jérôme Vieilledent (Inactive) added a comment - @all: See EZP-22415 for Stash upgrade
          Jérôme Vieilledent (Inactive) made changes -
          Status Development [ 3 ] Documentation done [ 10011 ]
          Joao Pingo (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Assignee Jérôme Vieilledent [ jerome.vieilledent@ez.no ] Joao Pingo [ joao.pingo@ez.no ]
          Joao Pingo (Inactive) made changes -
          Rank Ranked lower
          Joao Pingo (Inactive) logged work - 11/Mar/14 4:28 PM
          • Time Spent:
            7 hours
             

            Closed

          Joao Pingo (Inactive) made changes -
          Assignee Joao Pingo [ joao.pingo@ez.no ]
          Status QA [ 10008 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Joao Pingo (Inactive) made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Joao Pingo (Inactive) made changes -
          Time Spent 1 day, 1 hour, 30 minutes [ 34200 ] 2 days, 30 minutes [ 59400 ]
          Worklog Id 46312 [ 46312 ]
          Joao Pingo (Inactive) made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          André Rømcke made changes -
          Workflow eZ Engineering Scrumban Workflow [ 55734 ] EZ* Development Workflow [ 83845 ]
          Alex Schuster made changes -
          Workflow EZ* Development Workflow [ 83845 ] EZEE Development Workflow [ 122465 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Backlog Backlog
          8d 22h 42m 1 André Rømcke 05/Jun/13 9:52 AM
          Backlog Backlog InputQ InputQ
          225d 7h 19m 1 André Rømcke 16/Jan/14 4:11 PM
          InputQ InputQ Documentation Documentation
          4d 18h 43m 1 sarah.haim-lubczanski@ez.no 21/Jan/14 10:54 AM
          QA QA Removed Status Removed Status
          5h 9m 1 Joao Pingo (Inactive) 22/Jan/14 3:09 PM
          Removed Status Removed Status Documentation Documentation
          37m 32s 1 Joao Pingo (Inactive) 22/Jan/14 3:47 PM
          Documentation Documentation Documentation Review done Documentation Review done
          22h 43m 3 Joao Pingo (Inactive) 22/Jan/14 3:47 PM
          QA QA InputQ InputQ
          6s 1 Joao Pingo (Inactive) 22/Jan/14 3:47 PM
          Documentation Review done Documentation Review done Documentation Documentation
          2h 58m 2 jerome.vieilledent@ez.no 06/Mar/14 2:52 PM
          Documentation Documentation InputQ InputQ
          4s 1 jerome.vieilledent@ez.no 06/Mar/14 2:52 PM
          InputQ InputQ Development Development
          42d 18h 40m 2 jerome.vieilledent@ez.no 06/Mar/14 2:52 PM
          Development Development Documentation Review done Documentation Review done
          1d 2h 13m 2 jerome.vieilledent@ez.no 07/Mar/14 3:35 PM
          Documentation Review done Documentation Review done QA QA
          3d 50m 3 Joao Pingo (Inactive) 10/Mar/14 4:08 PM
          QA QA Closed Closed
          1d 26m 1 Joao Pingo (Inactive) 11/Mar/14 4:34 PM
          Closed Closed Reopened Reopened
          23h 55m 1 Joao Pingo (Inactive) 12/Mar/14 4:30 PM
          Reopened Reopened Closed Closed
          1s 1 Joao Pingo (Inactive) 12/Mar/14 4:30 PM

            People

            • Assignee:
              Unassigned
              Reporter:
              Björn Dieding@xrow.de
            • Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 2 hours Original Estimate - 2 hours
                2h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 30 minutes
                2d 30m

                  Agile