Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 684700 - www-apps/baikal-0.5.2 - upgrading from version 0.4.6: Uncaught exception during upgrade: PDOException: SQLSTATE[HY000]: General error: 1 table calendarinstances already exists in /var/www/localhost/htdocs/baikal/Core/Frameworks/BaikalAdmin/Controller/...
Summary: www-apps/baikal-0.5.2 - upgrading from version 0.4.6: Uncaught exception duri...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Fabian Groffen
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-29 06:59 UTC by Alexander Weber
Modified: 2019-06-18 12:53 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Weber 2019-04-29 06:59:01 UTC
Today I ugraded the baikal in stable path from 0.4.6 to 0.5.2. Launching the page I am forwarded to /baikal/admin/install/
The page show me the error:

Baïkal upgrade wizard

Upgrading Baïkal from version 0.4.6 to version 0.5.2
Errors
Uncaught exception during upgrade: PDOException: SQLSTATE[HY000]: General error: 1 table calendarinstances already exists in /var/www/localhost/htdocs/baikal/Core/Frameworks/BaikalAdmin/Controller/Install/VersionUpgrade.php:383 Stack trace: #0 /var/www/localhost/htdocs/baikal/Core/Frameworks/BaikalAdmin/Controller/Install/VersionUpgrade.php(383): PDO->exec('CREATE TABLE ca...') #1 /var/www/localhost/htdocs/baikal/Core/Frameworks/BaikalAdmin/Controller/Install/VersionUpgrade.php(61): BaikalAdmin\Controller\Install\VersionUpgrade->upgrade('0.4.6', '0.5.2') #2 /var/www/localhost/htdocs/baikal/Core/Frameworks/Flake/Core/Render/Container.php(69): BaikalAdmin\Controller\Install\VersionUpgrade->render() #3 /var/www/localhost/htdocs/baikal/Core/Frameworks/Flake/Controller/Page.php(85): Flake\Core\Render\Container->renderBlocks() #4 /var/www/localhost/htdocs/baikal/admin/install/index.php(88): Flake\Controller\Page->render() #5 {main}

Error Baïkal has not been upgraded. See the section 'Errors' for details.

I use the sqlite database.

Reproducible: Always
Comment 1 Fabian Groffen gentoo-dev 2019-04-29 09:37:57 UTC
I didn't get this error, but I do get other errors, so I think 0.5.2 is really bad.
Comment 2 Larry the Git Cow gentoo-dev 2019-04-29 09:40:27 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f939272c8470f8166ff9687b29c15a90e31e183b

commit f939272c8470f8166ff9687b29c15a90e31e183b
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2019-04-29 09:39:33 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2019-04-29 09:40:21 +0000

    profiles/package.mask: mask baikal-0.5.2
    
    Bug: https://bugs.gentoo.org/684700
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 profiles/package.mask | 4 ++++
 1 file changed, 4 insertions(+)
Comment 3 Fabian Groffen gentoo-dev 2019-04-29 09:42:04 UTC
for info, what php version are you running?
Comment 4 Alexander Weber 2019-04-29 10:02:40 UTC
I use the stable dev-lang/php-7.2.16
Comment 5 Fabian Groffen gentoo-dev 2019-04-29 10:42:18 UTC
Thanks, I think I had 7.1 still running when I did the upgrade, when I use 7.2 I get all sorts of problems.
Comment 6 Fabian Groffen gentoo-dev 2019-04-29 13:39:35 UTC
stupid question (as I just hit this myself):

Are you sure you didn't automagically update before?  Odd enough, baikal upgrades itself automagically as soon as you hit any of its urls.  I had puppet inbetween zapping the settings.php file (to older version) and the exact same error afterwards.  Could something like this have happened to you too?
Comment 7 Alexander Weber 2019-04-29 14:35:58 UTC
After issie wass happen I restored the /etc/baikal/db/db.sqlite from backup and tried the upgrade again. Same issue.

The baikal is installed since Juni 2018 and used by 1 user (me) with multiple calendars and adressbooks. The 0.4.6 is the first version so I did not upgraded before.

My Plan-B was to delete all configurations and setup the 0.5.2 from scratch reimporting the calendars and adressbooks. But you say you got other issues so I am back to 0.4.6 and wait for more stable solution.
Comment 8 Fabian Groffen gentoo-dev 2019-04-29 18:14:19 UTC
Hang on, HY000 is a MySQL error isn't it?  Is your config correct?
Comment 9 Alexander Weber 2019-04-29 18:38:32 UTC
There is no mysql nor mariadb installed. The config works fine with 0.4.6
Searching in web for "sqlite+HY000" I see the sqlite does know the HY000 too
Comment 10 Sh2d000w 2019-04-30 06:54:08 UTC
I have baikal updated from 0.4.6 to 0.5.2 normally:
1) backup base and directory old baikal
2) install baikal-0.5.2 with USES="mysql vhosts"
3) without deleting the baikal-0.4.6, executed:
webapp-config -h <my_host> -d <directory> -U baikal 0.5.2
4) went to the web page <my_host>, I was redirected to the admin page. The update is over.
All clients connect to baikal without error.

