Error Deleting Express Object

Permalink 26 12 Browser Info Environment
I originally installed v8.0.0 created the Express object in question then upgraded to 8.0.3 and got this error when trying to delete the express object via System & Settings > Express > Object Details > Edit Entity > Delete:

An exception occurred while executing 'DELETE FROM ExpressEntities WHERE id = ?' with params ["053c6255-c7a5-11e6-89ce-000af72addfc"]: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`builtwithconcret_devdb`.`ExpressEntityAssociations`, CONSTRAINT `FK_98A0F796E9BBEE93` FOREIGN KEY (`source_entity_id`) REFERENCES `ExpressEntities` (`id`))


Status: New
afixia
madesimplemedia replied on at Permalink Reply
madesimplemedia
Entities created after updating can be deleted fine.
JohntheFish replied on at Permalink Reply
JohntheFish
I get the same bug, differing only in the details of my site path
OKDnet replied on at Permalink Reply
OKDnet
Same problem. I even tried deleting attributes, Associations, etc. first. In fact, while I could remove an Association, DELETING ATTRIBUTES ALSO FAILS with the SAME ERROR.

It's like once you create an object, you can't get rid of it.
OKDnet replied on at Permalink Reply
OKDnet
Duplicate removed
OKDnet replied on at Permalink Reply
OKDnet
Duplicate removed
tdausner replied on at Permalink Reply
tdausner
With phpMyAdmin I tried to first delete the entry from table "ExpressEntity" giving the same constraint error.

Deleting the corresponding entry from table "ExpressEntityAssociations" and next from table "ExpressEntity" works fine. Probably this doesn't reflect in the code?

Error message for recollection:

An exception occurred while executing 'DELETE FROM ExpressEntities WHERE id = ?' with params ["f5ce8010-db59-11e6-99ec-1cc1de5d0172"]: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`mdennebaum_dive_inspi`.`expressentityassociations`, CONSTRAINT `FK_98A0F796B5910F71` FOREIGN KEY (`target_entity_id`) REFERENCES `ExpressEntities` (`id`))
OKDnet replied on at Permalink Reply
OKDnet
I think this is related. When I try to import my entire staging site database into an empty database (in phpMyAdmin) with default options, it fails every time with the following error
Error
SQL query:
--
-- Constraints for table `atBoolean`
--
ALTER TABLE  `atBoolean` ADD CONSTRAINT  `FK_5D5F70A9A2A82A5D` FOREIGN KEY (  `avID` ) REFERENCES  `AttributeValues` (  `avID` ) ;
MySQL said: Documentation
#1452 - Cannot add or update a child row: a foreign key constraint fails (`mynew_databasename`.`#sql-2f70_2fe0e`, CONSTRAINT `FK_5D5F70A9A2A82A5D` FOREIGN KEY (`avID`) REFERENCES `AttributeValues` (`avID`))
tdausner replied on at Permalink Reply
tdausner
That's why such dependencies shoul reflect in the code.
OKDnet replied on at Permalink Reply
OKDnet
Do you think this is the same issue? I get this when trying to UPDATE an Express Object, which is a real problem.
Doctrine \ DBAL \ Exception \ InvalidFieldNameException
An exception occurred while executing 'UPDATE DemoThemeExpressSearchIndexAttributes SET ak_theme_default_device = ? WHERE exEntryID = ?' with params [null, 41]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ak_theme_default_device' in 'field list
I'm wondering if this is a different bug (and should be entered as such).
tdausner replied on at Permalink Reply
tdausner
No, imho it's a different cause, so you ought to enter this case as a new bug report.

Looking at the DB having entered an express data object DemoTheme, I do find exact one column "exEntryId". The error message you supplied shows a miss for a column "ak_theme_default_device".

This is probably an error.

cheers!
OKDnet replied on at Permalink Reply
OKDnet
demo_theme is the Express Object handle. theme_default_device is the handle for a Select Attribute of that object. Something I noticed is it is somewhat intermittent. When I make a change to a completely different attribute, hte update (save) fails with this error almost without fail the first time. However, simply using the browser back button and clicking save again will work, if not the first time, after a few tries.
andrew replied on at Permalink Reply
andrew
This is valid and will be fixed in 8.1.
hartmatthews replied on at Permalink Reply
I have a remarkably similar error occurring when I try to create a new blog post:

