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

Bulk trash returns 404 and error when /location/trash works on the same content object

    Details

    • Type: Bug Bug
    • Status: Confirmed
    • Priority: High High
    • Resolution: Unresolved
    • Affects Version/s: 2.4.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      In eZplatform 2.4 admin, I it seems impossible for me to bulk delete content in the admin ui. Every request to bulk delete returns an error banner and a json response reporting that the content was not found, though I can always go to the same contents and trash them individually.

      Using php 7.2 and the following package versions:

      ezsystems/ezplatform-admin-ui                      v1.4.1
      ezsystems/ezplatform-admin-ui-assets               v3.1.0
      ezsystems/ezplatform-admin-ui-modules              v1.4.1
      ezsystems/ezplatform-design-engine                 v2.0.0
      ezsystems/ezplatform-solr-search-engine            v1.5.4
      ezsystems/ezplatform-standard-design               v0.1.0
      ezsystems/ezpublish-kernel                         v7.4.2
      

      Here's the request sent by ezplatform-admin-ui that fails for one example, in curl format:
      curl 'https://REDACTED/api/ezp/v2/bulk' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0' -H 'Accept: application/vnd.ez.api.BulkOperationResponse+json' -H 'Accept-Language: en-US,fr;q=0.5' --compressed -H 'Referer: https://REDACTED/ez/content/location/19618' -H 'Content-Type: application/vnd.ez.api.BulkOperation+json' -H 'X-Siteaccess: admin' -H 'X-CSRF-Token: X4WgO2OqQpoLRD_LfAB_N_lj1I958Btim8Uz_zwlYl0' -H 'Origin: https://REDACTED' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' --data '{"bulkOperations":{"operations":{"19620":{"uri":"/api/ezp/v2/content/locations/1/43/52/423/19618/19620","method":"MOVE","headers":{"Destination":"/api/ezp/v2/content/trash"}}}}}'
      

      And the response headers:

      HTTP/1.1 500 Internal Server Error
      Date: Tue, 12 Feb 2019 16:28:02 GMT
      Server: Apache
      X-Content-Type-Options: nosniff
      Expires: Sat, 26 Jul 1997 05:00:00 GMT
      Last-Modified: Tue, 12 Feb 2019 16:28:02 GMT
      Cache-Control: no-cache, must-revalidate, no-cache, private
      Pragma: no-cache
      Content-language: en-GB
      Status: 404 Not Found
      Vary: cookie,authorization
      X-Robots-Tag: noindex, nofollow
      Content-Length: 162
      Content-Type: application/vnd.ez.api.ErrorMessage+json
      X-Varnish: 296900
      Age: 0
      Via: 1.1 varnish (Varnish/5.2)
      X-Cache: MISS
      Connection: close
      {"ErrorMessage":{"_media-type":"application\/vnd.ez.api.ErrorMessage+json","errorCode":500,"errorMessage":"Internal Server Error","errorDescription":"Not Found"}}
      

      Here's the succeeding request when trashing the same item:

      curl 'https://REDACTED/ez/location/trash' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: en-US,fr;q=0.5' --compressed -H 'Referer: https://REDACTED/ez/content/location/19620' -H 'Content-Type: application/x-www-form-urlencoded' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' --data 'location_trash%5Btrash%5D=&location_trash%5Blocation%5D=19620&location_trash%5B_token%5D=REDACTED'
      

      And the successful response headers:

      HTTP/1.1 302 Found
      Date: Tue, 12 Feb 2019 16:30:35 GMT
      Server: Apache
      X-Content-Type-Options: nosniff
      Cache-Control: no-cache, private
      Location: /ez/content/location/19618
      Vary: cookie,authorization
      X-Robots-Tag: noindex, nofollow
      Content-Length: 348
      Content-Type: text/html; charset=UTF-8
      X-Varnish: 296940
      Age: 0
      Via: 1.1 varnish (Varnish/5.2)
      X-Cache: MISS
      Keep-Alive: timeout=5, max=100
      Connection: Keep-Alive
      

        Issue Links

          Activity

          Show
          Barbara Grajczyk added a comment - Moved from https://github.com/ezsystems/ezplatform-admin-ui/issues/841
          Hide
          Jackson Murtha added a comment -

          I am ALSO having this issue, and it is happening with bulk Move, not just delete. When using Bulk move, the flash message error also says:
          "An unexpected error occurred while deleting the content item(s). Please try again later. "

          This is pretty scary. I'm not sure if it's trying to delete content during the bulk move operation or not, but either the message is wrong or this is potentially even worse than described in the bug.

          Show
          Jackson Murtha added a comment - I am ALSO having this issue, and it is happening with bulk Move, not just delete. When using Bulk move, the flash message error also says: "An unexpected error occurred while deleting the content item(s). Please try again later. " This is pretty scary. I'm not sure if it's trying to delete content during the bulk move operation or not, but either the message is wrong or this is potentially even worse than described in the bug.
          Hide
          Andras Debreczeni added a comment - - edited

          It seems that the /bulk api-related routes are no longer imported.
          I added them manually in my own app/routing/ez.yml file as follows:

          kernel.rest.bulk:
          resource: "@EzPlatformAdminUiBundle/Resources/config/routing_rest.yml"
          prefix: '%ezpublish_rest.path_prefix%'

          kernel.rest.bulk.options:
          resource: "@EzPlatformAdminUiBundle/Resources/config/routing_rest.yml"
          prefix: '%ezpublish_rest.path_prefix%'
          type: rest_options

          ```

          Then it works.

          Show
          Andras Debreczeni added a comment - - edited It seems that the /bulk api-related routes are no longer imported. I added them manually in my own app/routing/ez.yml file as follows: kernel.rest.bulk: resource: "@EzPlatformAdminUiBundle/Resources/config/routing_rest.yml" prefix: '%ezpublish_rest.path_prefix%' kernel.rest.bulk.options: resource: "@EzPlatformAdminUiBundle/Resources/config/routing_rest.yml" prefix: '%ezpublish_rest.path_prefix%' type: rest_options ``` Then it works.
          Hide
          Barbara Grajczyk added a comment -

          Hi Jackson Murtha could you please give me some steps to reproduce this issue? I was not able to do it so far. Do you use any specific setup?

          Show
          Barbara Grajczyk added a comment - Hi Jackson Murtha could you please give me some steps to reproduce this issue? I was not able to do it so far. Do you use any specific setup?
          Hide
          Andras Debreczeni added a comment -

          It was (re-)added with this commit:
          https://github.com/ezsystems/ezplatform/blame/dc4d88d925c8c287814584f2537587265e043f1f/app/config/routing.yml#L28
          Related to: #EZP-29933

          Users who cloned this repository (ezsystems/ezplatform) prior to this commit, didn't have the bulk rest API routes imported.

          In any case, the OPTIONS method for these routes are still not imported.

          Show
          Andras Debreczeni added a comment - It was (re-)added with this commit: https://github.com/ezsystems/ezplatform/blame/dc4d88d925c8c287814584f2537587265e043f1f/app/config/routing.yml#L28 Related to: # EZP-29933 Users who cloned this repository (ezsystems/ezplatform) prior to this commit, didn't have the bulk rest API routes imported. In any case, the OPTIONS method for these routes are still not imported.
          Hide
          Andras Debreczeni added a comment -

          Steps to reproduce:

              composer create-project ezsystems/ezplatform ezplatform "~2.3.0"
              bin/console debug:router | grep bulk   
          

          Observe: /api/v2/bulk is not there

          Show
          Andras Debreczeni added a comment - Steps to reproduce: composer create-project ezsystems/ezplatform ezplatform "~2.3.0" bin/console debug:router | grep bulk Observe: /api/v2/bulk is not there
          Hide
          Dawid Parafiński added a comment - - edited

          Hi Andras Debreczeni

          It was never re-added, just before 2.4 was released it was part of adminUI but it created some inconvenience so it was moved to kernel api namespace.
          Bulk move/delete was never part of ezplatform v2.3.
          As a part of update you should also update metarepo to avoid situations like this (metarepo on v2.3 and adminUI on v2.4).
          It is described here:
          https://doc.ezplatform.com/en/latest/releases/updating_ez_platform/#update-procedure

          Show
          Dawid Parafiński added a comment - - edited Hi Andras Debreczeni It was never re-added, just before 2.4 was released it was part of adminUI but it created some inconvenience so it was moved to kernel api namespace. Bulk move/delete was never part of ezplatform v2.3. As a part of update you should also update metarepo to avoid situations like this (metarepo on v2.3 and adminUI on v2.4). It is described here: https://doc.ezplatform.com/en/latest/releases/updating_ez_platform/#update-procedure

            People

            • Assignee:
              Unassigned
              Reporter:
              Barbara Grajczyk
            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: