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

Trying to insert a large number in the "Priority" field results in 500 database error

    XMLWordPrintable

Details

    Description

      When trying to insert a large number (like 999999999999999999999999999999999999999999999999999999999999) in the "Priority" field while using Platform UI, the following error is displayed:

      An error occurred when updating the priority

      Also, the request that happens during changing priority returns 500 error. Error details:

      {
          "ErrorMessage": {
              "_media-type": "application\/vnd.ez.api.ErrorMessage+json",
              "errorCode": 500,
              "errorMessage": "Internal Server Error",
              "errorDescription": "Database error",
              "trace": "#0 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Handler.php(460): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Gateway\\ExceptionConversion->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#1 XXX\\app\\cache\\dev\\appDevDebugProjectContainer.php(39679): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Handler->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#2 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Persistence\\Cache\\LocationHandler.php(215): eZPublishCorePersistenceLegacyContentLocationHandler_000000002f543df5000000007f66ce1d86b4e9c06d7d9d156c88b8c3cd5f614d->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#3 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Repository\\LocationService.php(464): eZ\\Publish\\Core\\Persistence\\Cache\\LocationHandler->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#4 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\SignalSlot\\LocationService.php(204): eZ\\Publish\\Core\\Repository\\LocationService->updateLocation(Object(eZ\\Publish\\Core\\Repository\\Values\\Content\\Location), Object(eZ\\Publish\\API\\Repository\\Values\\Content\\LocationUpdateStruct))\n#5 XXX\\app\\cache\\dev\\appDevDebugProjectContainer.php(37649): eZ\\Publish\\Core\\SignalSlot\\LocationService->updateLocation(Object(eZ\\Publish\\Core\\Repository\\Values\\Content\\Location), Object(eZ\\Publish\\API\\Repository\\Values\\Content\\LocationUpdateStruct))\n#6 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\REST\\Server\\Controller\\Location.php(415): eZPublishCoreRepositoryLocationService_000000002f54235d000000007f66ce1d86b4e9c06d7d9d156c88b8c3cd5f614d->updateLocation(Object(eZ\\Publish\\Core\\Repository\\Values\\Content\\Location), Object(eZ\\Publish\\API\\Repository\\Values\\Content\\LocationUpdateStruct))\n#7 [internal function]: eZ\\Publish\\Core\\REST\\Server\\Controller\\Location->updateLocation('1\/2\/54', Object(Symfony\\Component\\HttpFoundation\\Request))\n#8 XXX\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\HttpKernel.php(137): call_user_func_array(Array, Array)\n#9 XXX\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\HttpKernel.php(57): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#10 XXX\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel.php(67): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#11 XXX\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\Kernel.php(183): Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#12 XXX\\web\\app.php(70): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#13 {main}",
              "file": "XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Gateway\\ExceptionConversion.php",
              "line": 393,
              "Previous": {
                  "_media-type": "application\/vnd.ez.api.ErrorMessage+json",
                  "ErrorMessage": {
                      "_media-type": "application\/vnd.ez.api.ErrorMessage+json",
                      "errorCode": 500,
                      "errorMessage": "Internal Server Error",
                      "errorDescription": "An exception occurred while executing 'UPDATE `ezcontentobject_tree` SET `priority` = :placeholder1, `remote_id` = :placeholder2, `sort_order` = :placeholder3, `sort_field` = :placeholder4 WHERE `node_id` = 54' with params [9223372036854775807, \"9f8895e011da2aa892c73d2deae85951\", 1, 1]:\n\nSQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'priority' at row 1",
                      "trace": "#0 XXX\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\DBALException.php(176): Doctrine\\DBAL\\Driver\\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\\DBAL\\Driver\\PDOException))\n#1 XXX\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\DBALException.php(150): Doctrine\\DBAL\\DBALException::wrapException(Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), 'An exception oc...')\n#2 XXX\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Statement.php(177): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), 'UPDATE `ezconte...', Array)\n#3 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Gateway\\DoctrineDatabase.php(1023): Doctrine\\DBAL\\Statement->execute()\n#4 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Gateway\\ExceptionConversion.php(391): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Gateway\\DoctrineDatabase->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#5 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Handler.php(460): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Gateway\\ExceptionConversion->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#6 XXX\\app\\cache\\dev\\appDevDebugProjectContainer.php(39679): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Handler->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#7 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Persistence\\Cache\\LocationHandler.php(215): eZPublishCorePersistenceLegacyContentLocationHandler_000000002f543df5000000007f66ce1d86b4e9c06d7d9d156c88b8c3cd5f614d->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#8 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Repository\\LocationService.php(464): eZ\\Publish\\Core\\Persistence\\Cache\\LocationHandler->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#9 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\SignalSlot\\LocationService.php(204): eZ\\Publish\\Core\\Repository\\LocationService->updateLocation(Object(eZ\\Publish\\Core\\Repository\\Values\\Content\\Location), Object(eZ\\Publish\\API\\Repository\\Values\\Content\\LocationUpdateStruct))\n#10 XXX\\app\\cache\\dev\\appDevDebugProjectContainer.php(37649): eZ\\Publish\\Core\\SignalSlot\\LocationService->updateLocation(Object(eZ\\Publish\\Core\\Repository\\Values\\Content\\Location), Object(eZ\\Publish\\API\\Repository\\Values\\Content\\LocationUpdateStruct))\n#11 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\REST\\Server\\Controller\\Location.php(415): eZPublishCoreRepositoryLocationService_000000002f54235d000000007f66ce1d86b4e9c06d7d9d156c88b8c3cd5f614d->updateLocation(Object(eZ\\Publish\\Core\\Repository\\Values\\Content\\Location), Object(eZ\\Publish\\API\\Repository\\Values\\Content\\LocationUpdateStruct))\n#12 [internal function]: eZ\\Publish\\Core\\REST\\Server\\Controller\\Location->updateLocation('1\/2\/54', Object(Symfony\\Component\\HttpFoundation\\Request))\n#13 XXX\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\HttpKernel.php(137): call_user_func_array(Array, Array)\n#14 XXX\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\HttpKernel.php(57): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#15 XXX\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel.php(67): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#16 XXX\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\Kernel.php(183): Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#17 XXX\\web\\app.php(70): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#18 {main}",
                      "file": "XXX\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Driver\\AbstractMySQLDriver.php",
                      "line": 121,
                      "Previous": {
                          "_media-type": "application\/vnd.ez.api.ErrorMessage+json",
                          "ErrorMessage": {
                              "_media-type": "application\/vnd.ez.api.ErrorMessage+json",
                              "errorCode": 500,
                              "errorMessage": "Internal Server Error",
                              "errorDescription": "SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'priority' at row 1",
                              "trace": "#0 XXX\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Statement.php(168): Doctrine\\DBAL\\Driver\\PDOStatement->execute(NULL)\n#1 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Gateway\\DoctrineDatabase.php(1023): Doctrine\\DBAL\\Statement->execute()\n#2 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Gateway\\ExceptionConversion.php(391): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Gateway\\DoctrineDatabase->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#3 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Handler.php(460): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Gateway\\ExceptionConversion->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#4 XXX\\app\\cache\\dev\\appDevDebugProjectContainer.php(39679): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Handler->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#5 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Persistence\\Cache\\LocationHandler.php(215): eZPublishCorePersistenceLegacyContentLocationHandler_000000002f543df5000000007f66ce1d86b4e9c06d7d9d156c88b8c3cd5f614d->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#6 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Repository\\LocationService.php(464): eZ\\Publish\\Core\\Persistence\\Cache\\LocationHandler->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#7 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\SignalSlot\\LocationService.php(204): eZ\\Publish\\Core\\Repository\\LocationService->updateLocation(Object(eZ\\Publish\\Core\\Repository\\Values\\Content\\Location), Object(eZ\\Publish\\API\\Repository\\Values\\Content\\LocationUpdateStruct))\n#8 XXX\\app\\cache\\dev\\appDevDebugProjectContainer.php(37649): eZ\\Publish\\Core\\SignalSlot\\LocationService->updateLocation(Object(eZ\\Publish\\Core\\Repository\\Values\\Content\\Location), Object(eZ\\Publish\\API\\Repository\\Values\\Content\\LocationUpdateStruct))\n#9 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\REST\\Server\\Controller\\Location.php(415): eZPublishCoreRepositoryLocationService_000000002f54235d000000007f66ce1d86b4e9c06d7d9d156c88b8c3cd5f614d->updateLocation(Object(eZ\\Publish\\Core\\Repository\\Values\\Content\\Location), Object(eZ\\Publish\\API\\Repository\\Values\\Content\\LocationUpdateStruct))\n#10 [internal function]: eZ\\Publish\\Core\\REST\\Server\\Controller\\Location->updateLocation('1\/2\/54', Object(Symfony\\Component\\HttpFoundation\\Request))\n#11 XXX\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\HttpKernel.php(137): call_user_func_array(Array, Array)\n#12 XXX\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\HttpKernel.php(57): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#13 XXX\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel.php(67): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#14 XXX\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\Kernel.php(183): Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#15 XXX\\web\\app.php(70): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#16 {main}",
                              "file": "XXX\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Driver\\PDOStatement.php",
                              "line": 107,
                              "Previous": {
                                  "_media-type": "application\/vnd.ez.api.ErrorMessage+json",
                                  "ErrorMessage": {
                                      "_media-type": "application\/vnd.ez.api.ErrorMessage+json",
                                      "errorCode": 500,
                                      "errorMessage": "Internal Server Error",
                                      "errorDescription": "SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'priority' at row 1",
                                      "trace": "#0 XXX\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Driver\\PDOStatement.php(105): PDOStatement->execute(NULL)\n#1 XXX\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Statement.php(168): Doctrine\\DBAL\\Driver\\PDOStatement->execute(NULL)\n#2 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Gateway\\DoctrineDatabase.php(1023): Doctrine\\DBAL\\Statement->execute()\n#3 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Gateway\\ExceptionConversion.php(391): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Gateway\\DoctrineDatabase->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#4 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Handler.php(460): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Gateway\\ExceptionConversion->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#5 XXX\\app\\cache\\dev\\appDevDebugProjectContainer.php(39679): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Handler->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#6 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Persistence\\Cache\\LocationHandler.php(215): eZPublishCorePersistenceLegacyContentLocationHandler_000000002f543df5000000007f66ce1d86b4e9c06d7d9d156c88b8c3cd5f614d->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#7 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Repository\\LocationService.php(464): eZ\\Publish\\Core\\Persistence\\Cache\\LocationHandler->update(Object(eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct), 54)\n#8 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\SignalSlot\\LocationService.php(204): eZ\\Publish\\Core\\Repository\\LocationService->updateLocation(Object(eZ\\Publish\\Core\\Repository\\Values\\Content\\Location), Object(eZ\\Publish\\API\\Repository\\Values\\Content\\LocationUpdateStruct))\n#9 XXX\\app\\cache\\dev\\appDevDebugProjectContainer.php(37649): eZ\\Publish\\Core\\SignalSlot\\LocationService->updateLocation(Object(eZ\\Publish\\Core\\Repository\\Values\\Content\\Location), Object(eZ\\Publish\\API\\Repository\\Values\\Content\\LocationUpdateStruct))\n#10 XXX\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\REST\\Server\\Controller\\Location.php(415): eZPublishCoreRepositoryLocationService_000000002f54235d000000007f66ce1d86b4e9c06d7d9d156c88b8c3cd5f614d->updateLocation(Object(eZ\\Publish\\Core\\Repository\\Values\\Content\\Location), Object(eZ\\Publish\\API\\Repository\\Values\\Content\\LocationUpdateStruct))\n#11 [internal function]: eZ\\Publish\\Core\\REST\\Server\\Controller\\Location->updateLocation('1\/2\/54', Object(Symfony\\Component\\HttpFoundation\\Request))\n#12 XXX\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\HttpKernel.php(137): call_user_func_array(Array, Array)\n#13 XXX\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\HttpKernel.php(57): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#14 XXX\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel.php(67): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#15 XXX\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\Kernel.php(183): Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#16 XXX\\web\\app.php(70): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#17 {main}",
                                      "file": "XXX\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Driver\\PDOStatement.php",
                                      "line": 105
                                  }
                              }
                          }
                      }
                  }
              }
          }
      }
      

      Probably there should be a check in place to verify if the value is valid before trying to insert it into the database. Also, probably a better message should be displayed to the Editor.

      Steps to reproduce

      1. Create new eZ Platform installation.
      2. Add new Content Object under root Content Object.
      3. In the Platform UI, navigate to the root Content Object.
      4. In the Sub-items list, change the priority of the previously created COntent Object to 999999999999999999999999999999999999999999999999999999999999 and confirm. The error described above will be presented to you.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jacek.foremski-obsolete@ez.no Jacek Foremski (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: