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

3.2.0 Error when draft auto saving - can't save any edits #4515

Closed
amperand opened this issue Jul 10, 2019 · 12 comments
Closed

3.2.0 Error when draft auto saving - can't save any edits #4515

amperand opened this issue Jul 10, 2019 · 12 comments

Comments

@amperand
Copy link

amperand commented Jul 10, 2019

Description

I'm unable to save updates as the auto draft save feature is throwing an error. The update entry button remains grayed out.

Console.log shows POST index.php?p=admin%2Factions%2F/entry-revisions/save-draft 500 (jquery.js:9827)

Steps to reproduce

  1. Make any change to a field
  2. Shows unknown error over and over

Additional info

  • Craft version: 3.2.0
  • PHP version: 7.3.7
  • Database driver & version: MySQL 5.5.60
  • Plugins & versions:

Control Panel CSS | 2.2.0
Feed Me 4.1.1
Minify 1.2.9
Neo 2.3.5
Redactor 2.3.3.2
Relabel 1.3.2
SEO 3.5.4
Video Embedder 1.1.3

@brandonkelly
Copy link
Member

Try clearing out your storage/logs/ folder, then reproduce the error, and then search storage/logs/web.log for [error]. Can you please post the error details, including the stack trace?

@khalwat
Copy link
Contributor

khalwat commented Jul 11, 2019

Getting what I assume to be a similar/same error:

2019-07-10 21:14:20 [-][1][-][error][yii\db\IntegrityException] PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`craft3`.`drafts`, CONSTRAINT `drafts_revisionId_fk` FOREIGN KEY (`revisionId`) REFERENCES `revisions` (`id`) ON DELETE SET NULL) in /home/vagrant/sites/craft3/vendor/yiisoft/yii2/db/Command.php:1290
Stack trace:
#0 /home/vagrant/sites/craft3/vendor/yiisoft/yii2/db/Command.php(1290): PDOStatement->execute()
#1 /home/vagrant/sites/craft3/vendor/yiisoft/yii2/db/Command.php(1091): yii\db\Command->internalExecute('INSERT INTO `dr...')
#2 /home/vagrant/sites/craft3/vendor/craftcms/cms/src/services/Drafts.php(357): yii\db\Command->execute()
#3 /home/vagrant/sites/craft3/vendor/craftcms/cms/src/services/Drafts.php(138): craft\services\Drafts->_insertDraftRow(2, 68, 1, 'Draft 2', NULL)
#4 /home/vagrant/sites/craft3/vendor/craftcms/cms/src/controllers/EntryRevisionsController.php(205): craft\services\Drafts->createDraft(Object(craft\elements\Entry), 1)
#5 [internal function]: craft\controllers\EntryRevisionsController->actionSaveDraft()
#6 /home/vagrant/sites/craft3/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#7 /home/vagrant/sites/craft3/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#8 /home/vagrant/sites/craft3/vendor/craftcms/cms/src/web/Controller.php(187): yii\base\Controller->runAction('save-draft', Array)
#9 /home/vagrant/sites/craft3/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('save-draft', Array)
#10 /home/vagrant/sites/craft3/vendor/craftcms/cms/src/web/Application.php(298): yii\base\Module->runAction('entry-revisions...', Array)
#11 /home/vagrant/sites/craft3/vendor/craftcms/cms/src/web/Application.php(565): craft\web\Application->runAction('entry-revisions...', Array)
#12 /home/vagrant/sites/craft3/vendor/craftcms/cms/src/web/Application.php(277): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#13 /home/vagrant/sites/craft3/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#14 /home/vagrant/sites/craft3/web/index.php(17): yii\base\Application->run()
#15 {main}

@brandonkelly
Copy link
Member

@khalwat can you send your composer.json and composer.lock files, and a database backup, over to [email protected]?

@brandonkelly
Copy link
Member

We’ve fixed a couple entry/draft-saving bugs for the next release. Unrelated to the error @khalwat is getting, but might help you, @amperand, and others.

To get the fixes early, change your craftcms/cms requirement in composer.json to:

"require": {
  "craftcms/cms": "dev-develop#43d22b4403fb555e1d8db3efc4b9978071b1deb5 as 3.2.0",
  "...": "..."
}

Then run composer update.

@brandonkelly
Copy link
Member

Just fixed @khalwat’s issue, which occurred when editing an entry that had enough revisions to reach the maxRevisions config setting.

To get the fix early, change your craftcms/cms requirement in composer.json to:

"require": {
  "craftcms/cms": "dev-develop#179745dff7716446d768b0eaec0152b4c8b1f3d0 as 3.2.1",
  "...": "..."
}

Then run composer update.

@DavidKabelitz
Copy link

DavidKabelitz commented Nov 22, 2019

Hi @brandonkelly ,
i have the same issue with everything update.

Log Attached:

