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

Update 2018.08.3 --> 2018.08.4 fails (Timetracker foreign keys?) #6926

Open
hartundweich opened this Issue Sep 20, 2018 · 11 comments

Comments

@hartundweich

hartundweich commented Sep 20, 2018

Hello,
Today I updated from 2018.08.2 --> 2018.08.3 without problems. When trying to update from 2018.08.3 --> 2018.08.4 the upgrade process is failing. The following two applications have to be updated: Filemanager, Timetracker.
I've set the log level to 6 and attach the logfile here so that further investigation can be done.
Please feel free to contact me if further information has to be provided.
Rolling now back to 2018.08.3...

log.txt

@pschuele pschuele self-assigned this Sep 21, 2018

@pschuele pschuele added this to To do in Tine 2.0 Development via automation Sep 21, 2018

@pschuele pschuele added this to the 2018.08.5 milestone Sep 21, 2018

@pschuele pschuele moved this from To do to In progress in Tine 2.0 Development Sep 21, 2018

@pschuele

This comment has been minimized.

Show comment
Hide comment
@pschuele

pschuele Sep 21, 2018

Member

hi @hartundweich ,

could you please check if this diff helps?

From 14745b054c575859f6e01529ed665329655d3a3c Mon Sep 17 00:00:00 2001
From: Philipp Schüle <p.schuele@metaways.de>
Date: Fri, 21 Sep 2018 09:31:21 +0200
Subject: [PATCH] tweak(Timetracker): update to mcv2: catch all exceptions when dropping FKs

... because we might get those errors otherwise:

SQLSTATE[HY000]: General error: 1025 Error on rename of
'./tine20_timetracker_timeaccount' to './2159848db20/#sql2-af9-55a39c3'
 (errno: 152)

fixes #6926

https://github.com/tine20/tine20/issues/6926

Change-Id: Ic1dbbd31ef5808bdcec4bc390ee9b7e06696c1e5
---

diff --git a/tine20/Timetracker/Setup/Update/Release12.php b/tine20/Timetracker/Setup/Update/Release12.php
index e99cd7f..b25787f 100644
--- a/tine20/Timetracker/Setup/Update/Release12.php
+++ b/tine20/Timetracker/Setup/Update/Release12.php
@@ -33,14 +33,16 @@
         // remove old index + fks first
         try {
             $this->_backend->dropForeignKey('timetracker_timeaccount', 'timeaccount::container_id--container::id');
-        } catch (Zend_Db_Exception $zdse) {
-            // already dropped
+        } catch (Exception $e) {
+            // already dropped?
+            Tinebase_Exception::log($e);
         }
 
         try {
             $this->_backend->dropForeignKey('timetracker_timeaccount_fav', 'timesheet_favorites--timesheet_id::id');
-        } catch (Zend_Db_Exception $zdse) {
-            // already dropped
+        } catch (Exception $e) {
+            // already dropped?
+            Tinebase_Exception::log($e);
         }
 
         $this->updateSchema('Timetracker', array('Timetracker_Model_Timesheet', 'Timetracker_Model_Timeaccount'));
Member

pschuele commented Sep 21, 2018

hi @hartundweich ,

could you please check if this diff helps?

From 14745b054c575859f6e01529ed665329655d3a3c Mon Sep 17 00:00:00 2001
From: Philipp Schüle <p.schuele@metaways.de>
Date: Fri, 21 Sep 2018 09:31:21 +0200
Subject: [PATCH] tweak(Timetracker): update to mcv2: catch all exceptions when dropping FKs

... because we might get those errors otherwise:

SQLSTATE[HY000]: General error: 1025 Error on rename of
'./tine20_timetracker_timeaccount' to './2159848db20/#sql2-af9-55a39c3'
 (errno: 152)

fixes #6926

https://github.com/tine20/tine20/issues/6926

Change-Id: Ic1dbbd31ef5808bdcec4bc390ee9b7e06696c1e5
---

