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

Misleading message given from REST v2 during creating a new draft with remote ID that already exists

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: High High
    • None
    • 5.1
    • Platform > REST API v2

    Description

      Try send two similar requests to create a new content draft
      Request:

      POST /api/ezp/v2/content/objects HTTP/1.1
      Authorization:
      Basic YWRtaW46MTIzNA==
      Host:
      api.demo.ez.no
      Content-Length:
      1269
      X-Target-URI:
      http://ezp.rest.demo
      Accept:
      application/vnd.ez.api.Content+json
      Content-Type:
      application/vnd.ez.api.ContentCreate+json
      Connection:
      Keep-Alive
      
      {
        "ContentCreate":  {
          "ContentType":  {
            "_href": "/content/types/1"
          },
          "mainLanguageCode": "eng-GB",
          "User":  {
            "_href": "/user/users/14"
          },
          "LocationCreate":  {
            "ParentLocation":  {
              "_href": "/content/locations/1/2"
            },
            "priority": "0",
            "hidden": "false",
            "sortField": "PATH",
            "sortOrder": "ASC"
          },
          "Section":  {
            "_href": "/content/sections/1"
          },
          "alwaysAvailable": "true",
          "remoteId": "remoteId12345678",
          "modificationDate": "2012-10-18T11:00:00",
          "fields":  {
            "field":  [
               {
                "fieldDefinitionIdentifier": "name",
                "languageCode": "eng-GB",
                "fieldValue": "New Folder"
              },
               {
                "fieldDefinitionIdentifier": "short_description",
                "languageCode": "eng-GB",
                "fieldValue":  {
                  "xml": "<?xml version="1.0" encoding="UTF-8"?><section xmlns:image="http://ez.no/namespaces/ezpublish3/image/" xmlns:xhtml="http://ez.no/namespaces/ezpublish3/xhtml/" xmlns:custom="http://ez.no/namespaces/ezpublish3/custom/"><section><paragraph>This is short description</paragraph></section></section>"
                }
              }
            ]
          }
        }
      }
      

      Server response:

      HTTP/1.1 500 Internal Server Error
      Status:
      500 Internal Server Error
      Date:
      Fri, 24 May 2013 08:15:18 GMT
      Content-Length:
      4435
      Content-Type:
      application/vnd.ez.api.ErrorMessage+json
      X-Powered-By:
      PHP/5.3.19
      Server:
      Apache/2.2.23 (Amazon)
      Cache-Control:
      no-cache
      
      {
        "ErrorMessage":  {
          "_media-type": "application/vnd.ez.api.ErrorMessage+json",
          "errorCode": 500,
          "errorMessage": "Internal Server Error",
          "errorDescription": "Database error",
          "trace": "#0 /var/www/html/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Handler.php(142): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Gateway\\ExceptionConversion->insertContentObject(Object(eZ\\Publish\\SPI\\Persistence\\Content\\CreateStruct), 1)\n#1 /var/www/html/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Handler.php(119): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Handler->internalCreate(Object(eZ\\Publish\\SPI\\Persistence\\Content\\CreateStruct))\n#2 /var/www/html/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Cache/ContentHandler.php(35): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Handler->create(Object(eZ\\Publish\\SPI\\Persistence\\Content\\CreateStruct))\n#3 /var/www/html/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/ContentService.php(643): eZ\\Publish\\Core\\Persistence\\Cache\\ContentHandler->create(Object(eZ\\Publish\\SPI\\Persistence\\Content\\CreateStruct))\n#4 /var/www/html/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/SignalSlot/ContentService.php(237): eZ\\Publish\\Core\\Repository\\ContentService->createContent(Object(eZ\\Publish\\Core\\Repository\\Values\\Content\\ContentCreateStruct), Array)\n#5 /var/www/html/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/REST/Server/Controller/Content.php(303): eZ\\Publish\\Core\\SignalSlot\\ContentService->createContent(Object(eZ\\Publish\\Core\\Repository\\Values\\Content\\ContentCreateStruct), Array)\n#6 [internal function]: eZ\\Publish\\Core\\REST\\Server\\Controller\\Content->createContent()\n#7 /var/www/html/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php(129): call_user_func_array(Array, Array)\n#8 /var/www/html/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php(73): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#9 /var/www/html/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php(57): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#10 /var/www/html/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(197): Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#11 /var/www/html/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(464): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#12 /var/www/html/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php(60): Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache->forward(Object(Symfony\\Component\\HttpFoundation\\Request), true, NULL)\n#13 /var/www/html/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(244): Symfony\\Bundle\\FrameworkBundle\\HttpCache\\HttpCache->forward(Object(Symfony\\Component\\HttpFoundation\\Request), true)\n#14 /var/www/html/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(261): Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache->pass(Object(Symfony\\Component\\HttpFoundation\\Request), true)\n#15 /var/www/html/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/HttpCache.php(38): Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache->invalidate(Object(Symfony\\Component\\HttpFoundation\\Request), true)\n#16 /var/www/html/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(190): eZ\\Bundle\\EzPublishCoreBundle\\HttpCache->invalidate(Object(Symfony\\Component\\HttpFoundation\\Request), true)\n#17 /var/www/html/web/index.php(26): Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#18  {main}",
          "file": "/var/www/html/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Gateway/ExceptionConversion.php",
          "line": 85
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            lukasz.serwatka@ibexa.co Ɓukasz Serwatka
            Votes:
            0 Vote for this issue
            Watchers:
            4 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 - 1 hour
                1h