2019-11-22 16:55:35 [-][1][7d99convq56ok9dk74ibkrtpo8][error][yii\web\HttpException:404] yii\web\NotFoundHttpException: Template not found: favicon.ico in /home/ubuntu/clevershuttle3/code/craft/vendor/craftcms/cms/src/controllers/TemplatesController.php:93
Stack trace:
#0 [internal function]: craft\controllers\TemplatesController->actionRender('favicon.ico', Array)
#1 /home/ubuntu/clevershuttle3/code/craft/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#2 /home/ubuntu/clevershuttle3/code/craft/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#3 /home/ubuntu/clevershuttle3/code/craft/vendor/craftcms/cms/src/web/Controller.php(187): yii\base\Controller->runAction('render', Array)
#4 /home/ubuntu/clevershuttle3/code/craft/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('render', Array)
#5 /home/ubuntu/clevershuttle3/code/craft/vendor/craftcms/cms/src/web/Application.php(299): yii\base\Module->runAction('templates/rende...', Array)
#6 /home/ubuntu/clevershuttle3/code/craft/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('templates/rende...', Array)
#7 /home/ubuntu/clevershuttle3/code/craft/vendor/craftcms/cms/src/web/Application.php(284): yii\web\Application->handleRequest(Object(craft\web\Request))
#8 /home/ubuntu/clevershuttle3/code/craft/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#9 /home/ubuntu/clevershuttle3/code/craft/web/index.php(21): yii\base\Application->run()
#10 {main}
2019-11-22 16:55:35 [-][1][7d99convq56ok9dk74ibkrtpo8][info][application] $_GET = [
    'p' => '/favicon.ico'
]

$_POST = []

$_FILES = []

$_COOKIE = [
    '_ga' => 'GA1.2.2021766046.1526458768'
    'b7f8b7303b26401fc4cd54a10cedf9d7username' => 'c01df09212f337c2ffc6ebfe7d1f4da6f63a5444s:56:\"66a7fb4d4dae47a309c79a377fa09de552d53048czo1OiJhZG1pbiI7\";'
    '__stripe_mid' => '1c40d2dd-f96d-41b5-b861-f2b787206208'
    '_fbp' => 'fb.1.1549547497663.1256661501'
    '1031b8c41dfff97a311a7ac99863bdc5_username' => '692eeff77a90be00c412e0a450c8b5a4242e14df4acf0a1b62ce9bdf19719c67a:2:{i:0;s:41:\"1031b8c41dfff97a311a7ac99863bdc5_username\";i:1;s:5:\"admin\";}'
    'hidecookieconsent' => '1'
    'CRAFT_CSRF_TOKEN' => '•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••'
    '_gid' => 'GA1.2.1522995192.1574258780'
    '_fbc' => 'fb.1.1574328085445.IwAR0L3wHzSpnPsQWukO7VDYacwEEmUAtgQ-TB3gExoZLqSd1h38v-_IX7WZ0'
    'CraftSessionId' => '7d99convq56ok9dk74ibkrtpo8'
    '1031b8c41dfff97a311a7ac99863bdc5_identity' => 'ffff739f6e7f220bacd628a4eea1ab2706f20c75f1a57bac8b86af55fdc52415a:2:{i:0;s:41:\"1031b8c41dfff97a311a7ac99863bdc5_identity\";i:1;s:250:\"[\"1\",\"[\\\"7ayhz8j0RlgVvgF9tK4ta_X_JkZABQDJhWRzwc6B_AzrEge4EDhZ56TwK6L7dg_RY5sBAQku8A98W0okvU9NWoeY5tdsLhrD_PUs\\\",null,\\\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36\\\"]\",3600]\";}'
]

$_SESSION = [
    'bd62416aa8538ede709019a5e113eea5__flash' => []
    '1031b8c41dfff97a311a7ac99863bdc5__token' => '••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••'
    '1031b8c41dfff97a311a7ac99863bdc5__id' => '1'
    '1031b8c41dfff97a311a7ac99863bdc5__expire' => 1574441735
    'bd62416aa8538ede709019a5e113eea5__auth_access' => [
        0 => 'previewElement:12'
        1 => 'saveAssetInVolume:1'
        2 => 'previewElement:6'
    ]
    'enableDebugToolbarForCp' => true
]

@brandonkelly
Copy link
Member

@DavidKabelitz The bugfix came in Craft 3.2.2, and in the same version we also removed the foreign key that is referenced in your error log. Sooo that means you must be on a prior version than 3.2.2.

@DavidKabelitz
Copy link

@brandonkelly no we are running on 3.3.15...

Thats the setup:

PHP version | 7.2.24
Linux 4.4.0-1096-aws
MySQL 5.7.27
Craft Pro 3.3.15

@brandonkelly
Copy link
Member

In that case, this migration must not have run successfully. Check your drafts table and see if it has a revisionId column to confirm.

Do you remember ever getting any update errors?

@DavidKabelitz
Copy link

no its not there, just at the elements table is a revisionId field. Yes migration was a a bit tricky after big version jump. In that time we were already in loop with you guys.

@DavidKabelitz
Copy link

ok it's fixed. It was caused by an option field with new values. A bit strange...

@brandonkelly
Copy link
Member

Sorry, I was accidentally looking at the error log in #4515 (comment) rather than the one you just posted. The one you posted doesn’t have anything revealing; it’s just a 404 error for /favicon.ico. Glad you got it sorted though!

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

4 participants