diff --git a/tine20/Timetracker/Setup/Update/Release12.php b/tine20/Timetracker/Setup/Update/Release12.php
index e99cd7f..b25787f 100644
--- a/tine20/Timetracker/Setup/Update/Release12.php
+++ b/tine20/Timetracker/Setup/Update/Release12.php
@@ -33,14 +33,16 @@
         // remove old index + fks first
         try {
             $this->_backend->dropForeignKey('timetracker_timeaccount', 'timeaccount::container_id--container::id');
-        } catch (Zend_Db_Exception $zdse) {
-            // already dropped
+        } catch (Exception $e) {
+            // already dropped?
+            Tinebase_Exception::log($e);
         }
 
         try {
             $this->_backend->dropForeignKey('timetracker_timeaccount_fav', 'timesheet_favorites--timesheet_id::id');
-        } catch (Zend_Db_Exception $zdse) {
-            // already dropped
+        } catch (Exception $e) {
+            // already dropped?
+            Tinebase_Exception::log($e);
         }
 
         $this->updateSchema('Timetracker', array('Timetracker_Model_Timesheet', 'Timetracker_Model_Timeaccount'));

@pschuele pschuele moved this from In progress to To be tested / reviewed in Tine 2.0 Development Sep 21, 2018

@hartundweich

This comment has been minimized.

Show comment
Hide comment
@hartundweich

hartundweich Sep 21, 2018

hi @pschuele
Thank you for your patch - I'll test it during the next days and will give feedback if it works. Sorry that I can't do it today, but I have it on my agenda - maybe I'll find some time on weekend.

hartundweich commented Sep 21, 2018

hi @pschuele
Thank you for your patch - I'll test it during the next days and will give feedback if it works. Sorry that I can't do it today, but I have it on my agenda - maybe I'll find some time on weekend.

@pschuele

This comment has been minimized.

Show comment
Hide comment
@pschuele

pschuele Sep 21, 2018

Member

great, thanks for your help!

Member

pschuele commented Sep 21, 2018

great, thanks for your help!

@hartundweich

This comment has been minimized.

Show comment
Hide comment
@hartundweich

hartundweich Sep 25, 2018

Still the same... tried today...
Attaching actual Log.txt
log.txt

hartundweich commented Sep 25, 2018

Still the same... tried today...
Attaching actual Log.txt
log.txt

@pschuele

This comment has been minimized.

Show comment
Hide comment
@pschuele

pschuele Sep 26, 2018

Member

hm, strange. the exceptions should be catched (with the patch applied).

which php version are you using?

Member

pschuele commented Sep 26, 2018

hm, strange. the exceptions should be catched (with the patch applied).

which php version are you using?

@hartundweich

This comment has been minimized.

Show comment
Hide comment
@hartundweich

hartundweich Sep 26, 2018

Using 5.6 at the moment - cannot upgrade to 7.x due to a typo3 issue (still using 6.x at the moment)

I'll retry the update and removing the lines with the foreign keys in my Timetracker/Setup/Update/Release12.php and give feedback if it was working.

hartundweich commented Sep 26, 2018

Using 5.6 at the moment - cannot upgrade to 7.x due to a typo3 issue (still using 6.x at the moment)

I'll retry the update and removing the lines with the foreign keys in my Timetracker/Setup/Update/Release12.php and give feedback if it was working.

@hartundweich

This comment has been minimized.

Show comment
Hide comment
@hartundweich

hartundweich Sep 27, 2018

Removed lines regarding foreign keys and retried to apply the update - still failing. Find attached the log at level 7. Something is going wrong here and I don't know what....
log.txt

hartundweich commented Sep 27, 2018

Removed lines regarding foreign keys and retried to apply the update - still failing. Find attached the log at level 7. Something is going wrong here and I don't know what....
log.txt

@pschuele

This comment has been minimized.

Show comment
Hide comment
@pschuele

pschuele Sep 28, 2018

Member

i think you got something wrong editing the file. the request just stops without coming to an end.

could you try the update via shell (adjust your paths):

php setup.php --config /etc/tine20/config.inc.php --update

and check if it throws an error into the console?

Member

pschuele commented Sep 28, 2018

