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

CakePHP 3.0 Undefined index: on_update #6230

Closed
StanekP opened this issue Mar 31, 2015 · 17 comments
Closed

CakePHP 3.0 Undefined index: on_update #6230

StanekP opened this issue Mar 31, 2015 · 17 comments

Comments

@StanekP
Copy link

StanekP commented Mar 31, 2015

Sometimes get those errors:
Notice (8): Undefined index: on_update [CORE/src/Database/Schema/SqliteSchema.php, line 214]
Notice (8): Undefined index: on_delete [CORE/src/Database/Schema/SqliteSchema.php, line 215]

I use mysql and php 5.5

Logs from debug.log:
2015-03-31 15:02:20 Notice: Notice (8): Undefined index: on_update in [/home/users/muzyczni/public_html/vendor/cakephp/cakephp/src/Database/Schema/SqliteSchema.php, line 214]
Trace:
Cake\Error\BaseErrorHandler::handleError() - CORE/src/Error/BaseErrorHandler.php, line 138
Cake\Database\Schema\SqliteSchema::convertForeignKeyDescription() - CORE/src/Database/Schema/SqliteSchema.php, line 214
Cake\Database\Schema\Collection::_reflect() - CORE/src/Database/Schema/Collection.php, line 133
Cake\Database\Schema\Collection::describe() - CORE/src/Database/Schema/Collection.php, line 102
Cake\Database\Schema\CachedCollection::describe() - CORE/src/Database/Schema/CachedCollection.php, line 65
Cake\ORM\Table::schema() - CORE/src/ORM/Table.php, line 422
Cake\ORM\Marshaller::one() - CORE/src/ORM/Marshaller.php, line 107
Cake\ORM\Table::newEntity() - CORE/src/ORM/Table.php, line 1953
Cake\ORM\Association::__call() - CORE/src/ORM/Association.php, line 835
Cake\ORM\Association\HasMany::newEntity() - ROOT/vendor/cakephp/debug_kit/src/Routing/Filter/DebugBarFilter.php, line 207
DebugKit\Routing\Filter\DebugBarFilter::afterDispatch() - ROOT/vendor/cakephp/debug_kit/src/Routing/Filter/DebugBarFilter.php, line 207
Cake\Event\EventManager::_callListener() - CORE/src/Event/EventManager.php, line 385
Cake\Event\EventManager::dispatch() - CORE/src/Event/EventManager.php, line 351
Cake\Routing\Dispatcher::dispatchEvent() - CORE/src/Event/EventManagerTrait.php, line 78
Cake\Routing\Dispatcher::dispatch() - CORE/src/Routing/Dispatcher.php, line 92
[main] - ROOT/webroot/index.php, line 37

2015-03-31 15:02:20 Notice: Notice (8): Undefined index: on_delete in [/home/users/muzyczni/public_html/vendor/cakephp/cakephp/src/Database/Schema/SqliteSchema.php, line 215]
Trace:
Cake\Error\BaseErrorHandler::handleError() - CORE/src/Error/BaseErrorHandler.php, line 138
Cake\Database\Schema\SqliteSchema::convertForeignKeyDescription() - CORE/src/Database/Schema/SqliteSchema.php, line 215
Cake\Database\Schema\Collection::_reflect() - CORE/src/Database/Schema/Collection.php, line 133
Cake\Database\Schema\Collection::describe() - CORE/src/Database/Schema/Collection.php, line 102
Cake\Database\Schema\CachedCollection::describe() - CORE/src/Database/Schema/CachedCollection.php, line 65
Cake\ORM\Table::schema() - CORE/src/ORM/Table.php, line 422
Cake\ORM\Marshaller::one() - CORE/src/ORM/Marshaller.php, line 107
Cake\ORM\Table::newEntity() - CORE/src/ORM/Table.php, line 1953
Cake\ORM\Association::__call() - CORE/src/ORM/Association.php, line 835
Cake\ORM\Association\HasMany::newEntity() - ROOT/vendor/cakephp/debug_kit/src/Routing/Filter/DebugBarFilter.php, line 207
DebugKit\Routing\Filter\DebugBarFilter::afterDispatch() - ROOT/vendor/cakephp/debug_kit/src/Routing/Filter/DebugBarFilter.php, line 207
Cake\Event\EventManager::_callListener() - CORE/src/Event/EventManager.php, line 385
Cake\Event\EventManager::dispatch() - CORE/src/Event/EventManager.php, line 351
Cake\Routing\Dispatcher::dispatchEvent() - CORE/src/Event/EventManagerTrait.php, line 78
Cake\Routing\Dispatcher::dispatch() - CORE/src/Routing/Dispatcher.php, line 92
[main] - ROOT/webroot/index.php, line 37

