Upgrade to 2.6 not working well

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
efrat
Posts: 6
Joined: 06 May 2012, 18:59

Upgrade to 2.6 not working well

Post by efrat »

Hi,
I try to upgrade to ver 2.6 but have problem in the pages: my_view.php (blank) & view_all_bug_page.php (HTTP 500).
My current mantisbt env includes of:
CentOS release 6.2
mantisbt 1.2.19
PHP 5.3.3
Mysql 5.1.61
httpd-2.2.15-15
client side - IE 11 / Chrome Version 61.0.3163.100

I have created a new env on a new server which includes of:
CentOS Linux release 7.4.1708
mantisbt 2.6.0
PHP 7.1.10
Mysql 5.7.19
httpd-2.4.6-67
client side - IE 11 / Chrome Version 61.0.3163.100

The procedure I used to upgrade my mantisbt is:
1. I have created my new server with all necessary packages
2. Downloaded and installed mantisbt according to instruction - in this phase I had a perfectly functional mantis app (I created bugs, projects and added due date and reminder in the config file).
3. I used mysqldump on old mantisbt DB using the command: mysqldump -uxxx -pxxx mantisbt >mantisbt.dump
4. In my new server I restored the data into the DB using the command: mysql -uroot -pxxx mantisbt < mantisbt.dump
5. I upgraded the DB using admin page. I had ERRORS which I manged to go through after reading an article here telling me to change some lines in admin/schema.php file:
instead of:
$g_upgrade[200] = array('CreateTableSQL', array( db_get_table( 'api_token' ), "
I change it to:
$g_upgrade[200] = array('ChangeTableSQL', array( db_get_table( 'api_token' ), "

I commented the lines:
#$g_upgrade[209] = array( 'AlterColumnSQL', array( db_get_table( 'api_token' ), "
# user_id I UNSIGNED NOTNULL DEFAULT '0',
# date_created I UNSIGNED NOTNULL DEFAULT '1',
# date_used I UNSIGNED NOTNULL DEFAULT '1'"
# ) );

6. I manged to login and see all projects and bugs but as I said I cant see the view_all_bug_page, the log I see in my Apache is:
[php7:error] [pid 3915] [client 192.168.2.11:54453] PHP Fatal error: Uncaught TypeError: Argument 1 passed to columns_remove_invalid() must be of the type array, null given, called in /opt/mantisbt/mantisbt/core/custom_function_api.php on line 309 and defined in /opt/mantisbt/mantisbt/core/columns_api.php:491\nStack trace:\n#0 /opt/mantisbt/mantisbt/core/custom_function_api.php(309): columns_remove_invalid(NULL, Array)\n#1 /opt/mantisbt/mantisbt/core/helper_api.php(469): custom_function_default_get_columns_to_view(1, NULL)\n#2 /opt/mantisbt/mantisbt/core/helper_api.php(504): helper_call_custom_function('get_columns_to_...', Array)\n#3 /opt/mantisbt/mantisbt/core/filter_api.php(3419): helper_get_columns_to_view(1)\n#4 /opt/mantisbt/mantisbt/core/filter_api.php(1059): filter_get_visible_sort_properties_array(Array)\n#5 /opt/mantisbt/mantisbt/core/filter_api.php(2341): filter_get_query_sort_data(Array, true, Array)\n#6 /opt/mantisbt/mantisbt/core/filter_api.php(1216): filter_get_bug_rows_query_clauses(Array, NULL, NULL, true)\n#7 /opt/mantisbt/mantisbt/view_all_bug_page.php(71): filter_ge in /opt/mantisbt/mantisbt/core/columns_api.php on line 491, referer: http://mantisbt-new.mindu.co.il/mantisb ... w_page.php

Any help will be appreciated
Efrat.
atrol
Site Admin
Posts: 8376
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Upgrade to 2.6 not working well

Post by atrol »

efrat wrote:I try to upgrade to ver 2.6
2.6? I recommend 2.7 as looking for errors in 2.6 does not make that much sense.
efrat wrote:I had ERRORS which I manged to go through after reading an article here telling me to change some lines in admin/schema.php file:
instead of:
$g_upgrade[200] = array('CreateTableSQL', array( db_get_table( 'api_token' ), "
I change it to:
$g_upgrade[200] = array('ChangeTableSQL', array( db_get_table( 'api_token' ), "
Does not make sense. Maybe you started the upgrade more than one time.
efrat wrote:I commented the lines:
#$g_upgrade[209] = array( 'AlterColumnSQL', array( db_get_table( 'api_token' ), "
# user_id I UNSIGNED NOTNULL DEFAULT '0',
# date_created I UNSIGNED NOTNULL DEFAULT '1',
# date_used I UNSIGNED NOTNULL DEFAULT '1'"
# ) );
Does not make sense, might be caused by the first change.

I recommend to start from scratch, use 2.7 for the upgrade, stop after the very first problem occurs and tell what you get.
Please use Search before posting and read the Manual
efrat
Posts: 6
Joined: 06 May 2012, 18:59

Re: Upgrade to 2.6 not working well

Post by efrat »

Thanks. I will try fresh installation of 2.7 and report
efrat.

well I installed 2.7, restore my original database and upgraded it using the mantis admin/install.php page and the error I get is:

BAD
CREATE TABLE mantis_api_token_table ( id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, user_id INTEGER NOT NULL DEFAULT 0, name VARCHAR(128) NOT NULL, hash VARCHAR(128) NOT NULL, date_created INTEGER UNSIGNED NOT NULL DEFAULT 0, date_used INTEGER UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (id) )DEFAULT CHARSET=utf8
Table 'mantis_api_token_table' already exists

what now?
efrat
Posts: 6
Joined: 06 May 2012, 18:59

Re: Upgrade to 2.6 not working well

Post by efrat »

I clicked Retry and the upgrade finished with no error. But again when I opening view_all_bug_page.php I get 'HTTP ERROR 500'
Any idea what's wrong and why after upgrade this two pages are not displayed?

Thanks,
Efrat.
atrol
Site Admin
Posts: 8376
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Upgrade to 2.6 not working well

Post by atrol »

efrat wrote:well I installed 2.7
What does this mean? Did you just copy the files to your webserver, or did you run any script after it?
Please use Search before posting and read the Manual
efrat
Posts: 6
Joined: 06 May 2012, 18:59

Re: Upgrade to 2.6 not working well

Post by efrat »

I downloaded the files and then run the install.php script. At the end of this part I had mantis working perfectly.
The problem started after restoring the DB (I run the upgrade procedure with install.php again).

efrat.
atrol
Site Admin
Posts: 8376
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Upgrade to 2.6 not working well

Post by atrol »

efrat wrote:I downloaded the files and then run the install.php script
That's the problem.
You must not run the script, as this installs a complete fresh empty Mantis 2.7.0 database schema.
You have to import your old database, copy your old config_inc.php to config directory, adjust host and database settings if needed, and run the install script, so that it upgrades your old 1.2 database schema with existing data to the 2.7 database schema.
Please use Search before posting and read the Manual
efrat
Posts: 6
Joined: 06 May 2012, 18:59

Re: Upgrade to 2.6 not working well

Post by efrat »

atrol wrote:
efrat wrote:I downloaded the files and then run the install.php script
That's the problem.
You must not run the script, as this installs a complete fresh empty Mantis 2.7.0 database schema.
You have to import your old database, copy your old config_inc.php to config directory, adjust host and database settings if needed, and run the install script, so that it upgrades your old 1.2 database schema with existing data to the 2.7 database schema.
So let see if I understand you correctly:
I've deleted the mantisbt database I had in my new server
I created a fresh DB outside mantis named 'mantisbt' (same name as my current)
I restored the dump into the newly created DB
I copied the config_inc.php file and adjusted it to fit new environment
I executed the insall.php
Everything finished with green 'GOOD'
When I tried to connect I got an error regarding $g_crypto_master_salt not set, which was correct since I didnt have this value in my config_inc.php
So I added the line missing line and typed in 16 characters as required
I succeeded to Login
Still no all_bug view :(
Same error as before:
[Wed Oct 25 15:31:02.163483 2017] [php7:error] [pid 5135] [client 192.168.2.11:57584] PHP Fatal error: Uncaught TypeError: Argument 1 passed to columns_remove_invalid() must be of the type array, null given, called in /opt/mantisbt/mantisbt-2.7.0/core/custom_function_api.php on line 309 and defined in /opt/mantisbt/mantisbt-2.7.0/core/columns_api.php:491\nStack trace:\n#0 /opt/mantisbt/mantisbt-2.7.0/core/custom_function_api.php(309): columns_remove_invalid(NULL, Array)\n#1 /opt/mantisbt/mantisbt-2.7.0/core/helper_api.php(469): custom_function_default_get_columns_to_view(1, NULL)\n#2 /opt/mantisbt/mantisbt-2.7.0/core/helper_api.php(504): helper_call_custom_function('get_columns_to_...', Array)\n#3 /opt/mantisbt/mantisbt-2.7.0/core/filter_api.php(3475): helper_get_columns_to_view(1)\n#4 /opt/mantisbt/mantisbt-2.7.0/core/filter_api.php(1059): filter_get_visible_sort_properties_array(Array)\n#5 /opt/mantisbt/mantisbt-2.7.0/core/filter_api.php(2397): filter_get_query_sort_data(Array, NULL, Array)\n#6 /opt/mantisbt/mantisbt-2.7.0/core/filter_api.php(1282): filter_get_bug_rows_query_clauses(Array, NULL, NULL, NULL)\n#7 /opt/ in /opt/mantisbt/mantisbt-2.7.0/core/columns_api.php on line 491, referer: http://mantisbt-new.mindu.co.il/mantisb ... t_page.php

Is there any option to upgrade from 1.x to 2.x?
atrol
Site Admin
Posts: 8376
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Upgrade to 2.6 not working well

Post by atrol »

I have no time to have a deeper look at the moment.
There are some known issues around filters after upgrading to 2.x.

Some workarounds, that worked for some cases

Does running

Code: Select all

http://<ReplaceByYourMantisUrl>/view_all_set.php?type=3
fix the issue?

Try clearing browser cookies

Check some hints at https://www.mantisbt.org/bugs/view.php?id=20872

Delete all entries from mantis_filters_table (ok if you have just a small number of filters stored. If not you could search for the one that causes the issue, remove it from the old database dump and run again the upgrade)
Please use Search before posting and read the Manual
Post Reply