i think you got something wrong editing the file. the request just stops without coming to an end.

could you try the update via shell (adjust your paths):

php setup.php --config /etc/tine20/config.inc.php --update

and check if it throws an error into the console?

@hartundweich

This comment has been minimized.

Show comment
Hide comment
@hartundweich

hartundweich Sep 28, 2018

I don't think I got somethin wrong when editiing the file - I just removed the lines regarding the drop of the foreign keys.
Updating via shell script I have to transfer my installation to my local development environment, my provider does not provide a ssh environment for me to perform the update via shell script - so I need just a little time to do this. Maybe during next week possible - I'll give feedback as soon as I have done it.

hartundweich commented Sep 28, 2018

I don't think I got somethin wrong when editiing the file - I just removed the lines regarding the drop of the foreign keys.
Updating via shell script I have to transfer my installation to my local development environment, my provider does not provide a ssh environment for me to perform the update via shell script - so I need just a little time to do this. Maybe during next week possible - I'll give feedback as soon as I have done it.

@hartundweich

This comment has been minimized.

Show comment
Hide comment
@hartundweich

hartundweich Oct 9, 2018

Sorry for this long period it took me to copy a local instance to one of our development servers. Inlcuding your patch and doing command line update I get the following error message:

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1553 Cannot drop index 'tine20_timesheet::timeaccount_id--timeaccount::id': needed in a foreign key constraint in /lamp/webspace/localhost/htdocs/tine20/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:104
Stack trace:
#0 /lamp/webspace/localhost/htdocs/tine20/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(104): PDO->query('DROP INDEX tin...') #1 /lamp/webspace/localhost/htdocs/tine20/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(852): Doctrine\DBAL\Driver\PDOConnection->query('DROP INDEXtin...')
#2 /lamp/webspace/localhost/htdocs/tine20/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaTool.php(843): Doctrine\DBAL\Connection->executeQuery('DROP INDEX `tin...')
#3 /lamp/webspace/localhost/htdocs/tine20/Setup/SchemaTool.php(140): Doctrine\ORM\Tools\SchemaTool->updateSchema(Array, true)
#4 /lamp/webspace/localhost/htdocs/tine20/Setup/Update/Abstract.php(532): Setup_SchemaTool::updateSchema('Timetracker', Array)
#5 / in /lamp/webspace/localhost/htdocs/tine20/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 115

hartundweich commented Oct 9, 2018

Sorry for this long period it took me to copy a local instance to one of our development servers. Inlcuding your patch and doing command line update I get the following error message:

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1553 Cannot drop index 'tine20_timesheet::timeaccount_id--timeaccount::id': needed in a foreign key constraint in /lamp/webspace/localhost/htdocs/tine20/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:104
Stack trace:
#0 /lamp/webspace/localhost/htdocs/tine20/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(104): PDO->query('DROP INDEX tin...') #1 /lamp/webspace/localhost/htdocs/tine20/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(852): Doctrine\DBAL\Driver\PDOConnection->query('DROP INDEXtin...')
#2 /lamp/webspace/localhost/htdocs/tine20/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaTool.php(843): Doctrine\DBAL\Connection->executeQuery('DROP INDEX `tin...')
#3 /lamp/webspace/localhost/htdocs/tine20/Setup/SchemaTool.php(140): Doctrine\ORM\Tools\SchemaTool->updateSchema(Array, true)
#4 /lamp/webspace/localhost/htdocs/tine20/Setup/Update/Abstract.php(532): Setup_SchemaTool::updateSchema('Timetracker', Array)
#5 / in /lamp/webspace/localhost/htdocs/tine20/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 115

@hartundweich

This comment has been minimized.

Show comment
Hide comment
@hartundweich

hartundweich Oct 9, 2018

When removing all the lines regarding foreign keys command line update is working. Still asking why web interface update was not working when removing the lines regarding foreign keys?

hartundweich commented Oct 9, 2018

When removing all the lines regarding foreign keys command line update is working. Still asking why web interface update was not working when removing the lines regarding foreign keys?

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