"An exception occurred while executing 'UPDATE atTopic SET avID = ? WHERE avID = ?' with params [1052, "497"]: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`nchomeopath_com_2`.`atSelectedTopics`, CONSTRAINT `FK_E42A7D5BA2A82A5D` FOREIGN KEY (`avID`) REFERENCES `atTopic` (`avID`))"

Initially, I thought it was a null intermediate folder that my Topics had somehow been filed in. But fixing the Topic tree didn't fix the error. And then I found this thread and wondered about the bug ..., only I'm already running 8.0.3.

I cannot work around it by hitting the back button or coming at it from Composer. I just cannot create a new blog post at all.

Andrew, if this is a different issue, I'll be happy to start a new thread.
hartmatthews replied on at Permalink Reply
Whoops. On re-reading, noticed this would be resolved in 8.1. Is there any way to create a blog post in the meantime??
preichner replied on at Permalink Reply
preichner
This is still not fixed in 8.1
preichner replied on at Permalink Reply
preichner
This is still not fixed in 8.1
BGR replied on at Permalink Reply
I'm running version 8.2.1 and experienced this problem trying to delete an express object:

An exception occurred while executing 'DELETE FROM ExpressEntities WHERE id = ?' with params ["1b0ee3d0-dbe9-11e7-8407-00155d216b00"]: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`kb`.`expressentityentries`, CONSTRAINT `FK_B8AE3531AFC87D03` FOREIGN KEY (`exEntryEntityID`) REFERENCES `expressentities` (`id`))

Edit:
Looking in phpMyAdmin I found that entries in the 'expressentityentries' table which I deleted from within the dashboard were not deleted in the DB. After deleting these entries I was able to delete the Express Object.
afixia replied on at Permalink Reply
afixia
Ran in to the in 8.5.4. Also note, that when trying to deselect all associated records then save the record, the system requires at lease one association be checked even though there is nothing in the Form check to require this.

An exception occurred while executing 'DELETE FROM ExpressEntityEntryAssociations WHERE id = ?' with params [252]: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`electros_conc148`.`_ExpressEntityAssociationSelectedEntries`, CONSTRAINT `FK_1F9C570CBF396750` FOREIGN KEY (`id`) REFERENCES `ExpressEntityEntryAssociations` (`id`))

concrete5 Environment Information

# concrete5 Version
Core Version - 8.0.3
Version Installed - 8.0.3
Database Version - 20161216000000

# concrete5 Packages
Page List+ (2.0.0)

