Database failure while SuiteCRM Upgrade from 7.13.1 to 7.14.1

Hello All,

Greetings!

While upgrading SuiteCRM Version 7.13.1 to 7.14.1, by upgrade wizard, at the last step of the upgrade process shows ā€˜Database Failure. Please refer to suitecrm.logā€™ for details.

In the log file, it shows,

Error adding index: Query Failed: CREATE INDEX idx_rel_name ON relationships (Array)::: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Column name ā€˜Arrayā€™ does not exist in the target table or view.

Please let me know if anyone has the solution/why the issue is off.
PHP version: v7
Database: MS SQL server

Thanks in Advance.

Your PHP needs to be V8 for SuiteCRM 7.14

Always check the Compatibility matrix!

@g.martin

Gillian - there are many forum posts where peopleā€™s solution is to check the Compatibility Matrix.

It would be helpful for everyone reading the forum, if these could be moved to their own category; and removed from the ā€˜Installation and Helpā€™ main thread.

Is that something you as community person could arrange, or empower a volunteer with the power to do that?

I have had the identical error, I am using MSSQL and PHP 8.2 and I think it is something to do with using MSSQL server. The error message ā€œColumn name ā€˜Arrayā€™ does not exist in the target tableā€ is correct, there is no column called Array in the Relationships table. The schema relationships - suitecrm Database indicates there shouldnā€™t be an Array column ā€¦ so not sure what this step is supposed to do?

I think that Array is a PHP bug, not an actual column name.

Iā€™ve the same issue. Upgrading 7.12.8 to 7.14.3, PHP 8.2 (also tried with PHP 8.0), MS SQL Server 2019.

Cause is related to the following syntax in \modules\Relationships\vardefs.php

    , 'indices' => array(
       array('name' =>'relationshippk', 'type' =>'primary', 'fields'=>array('id')),
       array('name' =>'idx_rel_name', 'type' =>'index', 'fields'=>array('relationship_name')),

Amending to

    , 'indices' => array(
       array('name' =>'relationshippk', 'type' =>'primary', 'fields'=>'id'),
       array('name' =>'idx_rel_name', 'type' =>'index', 'fields'=>'relationship_name'),

Resolves the error but then fails on the next module with indices / SQL indexes defined.

Where fields has multiple elements the approach above will not work e.g.,

, 'indices' => array(
        array('name' => 'idx_lead_acct_name_first', 'type' => 'index', 'fields' => array('account_name', 'deleted')),
        array('name' => 'idx_lead_last_first', 'type' => 'index', 'fields' => array('last_name', 'first_name', 'deleted')),
        array('name' => 'idx_lead_del_stat', 'type' => 'index', 'fields' => array('last_name', 'status', 'deleted', 'first_name')),
        array('name' => 'idx_lead_opp_del', 'type' => 'index', 'fields' => array('opportunity_id', 'deleted',)),
        array('name' => 'idx_leads_acct_del', 'type' => 'index', 'fields' => array('account_id', 'deleted',)),
        array('name' => 'idx_del_user', 'type' => 'index', 'fields' => array('deleted', 'assigned_user_id')),
        array('name' => 'idx_lead_assigned', 'type' => 'index', 'fields' => array('assigned_user_id')),
        array('name' => 'idx_lead_contact', 'type' => 'index', 'fields' => array('contact_id')),
        array('name' => 'idx_reports_to', 'type' => 'index', 'fields' => array('reports_to_id')),
        array('name' => 'idx_lead_phone_work', 'type' => 'index', 'fields' => array('phone_work')),
        array('name' => 'idx_leads_id_del', 'type' => 'index', 'fields' => array('id', 'deleted',)),

    )

Which files / classes process the indices and split the fields array into SQL syntax?

That would be easy to find if you can get a stack trace of the error you have in the logs.

Iā€™m having the same issue updating from 7.13.4 to 7.14.3. Tried with PHP 8.2. and 8.1. Did anyone find a solution?

Here is the stack trace

Thu Mar 14 09:31:26 2024 [6392][24c0a425-0be9-4a08-85e3-b661b892d136][FATAL] Error adding index:  Query Failed:CREATE INDEX idx_rel_name ON relationships (Array)::: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Column name 'Array' does not exist in the target table or view.
Thu Mar 14 09:31:26 2024 [6392][24c0a425-0be9-4a08-85e3-b661b892d136][FATAL] Exception handling in M:\Inetpub\webroot\SugarCrmTest\include\MVC\Controller\SugarController.php:397
Thu Mar 14 09:31:26 2024 [6392][24c0a425-0be9-4a08-85e3-b661b892d136][FATAL] Exception in Controller: Database failure. Please refer to suitecrm.log for details.

Sorry, but thatā€™s not a stack trace. That is 3 lines from the logs, with 3 different FATAL errors.

A stack trace would provide a list of function calls leading up to the FATAL, for each of those.