dev-lang/php-7.2.16
dev-db/mariadb-10.2.22-r1
Comment 11 Fabian Groffen gentoo-dev 2019-04-30 08:27:28 UTC
same here, using mysql/mariadb.

my issues came from puppet stepping in at a bad time, and my nginx config not properly masquerading cal.php and card.php as dav.php (future direction of baikal apparently)

So it seems this upgrade issue is sqlite related.
Comment 12 Alexander Weber 2019-04-30 09:03:45 UTC
Next try:
1. Stopped apache, stopped reverse proxy and backup /etc/baikal

2. Installed www-apps/baikal-0.5.2, got the next post installation messages:

 * vhosts USE flag not set - auto-installing using webapp-config
 * This is an upgrade
 * baikal-0.4.6 is already installed - upgrading
 * Running /usr/sbin/webapp-config -h localhost -u root -d /baikal -U baikal 0.5.2

3. To be sure called again
  webapp-config -h localhost -u root -d /baikal -U baikal 0.5.2

4. started apache and accessed the baikal page

Error:
Uncaught exception during upgrade: Exception: Baikal\Model\Config->parseConfig(): constant 'BAIKAL_DAV_AUTH_TYPE' has been found multiple times in the config file; stopping execution in /var/www/localhost/htdocs/baikal/Core/Frameworks/Baikal/Model/Config.php:114 Stack trace: #0 /var/www/localhost/htdocs/baikal/Core/Frameworks/Baikal/Model/Config.php(40): Baikal\Model\Config->parseConfig('__construct('/var/www/localh...') #2 /var/www/localhost/htdocs/baikal/Core/Frameworks/BaikalAdmin/Controller/Install/VersionUpgrade.php(517): BaikalAdmin\Controller\Install\VersionUpgrade->updateConfiguredVersion('0.5.2') #3 /var/www/localhost/htdocs/baikal/Core/Frameworks/BaikalAdmin/Controller/Install/VersionUpgrade.php(61): BaikalAdmin\Controller\Install\VersionUpgrade->upgrade('0.4.6', '0.5.2') #4 /var/www/localhost/htdocs/baikal/Core/Frameworks/Flake/Core/Render/Container.php(69): BaikalAdmin\Controller\Install\VersionUpgrade->render() #5 /var/www/localhost/htdocs/baikal/Core/Frameworks/Flake/Controller/Page.php(85): Flake\Core\Render\Container->renderBlocks() #6 /var/www/localhost/htdocs/baikal/admin/install/index.php(88): Flake\Controller\Page->render() #7 {main}

after refresh:

Uncaught exception during upgrade: PDOException: SQLSTATE[HY000]: General error: 1 table calendarinstances already exists in /var/www/localhost/htdocs/baikal/Core/Frameworks/BaikalAdmin/Controller/Install/VersionUpgrade.php:383 Stack trace: #0 /var/www/localhost/htdocs/baikal/Core/Frameworks/BaikalAdmin/Controller/Install/VersionUpgrade.php(383): PDO->exec('CREATE TABLE ca...') #1 /var/www/localhost/htdocs/baikal/Core/Frameworks/BaikalAdmin/Controller/Install/VersionUpgrade.php(61): BaikalAdmin\Controller\Install\VersionUpgrade->upgrade('0.4.6', '0.5.2') #2 /var/www/localhost/htdocs/baikal/Core/Frameworks/Flake/Core/Render/Container.php(69): BaikalAdmin\Controller\Install\VersionUpgrade->render() #3 /var/www/localhost/htdocs/baikal/Core/Frameworks/Flake/Controller/Page.php(85): Flake\Core\Render\Container->renderBlocks() #4 /var/www/localhost/htdocs/baikal/admin/install/index.php(88): Flake\Controller\Page->render() #5 {main}

Seems the baikal have the issue with the commented out line in config.php
#define("BAIKAL_DAV_AUTH_TYPE", 'Digest');
define("BAIKAL_DAV_AUTH_TYPE", 'Basic');

5. Restored the /etc/baikal from backup, removed the commented line and tried again

Baïkal has been successfully upgraded !!!


Summary, the issue is related to the syntax of config.php. At the runtime the commented out line is fine but seems to break the upgrade process.
Comment 13 Fabian Groffen gentoo-dev 2019-06-18 12:53:46 UTC
for a next release upstream added a check for this