"Completed_revision" Error when syncing Scripto project with 1 item with multiple media

I’m scratching my head on this. We were able to successfully sync item sets with multiple items with 1 piece of media…however, we are receiving an error when trying to sync an item set with one item that contains multiple media files. The error looks something like this:

Integrity constraint violation: 1048 Column ‘completed_revision’ cannot be null

I looked to see where this completed_revision exists, and it’s written in the original Scripto Module.php file to start out as NULL. I’m not sure why this sync is throwing an error.

Has anyone else had trouble - or success - in being able to sync an item with multiple images? That’s the goal here.

Thanks!

This is an odd one. The Column ‘completed_revision’ cannot be null error implies that the completed_revision column was defined to accept only an integer, which it is not. It specifically allows null.

To troubleshoot this I’ll need:

  • The entire error message
  • The Scripto version are you using
  • The info on your “System information” page (linked from the footer).

Thanks for taking a look at this! I apologize ahead of time as the error message is long.

The Scripto Version we’re using is 1.3.0.

The System information is as follows:

Omeka S: Version 3.2.0
PHP
Version 7.4.11
SAPI cgi-fcgi
Memory Limit 196M
POST Size Limit 150M
File Upload Limit 150M
Garbage Collection Yes
Extensions bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imagick, imap, intl, ionCube Loader, json, ldap, libxml, mbstring, mysqli, mysqlnd, odbc, openssl, pcntl, pcre, PDO, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, readline, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib
MySQL
Server Version 5.5.5-10.3.27-MariaDB
Client Version mysqlnd 7.4.11
Mode
OS
Version Linux 3.10.0-962.3.2.lve1.5.25.8.el7.x86_64 x86_64

The entire error message log is as follows:

2022-08-29T20:34:13+00:00 ERR (3): PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘completed_revision’ cannot be null in /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:112
Stack trace:
#0 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(112): PDOStatement->execute(NULL)
#1 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(177): Doctrine\DBAL\Driver\PDOStatement->execute(NULL)
#2 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(287): Doctrine\DBAL\Statement->execute()
#3 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1122): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->executeInserts()
#4 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(420): Doctrine\ORM\UnitOfWork->executeInserts(Object(Doctrine\ORM\Mapping\ClassMetadata))
#5 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(376): Doctrine\ORM\UnitOfWork->commit(NULL)
#6 /home/schaffer/dev.schafferlibrarycollections.org/modules/Scripto/src/Job/SyncProject.php(162): Doctrine\ORM\EntityManager->flush()
#7 /home/schaffer/dev.schafferlibrarycollections.org/modules/Scripto/src/Job/SyncProject.php(37): Scripto\Job\SyncProject->syncProjectMedia(Object(Scripto\Entity\ScriptoProject))
#8 /home/schaffer/dev.schafferlibrarycollections.org/modules/Scripto/src/Job/SyncProject.php(22): Scripto\Job\SyncProject->syncProject(Object(Scripto\Entity\ScriptoProject))
#9 /home/schaffer/dev.schafferlibrarycollections.org/application/src/Job/DispatchStrategy/Synchronous.php(34): Scripto\Job\SyncProject->perform()
#10 /home/schaffer/dev.schafferlibrarycollections.org/application/src/Job/Dispatcher.php(105): Omeka\Job\DispatchStrategy\Synchronous->send(Object(Omeka\Entity\Job))
#11 /home/schaffer/dev.schafferlibrarycollections.org/application/data/scripts/perform-job.php(66): Omeka\Job\Dispatcher->send(Object(Omeka\Entity\Job), Object(Omeka\Job\DispatchStrategy\Synchronous))
#12 {main}

