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

          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
          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
          Hide
          Robert Hafner added a comment -

          Glad I could help!

          Show
          Robert Hafner added a comment - Glad I could help!
          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
          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.
          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'
          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
          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

            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