# concrete5 Overrides
languages/pt_BR/LC_MESSAGES/messages.mo, languages/pt_BR/LC_MESSAGES, languages/pt_BR, languages/ru_RU/LC_MESSAGES/messages.mo, languages/ru_RU/LC_MESSAGES, languages/ru_RU, languages/ja_JP/LC_MESSAGES/messages.mo, languages/ja_JP/LC_MESSAGES, languages/ja_JP, languages/el_GR/LC_MESSAGES/messages.mo, languages/el_GR/LC_MESSAGES, languages/el_GR, languages/es_PE/LC_MESSAGES/messages.mo, languages/es_PE/LC_MESSAGES, languages/es_PE, languages/da_DK/LC_MESSAGES/messages.mo, languages/da_DK/LC_MESSAGES, languages/da_DK, languages/nl_NL/LC_MESSAGES/messages.mo, languages/nl_NL/LC_MESSAGES, languages/nl_NL, languages/fi_FI/LC_MESSAGES/messages.mo, languages/fi_FI/LC_MESSAGES, languages/fi_FI, languages/de_DE/LC_MESSAGES/messages.mo, languages/de_DE/LC_MESSAGES, languages/de_DE, languages/es_PY/LC_MESSAGES/messages.mo, languages/es_PY/LC_MESSAGES, languages/es_PY, languages/nb_NO/LC_MESSAGES/messages.mo, languages/nb_NO/LC_MESSAGES, languages/nb_NO, languages/en_GB/LC_MESSAGES/messages.mo, languages/en_GB/LC_MESSAGES, languages/en_GB, languages/cs_CZ/LC_MESSAGES/messages.mo, languages/cs_CZ/LC_MESSAGES, languages/cs_CZ, languages/sv_SE/LC_MESSAGES/messages.mo, languages/sv_SE/LC_MESSAGES, languages/sv_SE, languages/it_IT/LC_MESSAGES/messages.mo, languages/it_IT/LC_MESSAGES, languages/it_IT, themes/builtwithconcrete5/images/pagetypes/right-sidebar.png, themes/builtwithconcrete5/images/pagetypes/four-columns.png, themes/builtwithconcrete5/images/pagetypes/news-page.png, themes/builtwithconcrete5/images/pagetypes/Thumbs.db, themes/builtwithconcrete5/images/pagetypes/left-sidebar.png, themes/builtwithconcrete5/images/pagetypes/three-columns.png, themes/builtwithconcrete5/images/pagetypes/two-column.png, themes/builtwithconcrete5/images/pagetypes/news-article.png, themes/builtwithconcrete5/images/pagetypes/two-then-three.png, themes/builtwithconcrete5/images/pagetypes/three-then-two.png, themes/builtwithconcrete5/images/pagetypes/full.png, themes/builtwithconcrete5/images/pagetypes, themes/builtwithconcrete5/images/banner1.jpg, themes/builtwithconcrete5/images/Thumbs.db, themes/builtwithconcrete5/images/slide1.jpg, themes/builtwithconcrete5/images/logo.png, themes/builtwithconcrete5/images, themes/builtwithconcrete5/home.php, themes/builtwithconcrete5/elements/footer.php, themes/builtwithconcrete5/elements/footer_bottom.php, themes/builtwithconcrete5/elements/header_top.php, themes/builtwithconcrete5/elements/header.php, themes/builtwithconcrete5/elements, themes/builtwithconcrete5/three_then_two.php, themes/builtwithconcrete5/js/jquery.cookie.min.js, themes/builtwithconcrete5/js/site.js, themes/builtwithconcrete5/js/respond.min.js, themes/builtwithconcrete5/js/selectivizr-min.js, themes/builtwithconcrete5/js/modernizr.js, themes/builtwithconcrete5/js, themes/builtwithconcrete5/left_sidebar.php, themes/builtwithconcrete5/three_column.php, themes/builtwithconcrete5/two_then_three.php, themes/builtwithconcrete5/right_sidebar.php, themes/builtwithconcrete5/two_column.php, themes/builtwithconcrete5/four_column.php, themes/builtwithconcrete5/page_theme.php, themes/builtwithconcrete5/view.php, themes/builtwithconcrete5/css/mixins.less, themes/builtwithconcrete5/css/screen.less, themes/builtwithconcrete5/css/presets/defaults.less, themes/builtwithconcrete5/css/presets, themes/builtwithconcrete5/css/resets.less, themes/builtwithconcrete5/css/styles.xml, themes/builtwithconcrete5/css/logged_in.less, themes/builtwithconcrete5/css/typography.less, themes/builtwithconcrete5/css/edit_mode.less, themes/builtwithconcrete5/css/forms.less, themes/builtwithconcrete5/css/bootstrap.min.css, themes/builtwithconcrete5/css/navigation.less, themes/builtwithconcrete5/css, themes/builtwithconcrete5/default.php, themes/builtwithconcrete5/description.txt, themes/builtwithconcrete5/thumbnail.png, themes/builtwithconcrete5/full.php, themes/builtwithconcrete5, languages/pt_BR/LC_MESSAGES/messages.mo, languages/pt_BR/LC_MESSAGES, languages/pt_BR, languages/ru_RU/LC_MESSAGES/messages.mo, languages/ru_RU/LC_MESSAGES, languages/ru_RU, languages/ja_JP/LC_MESSAGES/messages.mo, languages/ja_JP/LC_MESSAGES, languages/ja_JP, languages/el_GR/LC_MESSAGES/messages.mo, languages/el_GR/LC_MESSAGES, languages/el_GR, languages/es_PE/LC_MESSAGES/messages.mo, languages/es_PE/LC_MESSAGES, languages/es_PE, languages/da_DK/LC_MESSAGES/messages.mo, languages/da_DK/LC_MESSAGES, languages/da_DK, languages/nl_NL/LC_MESSAGES/messages.mo, languages/nl_NL/LC_MESSAGES, languages/nl_NL, languages/fi_FI/LC_MESSAGES/messages.mo, languages/fi_FI/LC_MESSAGES, languages/fi_FI, languages/de_DE/LC_MESSAGES/messages.mo, languages/de_DE/LC_MESSAGES, languages/de_DE, languages/es_PY/LC_MESSAGES/messages.mo, languages/es_PY/LC_MESSAGES, languages/es_PY, languages/nb_NO/LC_MESSAGES/messages.mo, languages/nb_NO/LC_MESSAGES, languages/nb_NO, languages/en_GB/LC_MESSAGES/messages.mo, languages/en_GB/LC_MESSAGES, languages/en_GB, languages/cs_CZ/LC_MESSAGES/messages.mo, languages/cs_CZ/LC_MESSAGES, languages/cs_CZ, languages/sv_SE/LC_MESSAGES/messages.mo, languages/sv_SE/LC_MESSAGES, languages/sv_SE, languages/it_IT/LC_MESSAGES/messages.mo, languages/it_IT/LC_MESSAGES, languages/it_IT, themes/builtwithconcrete5/images/pagetypes/right-sidebar.png, themes/builtwithconcrete5/images/pagetypes/four-columns.png, themes/builtwithconcrete5/images/pagetypes/news-page.png, themes/builtwithconcrete5/images/pagetypes/Thumbs.db, themes/builtwithconcrete5/images/pagetypes/left-sidebar.png, themes/builtwithconcrete5/images/pagetypes/three-columns.png, themes/builtwithconcrete5/images/pagetypes/two-column.png, themes/builtwithconcrete5/images/pagetypes/news-article.png, themes/builtwithconcrete5/images/pagetypes/two-then-three.png, themes/builtwithconcrete5/images/pagetypes/three-then-two.png, themes/builtwithconcrete5/images/pagetypes/full.png, themes/builtwithconcrete5/images/pagetypes, themes/builtwithconcrete5/images/banner1.jpg, themes/builtwithconcrete5/images/Thumbs.db, themes/builtwithconcrete5/images/slide1.jpg, themes/builtwithconcrete5/images/logo.png, themes/builtwithconcrete5/images, themes/builtwithconcrete5/home.php, themes/builtwithconcrete5/elements/footer.php, themes/builtwithconcrete5/elements/footer_bottom.php, themes/builtwithconcrete5/elements/header_top.php, themes/builtwithconcrete5/elements/header.php, themes/builtwithconcrete5/elements, themes/builtwithconcrete5/three_then_two.php, themes/builtwithconcrete5/js/jquery.cookie.min.js, themes/builtwithconcrete5/js/site.js, themes/builtwithconcrete5/js/respond.min.js, themes/builtwithconcrete5/js/selectivizr-min.js, themes/builtwithconcrete5/js/modernizr.js, themes/builtwithconcrete5/js, themes/builtwithconcrete5/left_sidebar.php, themes/builtwithconcrete5/three_column.php, themes/builtwithconcrete5/two_then_three.php, themes/builtwithconcrete5/right_sidebar.php, themes/builtwithconcrete5/two_column.php, themes/builtwithconcrete5/four_column.php, themes/builtwithconcrete5/page_theme.php, themes/builtwithconcrete5/view.php, themes/builtwithconcrete5/css/mixins.less, themes/builtwithconcrete5/css/screen.less, themes/builtwithconcrete5/css/presets/defaults.less, themes/builtwithconcrete5/css/presets, themes/builtwithconcrete5/css/resets.less, themes/builtwithconcrete5/css/styles.xml, themes/builtwithconcrete5/css/logged_in.less, themes/builtwithconcrete5/css/typography.less, themes/builtwithconcrete5/css/edit_mode.less, themes/builtwithconcrete5/css/forms.less, themes/builtwithconcrete5/css/bootstrap.min.css, themes/builtwithconcrete5/css/navigation.less, themes/builtwithconcrete5/css, themes/builtwithconcrete5/default.php, themes/builtwithconcrete5/description.txt, themes/builtwithconcrete5/thumbnail.png, themes/builtwithconcrete5/full.php, themes/builtwithconcrete5

# concrete5 Cache Settings
Block Cache - Off
Overrides Cache - Off
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
litespeed

# PHP Version
7.0.13

# PHP Extensions
bcmath, bz2, calendar, Core, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imap, intl, json, libxml, litespeed, mbstring, mcrypt, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, posix, readline, Reflection, session, shmop, SimpleXML, sockets, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 60
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 120
max_input_vars - 5000
memory_limit - 128M
post_max_size - 100M
sql.safe_mode - Off
upload_max_filesize - 100M
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
opcache.max_accelerated_files - 2000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5

Browser User-Agent String

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0