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 2 > 3 update failure #3031

Closed
jamielaughton opened this issue Jun 26, 2018 · 1 comment
Closed

Craft 2 > 3 update failure #3031

jamielaughton opened this issue Jun 26, 2018 · 1 comment

Comments

@jamielaughton
Copy link

jamielaughton commented Jun 26, 2018

Description

I'm upgrading my site to craft 3 (localhost using mamp) by following docs: https://docs.craftcms.com/v3/upgrade.html

On step 9 I am getting the errors:

'One of Craft CMS’s migrations failed.'

Database Exception: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
The SQL being executed was: ALTER TABLE craft_routes CHANGE urlParts uriParts

Migration: craft\migrations\m160925_113941_route_uri_parts

Output:

rename column urlParts in table {{%routes}} to uriParts ...Exception: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
The SQL being executed was: ALTER TABLE craft_routes CHANGE urlParts uriParts (/Users/jamie/Documents/repos/_craft-3/public_html/vendor/yiisoft/yii2/db/Schema.php:664)
#0 /Users/jamie/Documents/repos/_craft-3/public_html/vendor/yiisoft/yii2/db/Command.php(1263): yii\db\Schema->convertException(Object(PDOException), 'ALTER TABLE cr...')
#1 /Users/jamie/Documents/repos/_craft-3/public_html/vendor/yiisoft/yii2/db/Command.php(1075): yii\db\Command->internalExecute('ALTER TABLE cr...')
#2 /Users/jamie/Documents/repos/_craft-3/public_html/vendor/yiisoft/yii2/db/Migration.php(405): yii\db\Command->execute()
#3 /Users/jamie/Documents/repos/_craft-3/public_html/vendor/craftcms/cms/src/migrations/m160925_113941_route_uri_parts.php(20): yii\db\Migration->renameColumn('{{%routes}}', 'urlParts', 'uriParts')
#4 /Users/jamie/Documents/repos/_craft-3/public_html/vendor/craftcms/cms/src/db/Migration.php(56): craft\migrations\m160925_113941_route_uri_parts->safeUp()
#5 /Users/jamie/Documents/repos/_craft-3/public_html/vendor/craftcms/cms/src/db/MigrationManager.php(243): craft\db\Migration->up(true)
#6 /Users/jamie/Documents/repos/_craft-3/public_html/vendor/craftcms/cms/src/db/MigrationManager.php(163): craft\db\MigrationManager->migrateUp(Object(craft\migrations\m160925_113941_route_uri_parts))
#7 /Users/jamie/Documents/repos/_craft-3/public_html/vendor/craftcms/cms/src/services/Updates.php(207): craft\db\MigrationManager->up()
#8 /Users/jamie/Documents/repos/_craft-3/public_html/vendor/craftcms/cms/src/controllers/BaseUpdaterController.php(435): craft\services\Updates->runMigrations(Array)
#9 /Users/jamie/Documents/repos/_craft-3/public_html/vendor/craftcms/cms/src/controllers/UpdaterController.php(207): craft\controllers\BaseUpdaterController->runMigrations(Array, 'restore-db')
#10 [internal function]: craft\controllers\UpdaterController->actionMigrate()
#11 /Users/jamie/Documents/repos/_craft-3/public_html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#12 /Users/jamie/Documents/repos/_craft-3/public_html/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#13 /Users/jamie/Documents/repos/_craft-3/public_html/vendor/craftcms/cms/src/web/Controller.php(103): yii\base\Controller->runAction('migrate', Array)
#14 /Users/jamie/Documents/repos/_craft-3/public_html/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('migrate', Array)
#15 /Users/jamie/Documents/repos/_craft-3/public_html/vendor/craftcms/cms/src/web/Application.php(273): yii\base\Module->runAction('updater/migrate', Array)
#16 /Users/jamie/Documents/repos/_craft-3/public_html/vendor/craftcms/cms/src/web/Application.php(643): craft\web\Application->runAction('updater/migrate')
#17 /Users/jamie/Documents/repos/_craft-3/public_html/vendor/craftcms/cms/src/web/Application.php(204): craft\web\Application->_processUpdateLogic(Object(craft\web\Request))
#18 /Users/jamie/Documents/repos/_craft-3/public_html/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#19 /Users/jamie/Documents/repos/_craft-3/public_html/public/index.php(21): yii\base\Application->run()
#20 {main}

Any help would be greately appreciated

Steps to reproduce

  1. follow steps in https://docs.craftcms.com/v3/upgrade.html#performing-the-upgrade

Additional info

  • PHP version: 7.2.1
  • Database driver & version: SQL 5.6.38
@jamielaughton jamielaughton changed the title Craft CMS update failure - Craft 2 > 3 update failure Jun 26, 2018
@brandonkelly
Copy link
Member

Per the error message, this is the SQL query that was executed:

ALTER TABLE craft_routes CHANGE urlParts uriParts

There should be a column type definition after uriParts though. Looking through the code, the only way the column type definition would have been omitted is if the urlParts column didn’t exist in the first place.

Do you have a database backup from before you attempted the Craft 3 upgrade? If so please restore it, clear out your storage/logs/ folder, and try the upgrade again. If you still get the same error, we can take a look – you can send your backup to [email protected].

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