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

Exception instead of 404 when trying to access a file stored with a non default vardir

    Details

      Description

      If you change the VarDir setting, create a file content and try to access it directly you will get an unhanded exception (see attached stack trace) instead a 404.
      Argument '$id' is invalid: Prefix images not found in original/video/4bdd7ff
      b1324dc94c291c066e3fc797c.mov
      *500 Internal Server Error ­ InvalidArgumentException*

      If you use the default VarDir, you will get a 404 page.

      Steps to reproduce
      • Change the VarDir settings in you legacy "override/site.ini.append.php" and your "config/ezpublish.yml" to "var/storage".

        VarDir=var/storage

      • Go to your backend, create a file content with a video file. Let's say, "my_test.mov".
      • Confirm the file was created in the correct VarDir:
        "./ezpublish_legacy/var/storage/storage/original/application/9f88d3cbec3bbfa4f5757e46d7bd1894.mkv"
      • Try to access it with the API or just open the link in your browser:
        http://my-site.comt/var/storage/storage/original/application/9f88d3cbec3bbfa4f5757e46d7bd1894.mkv
      • Confirm you will get the exception.

      Note: If you change the VarDir to the default "VarDir=var/ezdemo_site" value, and try to open the URL, you will get a handled 404:
      http://my-site.comt/var/storage/storage/original/application/9f88d3cbec3bbfa4f5757e46d7bd1894.mkv

      1. no_404.pdf
        243 kB
        Eduardo Fernandes
      2. stacktrace.txt
        5 kB
        Gunnstein Lye

        Issue Links

          Activity

          Hide
          Gunnstein Lye added a comment -

          Updated the PR https://github.com/ezsystems/ezpublish-kernel/pull/1773 - it now throws a Symfony NotFoundHttpException from the StreamFileListener, this results in a 404 for the end user, solving the bug as reported.

          Show
          Gunnstein Lye added a comment - Updated the PR https://github.com/ezsystems/ezpublish-kernel/pull/1773 - it now throws a Symfony NotFoundHttpException from the StreamFileListener , this results in a 404 for the end user, solving the bug as reported.
          Hide
          Bertrand Dunogier added a comment -

          Finally reviewed it, Gunnstein Lye. Besides a tech' remark, we'll be good to go. Can you create the 5.4 backport ?

          Show
          Bertrand Dunogier added a comment - Finally reviewed it, Gunnstein Lye . Besides a tech' remark, we'll be good to go. Can you create the 5.4 backport ?
          Hide
          Paulo Nunes (Inactive) added a comment -

          PR verified by QA on 5.4
          I'll send the issue back to dev so that the merge may proceed

          Show
          Paulo Nunes (Inactive) added a comment - PR verified by QA on 5.4 I'll send the issue back to dev so that the merge may proceed
          Show
          Gunnstein Lye added a comment - - edited Merged in 6.5: https://github.com/ezsystems/ezpublish-kernel/commit/058084ade8b6f5ffc2c093a6dec9f236cbbe48c7 6.6: https://github.com/ezsystems/ezpublish-kernel/commit/488bd310cc2246be116f1ab5bb07dc3b7e15c874 master: https://github.com/ezsystems/ezpublish-kernel/commit/1a5f7d76a30443262025bf3735ff316ef8438353
          Hide
          Rui Silva (Inactive) added a comment -

          Tested and approved by QA for 5.4, 6.5, 6.6 and master.

          Show
          Rui Silva (Inactive) added a comment - Tested and approved by QA for 5.4, 6.5, 6.6 and master.

            People

            • Assignee:
              Unassigned
              Reporter:
              Eduardo Fernandes (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              6 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 - 2 weeks, 3 hours, 45 minutes
                2w 3h 45m