Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Craft Upgrade 2 -> 3 Deprecation Error Prior To Migrations Causing "Integrity constraint violation" #3324

Closed
JamesPitchStudio opened this issue Sep 24, 2018 · 1 comment

Comments

@JamesPitchStudio
Copy link

Description

I am upgrading a Craft 2 site to Craft 3, following the documentation on upgrading. I copied changes from my general.php config file over (namely allowAutoUpdates false for production) which evidently has been renamed to allowUpdates in Craft 3.

When hooking the fresh Craft 3 installation up to the Craft 2 database and trying to navigate to /admin (step 11), I get this error (below) prior to seeing the update prompt.

The Craft 3 deprecation code is running on a Craft 2 database, where evidently that line field is not yet allowed to be null (but post the Craft 3 migrations it would be).

Bit of an edge case but thought I'd let you know!

Steps to reproduce

This is as if going through the Craft 2 to Craft 3 upgrade process.

  1. Get a Craft 2 database.
  2. Install Craft 3 and hook it up to the Craft 2 database as if going through the upgrade process.
  3. In config/general.php set "'allowAutoUpdates' => FALSE,".
  4. Go to the Craft 3 /admin page.
  5. Explosions.

Additional info

  • Craft version: Craft CMS 2.7.0 & 2.7.2 -> Craft 3
  • PHP version: 7.2.1
  • Database driver & version: MySQL 5.6.38
  • Plugins & versions: Not relevant.

Error

Integrity constraint violation – yii\db\IntegrityException
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'line' cannot be null

The SQL being executed was: INSERT INTO craft_deprecationerrors (lastOccurrence, file, line, message, traces, dateCreated, dateUpdated, uid, key, fingerprint) VALUES ('2018-09-24 22:53:47', '(path to my project)/config/general.php', NULL, 'The allowAutoUpdates config setting has been renamed to allowUpdates.', '[{"objectClass":"craft\\services\\Deprecator","file":"(path to my project)/vendor/craftcms/cms/src/config/GeneralConfig.php","line":755,"class":"craft\ etc...

@brandonkelly
Copy link
Member

Thanks for pointing that out! Just fixed for the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants