carsonbot: Cannot create task after upgrading Doctrine
This error shows up in the log:
app.ERROR: Failed dispatching “pull_request” event for “carsonbot-playground/symfony” repository. {“exception”:"[object] (Doctrine\DBAL\Exception\NotNullConstraintViolationException(code: 0): An exception occurred while executing ‘INSERT INTO task (repository_full_name, number, action, created_at, updated_at, verify_after) VALUES (?, ?, ?, ?, ?, ?)’ with params ["carsonbot-playground\/symfony", 22, 4, "2021-05-31 14:10:11", "2021-05-31 14:10:11", "2021-06-01 10:10:11"]:\n\nSQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "id" violates not-null constraint\nDETAIL: Failing row contains (null, carsonbot-playground/symfony, 22, 4, 2021-05-31 14:10:11, 2021-05-31 14:10:11, 2021-06-01 10:10:11). at /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php:64)\n[previous exception] [object] (Doctrine\DBAL\Driver\PDO\Exception(code: 23502): SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "id" violates
Here is the only place we create a Task:
This error was fixed by PR #181. It just downgraded doctrine packages.
- Removing doctrine/deprecations (v0.5.3)
- Downgrading doctrine/common (3.1.2 => 3.0.2)
- Downgrading doctrine/dbal (2.13.1 => 2.10.4)
- Downgrading doctrine/doctrine-bundle (2.3.2 => 2.2.1)
- Downgrading doctrine/inflector (2.0.3 => 1.4.4)
- Downgrading doctrine/migrations (3.1.2 => 3.1.1)
- Downgrading doctrine/orm (2.8.4 => 2.7.4)
Let’s update them one by one.
- Upgrade to doctrine/common 3.1.2
- Upgrade to doctrine/dbal 2.13.1
- Upgrade to doctrine/doctrine-bundle 2.3.2
- Upgrade to doctrine/inflector 2.0.3
- Upgrade to doctrine/migrations 3.1.2
- Upgrade to doctrine/orm 2.8.4
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (19 by maintainers)
Commits related to this issue
- bug #181 Downgrade doctrine (Nyholm) This PR was merged into the master branch. Discussion ---------- Downgrade doctrine Trying to fix issue #179 ``` - Removing doctrine/deprecations (v0.5.3) ... — committed to symfony-tools/carsonbot by weaverryan 3 years ago
- feature #183 Update to doctrine/common 3.1.2 (Nyholm) This PR was merged into the master branch. Discussion ---------- Update to doctrine/common 3.1.2 Related to #179 Commits ------- 327d010 Use... — committed to symfony-tools/carsonbot by weaverryan 3 years ago
- feature #185 Update to doctrine/doctrine-bundle: 2.3.2 (Nyholm) This PR was merged into the master branch. Discussion ---------- Update to doctrine/doctrine-bundle: 2.3.2 Related to #179 Commits ... — committed to symfony-tools/carsonbot by weaverryan 3 years ago
- bug #186 Downgrade to doctrine/doctrine-bundle: 2.2.4 (Nyholm) This PR was merged into the master branch. Discussion ---------- Downgrade to doctrine/doctrine-bundle: 2.2.4 I hope this will fix th... — committed to symfony-tools/carsonbot by weaverryan 3 years ago
- feature #187 Update to doctrine/doctrine-bundle 2.3.0 (Nyholm) This PR was merged into the master branch. Discussion ---------- Update to doctrine/doctrine-bundle 2.3.0 Related to #179 Commits --... — committed to symfony-tools/carsonbot by weaverryan 3 years ago
- bug #188 Revert back to doctrine/doctrine-bundle: 2.2.4 (Nyholm) This PR was merged into the master branch. Discussion ---------- Revert back to doctrine/doctrine-bundle: 2.2.4 Related to #179 Co... — committed to symfony-tools/carsonbot by weaverryan 3 years ago
- feature #190 Specify production values for doctrine dbal (Nyholm) This PR was merged into the master branch. Discussion ---------- Specify production values for doctrine dbal Related to #179 Comm... — committed to symfony-tools/carsonbot by weaverryan 3 years ago
- bug #192 Use postgres as default in .env (Nyholm) This PR was squashed before being merged into the master branch. Discussion ---------- Use postgres as default in .env This is related to #179 ~~... — committed to symfony-tools/carsonbot by weaverryan 3 years ago
and so, the solution for that is either to put a postgresql URL in the
.env
for the fallback value, or maybe to set the driver explicitly in YAML (but maybe the fake URL from.env
will still win, not sure).@Nyholm can you try configuring the db driver and server versions explicitly in the DBAL config instead of extracting them from the credentials URL ? DoctrineBundle 2.3.0 introduces a new metadata caching configuration that automatically cache the mapping during the cache-warmup (enabled only in non-debug mode, which might explain why you don’t see the issue in dev). If you run the cache-warmup without the DB credentials in the env variables, the ORM might receive the wrong DB platform when generating the metadata, which would cache the wrong metadata (and so potentially break things)