error when installing
Permalink Browser Info Environment
When i hit the install button of the add-on i got following error:
if i reload the page, i got addon already installed, but it doesn't work.
Doctrine \ DBAL \ Exception \ ForeignKeyConstraintViolationException An exception occurred while executing 'ALTER TABLE atBoolean ADD CONSTRAINT FK_5D5F70A9A2A82A5D FOREIGN KEY (avID) REFERENCES AttributeValues (avID)': SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`7654585db11`.`#sql-4457_1ae6a8d`, CONSTRAINT `FK_5D5F70A9A2A82A5D` FOREIGN KEY (`avID`) REFERENCES `AttributeValues` (`avID`))
if i reload the page, i got addon already installed, but it doesn't work.
Type: | Ticket |
---|---|
Status: | Archived |
Just did a search on the error message and it looks like this may be a consequence of a previously faulty c5 core update. See:
https://github.com/concrete5/concrete5/issues/5562...
>> "This does not brick the front end of the site as far as I can tell, but it does leave your site in a borked state that is unlikely to upgrade or install a package."
I don't have any personal experience of this core problem. The thread on Github includes some hints on repairing it. The way to confirm is to install another package such suggested in (3) above.
https://github.com/concrete5/concrete5/issues/5562...
>> "This does not brick the front end of the site as far as I can tell, but it does leave your site in a borked state that is unlikely to upgrade or install a package."
I don't have any personal experience of this core problem. The thread on Github includes some hints on repairing it. The way to confirm is to install another package such suggested in (3) above.
Thanks for the quick reply,
1. done
2. done: exception repeats
3. installed and used without errors
4. i don't know. screenshot of installed packeges atached
5. done
6.
1. done
2. done: exception repeats
3. installed and used without errors
4. i don't know. screenshot of installed packeges atached
5. done
6.
"Exception Occurred: /home/.sites/29/site1794/web/updates/concrete5-8.1.0/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:60 An exception occurred while executing 'ALTER TABLE atBoolean ADD CONSTRAINT FK_5D5F70A9A2A82A5D FOREIGN KEY (avID) REFERENCES AttributeValues (avID)':
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`7654585db11`.`#sql-4457_1ae6a8d`, CONSTRAINT `FK_5D5F70A9A2A82A5D` FOREIGN KEY (`avID`) REFERENCES `AttributeValues` (`avID`)) (0)
Is there a whoops backtrace for that exception in the log?
After the failed install, does the block type set "Magic Tabs" exist without any blocks in it? You would see it as an empty section in the add block slide in panel on the left.
Can you also post the environment report again please (it will hopefully now be in English).
i sent you my login, i think it is the most easy way
Just received the admin login, so I can get the above for myself.
Posted too soon, I have been unable to login. After a few "Invalid username or password." I suspect I am now blacklisted.
ok, you have to wait for 10mins or tell me how to remove you from the blacklist
You will need to remove me from the blacklist. Can you also please PM the login again, making it clear whether the '+' is part of the password or not (I was trying variations of both without success)
see
/dashboard/system/permissions/blacklist
/dashboard/system/permissions/blacklist
Can you increase the number of failures to 100, so when I try again soon I get a few more tries.
(and remember to set it back again after we have finished)
(and remember to set it back again after we have finished)
Bactrace of exception (for my reference)
Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException thrown with message "An exception occurred while executing 'ALTER TABLE atBoolean ADD CONSTRAINT FK_5D5F70A9A2A82A5D FOREIGN KEY (avID) REFERENCES AttributeValues (avID)': SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`7654585db11`.`#sql-4457_1b0123f`, CONSTRAINT `FK_5D5F70A9A2A82A5D` FOREIGN KEY (`avID`) REFERENCES `AttributeValues` (`avID`))" Stacktrace: #39 Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException in /home/.sites/29/site1794/web/updates/concrete5-8.1.0/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:60 #38 Doctrine\DBAL\Driver\AbstractMySQLDriver:convertException in /home/.sites/29/site1794/web/updates/concrete5-8.1.0/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:116 #37 Doctrine\DBAL\DBALException:driverExceptionDuringQuery in /home/.sites/29/site1794/web/updates/concrete5-8.1.0/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:836 #36 Doctrine\DBAL\Driver\PDOException in /home/.sites/29/site1794/web/updates/concrete5-8.1.0/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:106 #35 PDOException in /home/.sites/29/site1794/web/updates/concrete5-8.1.0/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:104 #34 PDO:query in /home/.sites/29/site1794/web/updates/concrete5-8.1.0/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:104 #33 Doctrine\DBAL\Driver\PDOConnection:query in /home/.sites/29/site1794/web/updates/concrete5-8.1.0/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:833 #32 Doctrine\DBAL\Connection:executeQuery in /home/.sites/29/site1794/web/updates/concrete5-8.1.0/concrete/src/Database/DatabaseStructureManager.php:230 #31 Concrete\Core\Database\DatabaseStructureManager:installDatabaseFor in /home/.sites/29/site1794/web/updates/concrete5-8.1.0/concrete/src/Database/DatabaseStructureManager.php:169 #30 Concrete\Core\Database\DatabaseStructureManager:installDatabase in /home/.sites/29/site1794/web/updates/concrete5-8.1.0/concrete/src/Package/Package.php:668 #29 Concrete\Core\Package\Package:installEntitiesDatabase in /home/.sites/29/site1794/web/updates/concrete5-8.1.0/concrete/src/Package/Package.php:659 #28 Concrete\Core\Package\Package:installDatabase in /home/.sites/29/site1794/web/updates/concrete5-8.1.0/concrete/src/Package/Package.php:350
Viewing 15 lines of 43 lines. View entire code block.
Having looked at the stack trace, I am pretty sure this is the core bug I referenced in the link above. Its not something I can fix.
If you are happy to do a little hacking and spend some time on this, I have an idea (below) that may be able work round the core bug and get the MT blocks installed.
If you don't have time to do that, I can offer a refund.
The work round would involve modifying the package controller and block controllers to remove the block type set and leave the MT blocks in the 'other' set. I don't know if that will work, but it is the main difference between the MT installation and MrKD Background installation. If the core bug is related to block type sets (and not just block types) that may get round the issue.
If you want to try that, I can provide more details. You would need to manually edit some php files and upload them via FTP.
Another possible solution would be to update your site core to c5 v8.2.1. However, there are potential problems with that update, especially as you would already be starting from a flawed update, so it could be a high risk and you would need to be prepared to restore the current 8.1.0 site from a backup. Core updates in c5.7 and v8 are always a bit flakey and poorly supported by the core team. The safest core update path would be to restore back to 5.7.5.x, update to 5.7.5.13, then go straight to v8.2.1. That would hopefully skip the core versions where the update process was flawed.
A final possibility would be for you to provide a complete database and files backup of the site so I can install a clone on my development system and (given time) maybe find another way round the core bug.
If you are happy to do a little hacking and spend some time on this, I have an idea (below) that may be able work round the core bug and get the MT blocks installed.
If you don't have time to do that, I can offer a refund.
The work round would involve modifying the package controller and block controllers to remove the block type set and leave the MT blocks in the 'other' set. I don't know if that will work, but it is the main difference between the MT installation and MrKD Background installation. If the core bug is related to block type sets (and not just block types) that may get round the issue.
If you want to try that, I can provide more details. You would need to manually edit some php files and upload them via FTP.
Another possible solution would be to update your site core to c5 v8.2.1. However, there are potential problems with that update, especially as you would already be starting from a flawed update, so it could be a high risk and you would need to be prepared to restore the current 8.1.0 site from a backup. Core updates in c5.7 and v8 are always a bit flakey and poorly supported by the core team. The safest core update path would be to restore back to 5.7.5.x, update to 5.7.5.13, then go straight to v8.2.1. That would hopefully skip the core versions where the update process was flawed.
A final possibility would be for you to provide a complete database and files backup of the site so I can install a clone on my development system and (given time) maybe find another way round the core bug.
PS. I have left the debug settings enabled. All I have done is to uninstall/install MT and look at the error messages.
thanks for everything,
i have time later for hacking, so you can proviede more details.
i have time later for hacking, so you can proviede more details.
updating to 8.2.1 is not an option, yet. because the stack popup function of my theme isn't working then. this function is very important for the site.
The hack comes in 2 parts. Both parts are needed or it will break. First, uninstall the MT package.
1. In the package controller, comment out parts of the 'install_or_update as below, so only
install_blocks is called.
2. In each of the four block controllers, completely comment out the function getBlockTypeDefaultSet, or simply rename it as I have below (and it will never get called)
This will result in a version of the package that does not use Block Type Sets, so all four of the blocks provided by MT will now be in the default 'Others' group.
With luck, if the core bug is to do with sets rather than blocks, that will work round and allow a successful installation. You will need to keep an eye out on any further MT updates in case you need to make the changes again.
1. In the package controller, comment out parts of the 'install_or_update as below, so only
install_blocks is called.
private function install_or_upgrade($me) { // $this->make_block_set($me); // this line now commented out $this->install_blocks($me); // $this->adjust_block_display_order($me); // this line now commented out }
2. In each of the four block controllers, completely comment out the function getBlockTypeDefaultSet, or simply rename it as I have below (and it will never get called)
public function XX_getBlockTypeDefaultSet() { return 'magic_tabs'; }
This will result in a version of the package that does not use Block Type Sets, so all four of the blocks provided by MT will now be in the default 'Others' group.
With luck, if the core bug is to do with sets rather than blocks, that will work round and allow a successful installation. You will need to keep an eye out on any further MT updates in case you need to make the changes again.
i tried this, but i get the same error.
if it is because of a flawed upgrade, would it help to reinstall c5 and import the datas and database or is the database flawed, which would be prette bad, bacause i created some new pages since the last upgrade and backup?
if it is because of a flawed upgrade, would it help to reinstall c5 and import the datas and database or is the database flawed, which would be prette bad, bacause i created some new pages since the last upgrade and backup?
I am afraid it would be the database that is damaged, so replacing files will not help.
There are some hints about fixing the database on GitHub (see above) and follow references to pull requests that purport to resolve related issues. However, the fixes need to be applied as part of the upgrade process and it is not clear whether they will work for a subsequent upgrade on an already damaged database.
There is also mention of a dumping the database, manipulating foreign key checks, and re-importing. I suspect that may simply be masking the problem rather than fully resolving it.
There are some hints about fixing the database on GitHub (see above) and follow references to pull requests that purport to resolve related issues. However, the fixes need to be applied as part of the upgrade process and it is not clear whether they will work for a subsequent upgrade on an already damaged database.
There is also mention of a dumping the database, manipulating foreign key checks, and re-importing. I suspect that may simply be masking the problem rather than fully resolving it.
A similar bug has been reported on community store. @mesuva has posted a SQL query that may be of help to you.
If you decide to experiment with it, take a database backup first just in case.
If you decide to experiment with it, take a database backup first just in case.
sorry, can't find it. do you have a link?
Sorry, I must have fumble-typed. Thought I had included a link.
https://github.com/concrete5-community-store/community_store/issues/...
There are 2 issues mixed up on that thread, and one appears to be related to attribute foreign keys.
I have not tested this. So its 'use at your own risk'.
https://github.com/concrete5-community-store/community_store/issues/...
There are 2 issues mixed up on that thread, and one appears to be related to attribute foreign keys.
I have not tested this. So its 'use at your own risk'.
Just checking in to see how you are getting on and whether you managed to resolve the core problem.
Sorry for the late response. A friend of mine checked my database and it seems there is messed up quite a lot, so i am going to install and setup the website new. The site works fine, as long as i don't install addons and updates, so i have time to do it. i think it is something for the xmas holidays XD
And thanks for the fabolous support!
And thanks for the fabolous support!
I am closing this ticket. When you have your new install running, if you need further help please open a new support request.
I am a little surprised at the error message because Magic Tabs does not install or alter any concrete5 attributes or use c5 attributes in any way.
The install sequence is:
a) Install package
b) Create a block type set for Magic Tabs
c) Add the magic tabs blocks to the set
d) Correct the display order of MT blocks in the set (to get round an core bug in some mid 5.7 versions)
I suspect what has happened is the attribute exception occurred between (a) and (b), so c5 thinks the package is installed, but the MT blocks did not install.
A few things to try and questions to answer that may help or will at least provide more diagnostic information:
1. In the dashboard, enable full debug error output. /dashboard/system/environment/debug
2. Uninstall MagicTabs and install again. Does the exception repeat?
3. Install another simple package that provides one or more blocks. Do you get a similar exception? For example, tryhttp://www.concrete5.org/marketplace/addons/mrkdilkington-full-scre... as this is a well supported and reliable block.
4. Do any other packages currently installed or ready for installation provide boolean attribute types?
5. Can you switch the default dashboard language to English so the environment is reported in English please and post here. /dashboard/system/basics/multilingual (and you may also need to logout/login choosing English)
6. If the exceptions repeat, do any of the exceptions result in more detailed error trace (as per 1), either in the window or in the log at /dashboard/reports/logs
If the site is publicly available, can you PM to me the admin login so I can have a look, run the install and follow the install process. (Do NOT post here, this support ticket is publicly visible).
John