View Issue Details

IDProjectCategoryView StatusLast Update
0013504Tine 2.0Setuppublic2017-09-29 14:57
ReporterestradisAssigned To 
PrioritynormalSeverityblockReproducibilityalways
Status newResolutionopen 
PlatformVMware Virtual MachineOSUbuntu LinuxOS Version16.04 LTS
Product Version 
Target VersionFixed in Version 
Summary0013504: setup.php --restore -- db=1 bails out and leave database unusable
DescriptionWhile trying to restore database from last backup, i found following problem:

When an error occours during table creation after it was deleted in first, setup.php bails out and leaves database unusable.

I my case the statements

DROP TABLE IF EXISTS `tine20_addressbook`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tine20_addressbook` (
[...]
  CONSTRAINT `tine20_addressbook::container_id--container::id` FOREIGN KEY (`container_id`) REFERENCES `tine20_container` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

will cause the error. At this point the database seems not to be able to reference the constraint and therefore the execution fails.

Maybe the better solution will be to create the table without constraint in first and alter it afterwards to set the constraint.

- or -

- Delete constraints
- Rename table
- create new table
- Create constraints
Additional InformationFlow:

root@tine:~# /usr/bin/php /usr/share/tine20/setup.php --restore -- db=1 backupDir=/tmp/tine-20170929-120600/
ERROR 1215 (HY000) at line 336: Cannot add foreign key constraint

bzcat: I/O or other error, bailing out. Possible reason follows.
bzcat: Broken pipe
        Input file = /tmp/tine-20170929-120600//tine20_mysql.sql.bz2, output file = (stdout)

root@tine:~# /usr/bin/php /usr/share/tine20/setup.php --restore -- db=1 backupDir=/tmp/tine-20170929-120600/
PHP Fatal error: Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'tine20db.tine20_addressbook' doesn't exist in /usr/share/tine20/vendor/zendframework/zendframework1/library/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /usr/share/tine20/vendor/zendframework/zendframework1/library/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /usr/share/tine20/vendor/zendframework/zendframework1/library/Zend/Db/Statement.php(303): Zend_Db_Statement_Pdo->_execute(Array)
0000002 /usr/share/tine20/vendor/zendframework/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /usr/share/tine20/vendor/zendframework/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `tine20_...', Array)
0000004 /usr/share/tine20/vendor/zendframework/zendframework1/library/Zend/Db/Select.php(711): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Select))
#5 /usr/share/tine20/Tinebase/User/Sql.php(328): Zend_Db_Select->query()
#6 /usr/sha in /usr/share/tine20/vendor/zendframework/zendframework1/library/Zend/Db/Statement/Pdo.php on line 235

Fatal error: Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'tine20db.tine20_addressbook' doesn't exist in /usr/share/tine20/vendor/zendframework/zendframework1/library/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /usr/share/tine20/vendor/zendframework/zendframework1/library/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /usr/share/tine20/vendor/zendframework/zendframework1/library/Zend/Db/Statement.php(303): Zend_Db_Statement_Pdo->_execute(Array)
0000002 /usr/share/tine20/vendor/zendframework/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /usr/share/tine20/vendor/zendframework/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `tine20_...', Array)
0000004 /usr/share/tine20/vendor/zendframework/zendframework1/library/Zend/Db/Select.php(711): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Select))
#5 /usr/share/tine20/Tinebase/User/Sql.php(328): Zend_Db_Select->query()
#6 /usr/sha in /usr/share/tine20/vendor/zendframework/zendframework1/library/Zend/Db/Statement/Pdo.php on line 235
TagsNo tags attached.
mwticket

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2017-09-29 14:57 estradis New Issue