Next Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘completed_revision’ cannot be null in /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18
Stack trace:
#0 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(114): Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException))
#1 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(177): Doctrine\DBAL\Driver\PDOStatement->execute(NULL)
#2 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(287): Doctrine\DBAL\Statement->execute()
#3 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1122): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->executeInserts()
#4 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(420): Doctrine\ORM\UnitOfWork->executeInserts(Object(Doctrine\ORM\Mapping\ClassMetadata))
#5 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(376): Doctrine\ORM\UnitOfWork->commit(NULL)
#6 /home/schaffer/dev.schafferlibrarycollections.org/modules/Scripto/src/Job/SyncProject.php(162): Doctrine\ORM\EntityManager->flush()
#7 /home/schaffer/dev.schafferlibrarycollections.org/modules/Scripto/src/Job/SyncProject.php(37): Scripto\Job\SyncProject->syncProjectMedia(Object(Scripto\Entity\ScriptoProject))
#8 /home/schaffer/dev.schafferlibrarycollections.org/modules/Scripto/src/Job/SyncProject.php(22): Scripto\Job\SyncProject->syncProject(Object(Scripto\Entity\ScriptoProject))
#9 /home/schaffer/dev.schafferlibrarycollections.org/application/src/Job/DispatchStrategy/Synchronous.php(34): Scripto\Job\SyncProject->perform()
#10 /home/schaffer/dev.schafferlibrarycollections.org/application/src/Job/Dispatcher.php(105): Omeka\Job\DispatchStrategy\Synchronous->send(Object(Omeka\Entity\Job))
#11 /home/schaffer/dev.schafferlibrarycollections.org/application/data/scripts/perform-job.php(66): Omeka\Job\Dispatcher->send(Object(Omeka\Entity\Job), Object(Omeka\Job\DispatchStrategy\Synchronous))
#12 {main}

Next Doctrine\DBAL\Exception\NotNullConstraintViolationException: An exception occurred while executing ‘INSERT INTO scripto_media (position, synced, edited, edited_by, completed, completed_by, completed_revision, approved, approved_revision, imported_html, scripto_item_id, media_id, approved_by_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ with params [1, “2022-08-29 20:34:13”, null, null, null, null, null, null, null, null, 127, 6985, null]:

SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘completed_revision’ cannot be null in /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:125
Stack trace:
#0 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(182): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException(‘An exception oc…’, Object(Doctrine\DBAL\Driver\PDO\Exception))
#1 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(159): Doctrine\DBAL\DBALException::wrapException(Object(Doctrine\DBAL\Driver\PDO\MySQL\Driver), Object(Doctrine\DBAL\Driver\PDO\Exception), ‘An exception oc…’)
#2 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(2214): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDO\MySQL\Driver), Object(Doctrine\DBAL\Driver\PDO\Exception), ‘INSERT INTO scr…’, Array)
#3 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(183): Doctrine\DBAL\Connection->handleExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDO\Exception), ‘INSERT INTO scr…’, Array, Array)
#4 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(287): Doctrine\DBAL\Statement->execute()
#5 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1122): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->executeInserts()
#6 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(420): Doctrine\ORM\UnitOfWork->executeInserts(Object(Doctrine\ORM\Mapping\ClassMetadata))
#7 /home/schaffer/dev.schafferlibrarycollections.org/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(376): Doctrine\ORM\UnitOfWork->commit(NULL)
#8 /home/schaffer/dev.schafferlibrarycollections.org/modules/Scripto/src/Job/SyncProject.php(162): Doctrine\ORM\EntityManager->flush()
#9 /home/schaffer/dev.schafferlibrarycollections.org/modules/Scripto/src/Job/SyncProject.php(37): Scripto\Job\SyncProject->syncProjectMedia(Object(Scripto\Entity\ScriptoProject))
#10 /home/schaffer/dev.schafferlibrarycollections.org/modules/Scripto/src/Job/SyncProject.php(22): Scripto\Job\SyncProject->syncProject(Object(Scripto\Entity\ScriptoProject))
#11 /home/schaffer/dev.schafferlibrarycollections.org/application/src/Job/DispatchStrategy/Synchronous.php(34): Scripto\Job\SyncProject->perform()
#12 /home/schaffer/dev.schafferlibrarycollections.org/application/src/Job/Dispatcher.php(105): Omeka\Job\DispatchStrategy\Synchronous->send(Object(Omeka\Entity\Job))
#13 /home/schaffer/dev.schafferlibrarycollections.org/application/data/scripts/perform-job.php(66): Omeka\Job\Dispatcher->send(Object(Omeka\Entity\Job), Object(Omeka\Job\DispatchStrategy\Synchronous))
#14 {main}

Nothing pops out at me as being responsible for the error. You say it only happens when syncing items that have more than one media? That seems like a good lead, but it still makes no sense to me. Anyway, I can’t reproduce the error. I don’t see anything the MariaDB release notes that indicates a bug when inserting null in default null columns, but perhaps an upgrade of your database could rule out an environmental database issue.

Ok, I really appreciate you taking a look at this. I’m not sure if I can upgrade the database as it’s at the control of our hosting provider, but I am contacting them to see if there’s anything they can do there. Thanks again!