[SOLVED] Exception on updating from Neos 4.1 to 4.2 using PostgreSQL

Hello, i have a base neos installation on my debian vm with the demo project only. On that, i’m running PHP 7.2.14 with PostgreSQL 10.6-1.

After the step ./flow doctrine:migrate, written in the upgrade instructions on this page: https://www.neos.io/download-and-extend/upgrade-instructions-4-1-4-2.html, i’ve got the following error:

An exception occurred while executing 'ALTER TABLE neos_media_domain_model_asset ADD copyrightnotice TEXT NOT NULL':

    SQLSTATE[23502]: Not null violation: 7 FEHLER:  Spalte »copyrightnotice« enthält NULL-Werte

    The exception details have been logged to the Flow system log.
    Exception in line 184 of /home/webserver/neos2/Packages/Libraries/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php: An exception occurred while executing 'ALTER TABLE neos_media_domain_model_asset ADD copyrightnotice TEXT NOT NULL':

So the entry "copyrightnotice" is not created in the Table "neos_media_domain_model_asset". I've tried to add it manually via my SQL Software Adminer, but the same error occurs: "FEHLER: Spalte »copyrightnotice« enthält NULL-Werte"

I’m kinda sure this has something todo with my PostgreSQL: (Commit: https://github.com/neos/neos-development-collection/commit/7584a1d6ef3666c471a5ae9147dd585c6cf77a7c)

$this->abortIf($this->connection->getDatabasePlatform()->getName() != ‘mysql’, ‘Migration can only be executed safely on “mysql”.’

Is there any hint for that without adding a default value for this entry?

Thank you very much!

/update:

My workaround for that was now:

  1. Added the column copyrightnotice to neos_media_domain_model_asset with a default value like “Test”.

  2. Deleted the default value and unsetted it, it worked

  3. Ran ./flow doctrine:migrate again and got the following error:

    An exception occurred while executing ‘ALTER TABLE neos_media_domain_model_asset ADD copyrightnotice TEXT NOT NULL’:

    SQLSTATE[42701]: Duplicate column: 7 FEHLER: Spalte »copyrightnotice« von Relation »neos_media_domain_model_asset« existiert bereits

    The exception details have been logged to the Flow system log.
    Exception in line 184 of /home/webserver/neos2/Packages/Libraries/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php: An exception occurred while executing ‘ALTER TABLE neos_media_domain_model_asset ADD copyrightnotice TEXT NOT NULL’:

    SQLSTATE[42701]: Duplicate column: 7 FEHLER: Spalte »copyrightnotice« von Relation »neos_media_domain_model_asset« existiert bereits - See also: 201901291221507b939d.txt

  4. It was possible to see the image on the Neos Demosite on the frontpage again. Even the backend said Neos 4.2 (at least i see the new login image). But i’m still not sure if it’s fine now or if i broke something.

  5. Of course, every image has now the attribute “Test” as default value for the copyright

Hey Benjamin,

Correct, with that change a bug with postgres sneaked in which is fixed with https://github.com/neos/neos-development-collection/pull/2342 - but we had no release since then.

But we are currently doing releases, so it should be fixed by tomorrow.

Cheers,
Daniel

1 Like

Hello Daniel,

thank you the clarification! Have a great day! :slight_smile:

Greetings,
Benjamin