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

REST API - "Unknown relation type 0." error

    Details

      Description

      Steps to reproduce:

      1. Create an article;
      2. Add an existing image to an XML block field. Used "Summary";
      3. Add a different image to another XML block field. Used "Body";
      4. Publish;
      5. Edit the article, and publish;
      6. Access the REST API via cURL:

      $ curl -u "admin:admin" -v -H "Accept: application/vnd.ez.api.Content+json" http://example.com/api/ezp/v2/content/objects/136
      *   Trying 127.0.0.1...
      * Connected to example.com (127.0.0.1) port 80 (#0)
      * Server auth using Basic with user 'admin'
      > GET /api/ezp/v2/content/objects/136 HTTP/1.1
      > Host: example.com
      > Authorization: Basic YWRtaW46YWRtaW4=
      > User-Agent: curl/7.47.0
      > Accept: application/vnd.ez.api.Content+json
      > 
      < HTTP/1.1 500 Internal Server Error
      < Date: Fri, 14 Apr 2017 17:03:10 GMT
      < Server: Apache/2.4.18 (Ubuntu)
      < Cache-Control: no-cache
      < Accept-Patch: application/vnd.ez.api.ContentUpdate+json
      < Vary: Cookie,Authorization
      < Content-Length: 177
      < Connection: close
      < Content-Type: application/vnd.ez.api.Content+json
      < 
      * Closing connection 0
      {"ErrorMessage":{"_media-type":"application\/vnd.ez.api.ErrorMessage+json","errorCode":500,"errorMessage":"Internal Server Error","errorDescription":"Unknown relation type 0."}}
      

      This issue only happens under very specific conditions:

      • If you only add one image to one XML block field, the issue does not occur;
      • If you add the same image to multiple XML block fields, the issue does not occur;
      • If you add 2 different images to the same XML block field, the issue also does not occur.

      As such, it only happens when different images are inserted into different XML block fields.

      Also, on the first time the article is published (upon creation), the issue does not occur. It only happens after the article is edited and published (no changes required for bug reproduction).

        Issue Links

          Activity

          Hide
          Adam Wójs added a comment -

          Current status of this issue (in summary):

          We was able to reproduce this issue and we found root cause of problem in legacy. PR: https://github.com/ezsystems/ezpublish-legacy/pull/1295. I'm still working on some piece of code which will clean up redundant relations rows with type = 0.

          Show
          Adam Wójs added a comment - Current status of this issue (in summary): We was able to reproduce this issue and we found root cause of problem in legacy. PR: https://github.com/ezsystems/ezpublish-legacy/pull/1295 . I'm still working on some piece of code which will clean up redundant relations rows with type = 0.
          Hide
          Adam Wójs added a comment -

          PR with clean up command for the new stack: https://github.com/ezsystems/ezpublish-kernel/pull/1979

          Show
          Adam Wójs added a comment - PR with clean up command for the new stack: https://github.com/ezsystems/ezpublish-kernel/pull/1979
          Hide
          Rui Silva (Inactive) added a comment -

          Tested and approved by QA for 5.4 as well as on the clean-up command platform upgraded from 5.4.

          Show
          Rui Silva (Inactive) added a comment - Tested and approved by QA for 5.4 as well as on the clean-up command platform upgraded from 5.4.
          Hide
          Rui Silva (Inactive) added a comment - - edited

          Adam Wójs, reopening this jira since it was noticed that the PR's have not yet been merged (as it sometimes does happen), so QA is sending this back to dev-needed so that PR's can be merged.
          Please send back to QA again afterwards so that QA can inform Support Team that the fix is ready (after merge is done) to be sent to customers.

          Show
          Rui Silva (Inactive) added a comment - - edited Adam Wójs , reopening this jira since it was noticed that the PR's have not yet been merged (as it sometimes does happen), so QA is sending this back to dev-needed so that PR's can be merged. Please send back to QA again afterwards so that QA can inform Support Team that the fix is ready (after merge is done) to be sent to customers.
          Show
          André Rømcke added a comment - Merged: https://github.com/ezsystems/ezpublish-kernel/commit/14240c195441e5dffd6b2ebbc41ca9524d753b48 https://github.com/ezsystems/ezpublish-legacy/commit/65e177f74ee2b598aeb339f7377aeedc95717641
          Hide
          Bertrand Dunogier added a comment -

          Need to adapt fix versions.

          Show
          Bertrand Dunogier added a comment - Need to adapt fix versions.

            People

            • Assignee:
              Unassigned
              Reporter:
              Nuno Oliveira (Inactive)
            • Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: