Skip to content
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

bin/update.sh think i have older version of roundcube #7034

Closed
studiowena opened this issue Nov 13, 2019 · 13 comments
Closed

bin/update.sh think i have older version of roundcube #7034

studiowena opened this issue Nov 13, 2019 · 13 comments

Comments

@studiowena
Copy link

i have check my DB and campare with mysql files to upgrade in instalation and it seems my DB version is from 2016112200 but update.sh scripts dont know it even when i manual chaned in system table to 2016112200 update.sh is trying update DB from 2013042700

So i have looked at these DB upgrade sql files and manual updated my DB from 2018021600 to 2019092900

and setup system version to 2019092900. When running bin/update.sh again and type ? what version i have still script dont know i have 1.4.0 and trying update my DB from 2013042700

Originally posted by @studiowena in #7032 (comment)

@alecpl
Copy link
Member

alecpl commented Nov 14, 2019

Strange. I'm unable to reproduce. What RCMAIL_VERSION do you see in program/include/iniset.php line 34? What is the result of

SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'roundcubemail' AND TABLE_TYPE = 'BASE TABLE' ORDER BY TABLE_NAME;
SELECT `value` FROM `system` WHERE `name` = 'roundcube-version';

on your database? What database engine and version?

@studiowena
Copy link
Author

studiowena commented Nov 14, 2019

iniset.php file contains this from start and on line 23 is rcmail_version

all queries i have made on phpmyadmin from sql console

<?php

/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 |                                                                       |
 | Copyright (C) The Roundcube Dev Team                                  |
 |                                                                       |
 | Licensed under the GNU General Public License version 3 or            |
 | any later version with exceptions for skins & plugins.                |
 | See the README file for a full license statement.                     |
 |                                                                       |
 | PURPOSE:                                                              |
 |   Setup the application environment required to process               |
 |   any request.                                                        |
 +-----------------------------------------------------------------------+
 | Author: Till Klampaeckel <till@php.net>                               |
 |         Thomas Bruederli <roundcube@gmail.com>                        |
 +-----------------------------------------------------------------------+
*/

// application constants
define('RCMAIL_VERSION', '1.4.0');
define('RCMAIL_START', microtime(true));

result of mysql queries

cache
cache_index
cache_messages
cache_shared
cache_thread
contactgroupmembers
contactgroups
contacts
dictionary
filestore
identities
searches
session
system
users

and

2019092900

this last as system version i have inserted manual as describe before but update.sh script still dont know from where think that i have earlier version of RC

Mysql version
5.5.62-0+deb8u1-log

php version
PHP: 5.6.40-0+deb8u7

this is like im use update.sh

# bin/update.sh
What version are you upgrading from? Type '?' if you don't know.

and i type ? then script starts update DB like i described

@alecpl
Copy link
Member

alecpl commented Nov 14, 2019

Looks fine. I have no idea what's going on here.

Do you have more databases, maybe it's connecting to another one?
Did you set db_prefix in config?
What does it do if you run:

bin/updatedb.sh --package=roundcube --dir=SQL --version=2019092900

@studiowena
Copy link
Author

I dont use db_prefix in config i have only one DB for roundcube named "pocztaroundcube"

after command u gave me

# bin/updatedb.sh --package=roundcube --dir=SQL --version=2019092900
Updating database schema (2013011000)... [OK]
Updating database schema (2013042700)... [OK]
Updating database schema (2013052500)... [FAILED]
ERROR: Error in DDL upgrade 2013052500: [1050] Table 'cache_shared' already exists

and table system, cell value is inserted with

2013042700

so strange, i dont know from where scripts get information about roundcube version :) but my DB is from 1.4.0 so its OK for now.

@alecpl
Copy link
Member

alecpl commented Nov 14, 2019

The code is in the following file. Could you try the script again with this patch applied?

--- a/program/include/rcmail_utils.php
+++ b/program/include/rcmail_utils.php
@@ -109,7 +109,8 @@ class rcmail_utils
         }
 
         $db = self::db();
-
+print_r($db->table_name('system'));
+print_r($db->list_tables());
         // Read DB schema version from database (if 'system' table exists)
         if (in_array($db->table_name('system'), (array)$db->list_tables())) {
             $db->query("SELECT `value`"
@@ -119,6 +120,8 @@ class rcmail_utils
 
             $row     = $db->fetch_array();
             $version = preg_replace('/[^0-9]/', '', $row[0]);
+print_r($row);
+print_r($version);
         }
 
         // DB version not found, but release version is specified

@studiowena
Copy link
Author

studiowena commented Nov 14, 2019

where apply this patch? updatedb.sh ? ok i see patch apply to program/include/rcmail_utils.php

OK after patch

# bin/updatedb.sh --package=roundcube --dir=SQL --version=2019092900
systemArray
(
)
Updating database schema (2013011000)... [OK]
Updating database schema (2013042700)... [OK]
Updating database schema (2013052500)... [FAILED]
ERROR: Error in DDL upgrade 2013052500: [1050] Table 'cache_shared' already exists

and system is inserted again with 2013042700

@alecpl
Copy link
Member

alecpl commented Nov 14, 2019

Ok, we've got something. It looks like it does not list any tables in the database. Could you enable sql_debug and provide the log when you run the script?

@studiowena
Copy link
Author

config with

// log driver: 'syslog', 'stdout' or 'file'.
$config['log_driver'] = 'syslog';

// Log SQL queries
$config['sql_debug'] = true;

# bin/updatedb.sh --package=roundcube --dir=SQL --version=2019092900
systemArray
(
)
Updating database schema (2013011000)... [OK]
Updating database schema (2013042700)... [OK]
Updating database schema (2013052500)... [FAILED]
ERROR: Error in DDL upgrade 2013052500: [1050] Table 'cache_shared' already exists
Nov 14 16:01:44 serwer roundcube: [1] SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'pocztaroundcube;charset=utf8' AND TABLE_TYPE = 'BASE TABLE' ORDER BY TABLE_NAME;
Nov 14 16:01:44 serwer roundcube: [2] CREATE TABLE IF NOT EXISTS `system` (
 `name` varchar(64) NOT NULL,
 `value` mediumtext,
 PRIMARY KEY(`name`)
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
Nov 14 16:01:44 serwer roundcube: [3] UPDATE `system` SET `value` = '2013011000' WHERE `name` = 'roundcube-version';
Nov 14 16:01:44 serwer roundcube: [4] UPDATE `system` SET `value` = '2013042700' WHERE `name` = 'roundcube-version';
Nov 14 16:01:44 serwer roundcube: [5] CREATE TABLE `cache_shared` (
 `cache_key` varchar(255) /*!40101 CHARACTER SET ascii COLLATE ascii_general_ci */ NOT NULL,
 `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
 `data` longtext NOT NULL,
 INDEX `created_index` (`created`),
 INDEX `cache_key_index` (`cache_key`)
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;

@alecpl
Copy link
Member

alecpl commented Nov 14, 2019

Nov 14 16:01:44 serwer roundcube: [1] SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'pocztaroundcube;charset=utf8' AND TABLE_TYPE = 'BASE TABLE' ORDER BY TABLE_NAME;

Here's the problem. How does your db_dsnw entry lookslike?

@studiowena
Copy link
Author

$config['db_dsnw'] = 'mysql://pocztaroundcube:my_password@localhost/pocztaroundcube;charset=utf8';

@alecpl
Copy link
Member

alecpl commented Nov 14, 2019

You should remove ';charset=utf8'. This is not supported syntax, and this part is not needed anyway.

@studiowena
Copy link
Author

studiowena commented Nov 14, 2019

done

# bin/updatedb.sh --package=roundcube --dir=SQL --version=2019092900
systemArray
(
    [0] => cache
    [1] => cache_index
    [2] => cache_messages
    [3] => cache_shared
    [4] => cache_thread
    [5] => contactgroupmembers
    [6] => contactgroups
    [7] => contacts
    [8] => dictionary
    [9] => filestore
    [10] => identities
    [11] => searches
    [12] => session
    [13] => system
    [14] => users
)
Array
(
    [0] => 2019092900
)
2019092900

# bin/update.sh
What version are you upgrading from? Type '?' if you don't know.
?
Executing database schema update.
systemArray
(
    [0] => cache
    [1] => cache_index
    [2] => cache_messages
    [3] => cache_shared
    [4] => cache_thread
    [5] => contactgroupmembers
    [6] => contactgroups
    [7] => contacts
    [8] => dictionary
    [9] => filestore
    [10] => identities
    [11] => searches
    [12] => session
    [13] => system
    [14] => users
)
Array
(
    [0] => 2019092900
)
2019092900This instance of Roundcube is up-to-date.
Have fun!

problem solved, sorry dont know why i have used this on dsnw, maybe update script should check $config['db_dsnw'] configuration typo to avoid that problems in future.

Thanks for Your hard work helping me solve this problem

@alecpl
Copy link
Member

alecpl commented Nov 15, 2019

Fixed.

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

No branches or pull requests

2 participants