@lorenzo lorenzo added the ORM label Mar 31, 2015
@lorenzo lorenzo added this to the 3.0.1 milestone Mar 31, 2015
@lorenzo lorenzo added the defect label Mar 31, 2015
@markstory
Copy link
Member

What version of SQLite do you have?

@StanekP
Copy link
Author

StanekP commented Mar 31, 2015

Version of SQLite is 3.5.9 (if is too old for DebugKit, u could add info about it on welcome screen)

@markstory
Copy link
Member

I don't think that's too old, but I would have also expected that reflecting foreign keys would work too.

@markstory markstory modified the milestones: 3.0.1, 3.0.2 Apr 5, 2015
@jhon312020
Copy link

Any update on the above issue? I am too getting the same issue. I am also not using sqllite and I am using only mysql.

@lorenzo
Copy link
Member

lorenzo commented Apr 6, 2015

Foreign keys are supported since SQLite 3.6.19

I would suggest looking into updating your sqlite or PHP version while this issue is investigated.

@markstory
Copy link
Member

@jhon312020 DebugKit uses SQLite which is probably why you are seeing this error even though you are using MySQL for your application.

@markstory markstory self-assigned this Apr 6, 2015
@jhon312020
Copy link

PHP Version 5.4.10 - Will cakephp 3.0.1 will work with this php version?
Mysql Client API version 5.0.77 - Will cakephp 3.0.1 will work with this mysql version?
Upgraded to latest 3.0.1 version of cakephp too.
mbstring extension is enabled.
intl extension is enabled.
SQLite Library

On making app.php "debug" value to true - I am getting the issue "unable to server this request".
When I change "debug" value to true - I am getting the same issue
Notice (8): Undefined index: on_update [CORE/src/Database/Schema/SqliteSchema.php, line 214]
Notice (8): Undefined index: on_delete [CORE/src/Database/Schema/SqliteSchema.php, line 215]

@lorenzo
Copy link
Member

lorenzo commented Apr 7, 2015

@jhon312020 read my comment here: #6230 (comment)

@jhon312020
Copy link

I am not even created a database it is just a fresh copy and I am going to use only mysql. I have also commented the plugin debugkit which uses sqlite by default.

PHP Version 5.4.10 - Will cakephp 3.0.1 will work with this php version?
Mysql Client API version 5.0.77 - Will cakephp 3.0.1 will work with this mysql version?

@lorenzo
Copy link
Member

lorenzo commented Apr 7, 2015

@jhon312020 You can also configure debugkit to sue mysql if you are having troubles with sqlite http://book.cakephp.org/3.0/en/debug-kit.html#database-configuration

@jhon312020
Copy link

@lorenzo - Thanks for your timely responses.

PHP Version 5.4.10 - Will cakephp 3.0.1 will work with this php version?
Mysql Client API version 5.0.77 - Will cakephp 3.0.1 will work with this mysql version?

@dakota
Copy link
Member

dakota commented Apr 7, 2015

@jhon312020
http://book.cakephp.org/3.0/en/installation.html#requirements states PHP 5.4.16 minimum, as far as I know this is due to a bug in earlier versions of PHP 5.4

Your MySQL Client doesn't matter too much (The server version is the important one), requirements document states 5.1.10.

Easiest way to find out if it will work is to try it!

@jhon312020
Copy link

@dakota I tried but getting the following
On making app.php debug value to true - I am getting the issue unable to serve this request.
When I change debug value to false - I am getting the issue
Notice (8): Undefined index: on_update [CORE/src/Database/Schema/SqliteSchema.php, line 214]
Notice (8): Undefined index: on_delete [CORE/src/Database/Schema/SqliteSchema.php, line 215]

or sometimes this
unable to serve this request.

@dakota
Copy link
Member

dakota commented Apr 7, 2015

@jhon312020 That's got nothing to do with MySQL, see #6230 (comment)

You need to updated your Sqlite version, or configure DebugKit to use MySQL.

@jhon312020
Copy link

@dakota I added the debug_kit to app.php pointing to mysql. Then also getting the same result

Notice (8): Undefined index: on_update [CORE/src/Database/Schema/SqliteSchema.php, line 214]
Notice (8): Undefined index: on_delete [CORE/src/Database/Schema/SqliteSchema.php, line 215]

or sometimes this
unable to serve this request.

@ceeram
Copy link
Contributor

ceeram commented Apr 7, 2015

@jhon312020 perhaps drop by on irc to get support on getting things to work and keep this issue tracker for actual bugs.

markstory added a commit that referenced this issue Apr 9, 2015
SQLite prior to 3.6 does not support reflecting foreign key
update/delete properties. Conditionally parsing them is better than
notice errors.

Refs #6230
@markstory
Copy link
Member

Fixed in #6302

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

No branches or pull requests

6 participants