Errors when Upgrading to 3.18.3

Hey guys.


I am in the middle of upgrading from 3.18.2-3.18.3. After doing all the steps in the upgrade, including the database queries, I ran step_02.php, and I got the following errors:


    Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42P16]: Invalid table definition: 7 ERROR:  cannot change number of columns in view' in /home/websites/mysource_matrix/core/lib/DAL/DAL.inc:878
    Stack trace:
    #0 /home/websites/mysource_matrix/core/lib/DAL/DAL.inc(878): PDO->exec('CREATE OR REPLA...')
    #1 /home/websites/mysource_matrix/core/lib/db_install/db_install.inc(799): DAL::executeSql('CREATE OR REPLA...')
    #2 /home/websites/mysource_matrix/install/step_02.php(118): install_stored_relations('views')
    #3 {main}
      thrown in /home/websites/mysource_matrix/core/lib/DAL/DAL.inc on line 878


I am assuming my upgrade is half complete, and something went wrong?

Hi Nic, report a bug for this and we'll take a look. I think you're the second person to see this particular problem with views, although I've never seen it on my own systems.


The only way to really fix it is to drop the views manually and let step_02.php recreate them. Although, this error appears to be non-destructive because it was not able to replace the view and didn't delete it., so your system should not be broken.



It would be great if the error showed the view name. You don't happen to see it anywhere do you (maybe in the PostgreSQL error logs)?

[quote]Hi Nic, report a bug for this and we'll take a look. I think you're the second person to see this particular problem with views, although I've never seen it on my own systems.


The only way to really fix it is to drop the views manually and let step_02.php recreate them. Although, this error appears to be non-destructive because it was not able to replace the view and didn't delete it., so your system should not be broken.



It would be great if the error showed the view name. You don't happen to see it anywhere do you (maybe in the PostgreSQL error logs)?[/quote]



Greg, I will submit a bug report.



This is the only line I see in the error log that has to do with views:


    2008-07-08 07:09:32 UTC ERROR:  cannot change number of columns in view


I continued the upgraded it everything seems to be ok.

Hi -


I've just also come across this bug - similarly I continued the upgrade and it appears to have worked - however, the error still exists in 3.18.3 to 3.18.4 upgrade:



Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42P16]: Invalid table definition: 7 ERROR: cannot change number of columns in view' in /cege/www/mysource_matrix/core/lib/DAL/DAL.inc:878

Stack trace:

#0 /cege/www/mysource_matrix/core/lib/DAL/DAL.inc(878): PDO->exec('CREATE OR REPLA…')

#1 /cege/www/mysource_matrix/core/lib/db_install/db_install.inc(799): DAL::executeSql('CREATE OR REPLA…')

#2 /cege/www/mysource_matrix/install/step_02.php(118): install_stored_relations('views')

#3 {main}

thrown in /cege/www/mysource_matrix/core/lib/DAL/DAL.inc on line 878



What other information would you require?

There is no error in Matrix itself. The error was in the upgrade procedure that listed the queries to run in the wrong order. The upgrade guide was fixed for users upgrading from 3.16 to 3.18. A 3.18.3 to 3.18.4 upgrade does not have any additional steps so you should not have been dropping any views. What guide did you follow?



The standard minor upgrade process.

It's basically repeated the 3.18.2 -> 3.18.3 upgrade error message. I

The site itself seems fine - any idea on how to figure out which view is incorrect? I am prepared to drop views manually if necessary.

You may need to drop all your views and run step_02.php again to recreate them:


DROP VIEW sq_rb_vw_ast_lnk_major;

DROP VIEW sq_rb_vw_ast_perm;

DROP VIEW sq_rb_vw_ast_role;

DROP VIEW sq_vw_ast_lnk_major;

DROP VIEW sq_vw_ast_perm;

DROP VIEW sq_vw_ast_role;

DROP VIEW sq_rb_vw_ast_lnk_minor;

DROP VIEW sq_vw_ast_lnk_minor;



then php install/step_02.php /path/to/matrix

Many thanks - I've done that, and will let you know if there are any further errors once I upgrade to 3.18.5