Error - DB_Restore_BlkInfo on project restore


 Product(s):Promis.e, Bentley Substation
 Version(s):08.11.13.57
 Environment:N\A
 Area:Project Management
 Subarea:Backup and Restore Project

Error or Warning Message

When restoring a certain project backup file created in SELECTseries 7, an error message similar to the one below is displayed. Project restoration continues after acknowledging the error message.

Internal Error
DB_Restore_BlkInfo
ProjectDB Error Message: XML parsing: line 29, character 31, A string literal was expected
The data for table-valued parameter "@inputTable" doesn't conform to the table type of the parameter.
The statement has been terminated.
TargetSite: Boolean _InsertTable(System.Data.DataTable, Bentley.Electrical.Data.Db.TableNames, System.Data.DataTable By Ref)
DeclaringType: ECT.ECAD.DAL.BulkInsert
Attributes: private
MemberType: Method
StackTrace: C:\ProgramData\Bentley\Substation V8i\Config\LastError.txt
Product Version: Substation V8i (SELECTseries 8)
DB Version: SQLServer 8.1.33

Explanation

The "DB_Restore_BlkInfo" portion of the error message indicates the problem is related to the BlkInfo table. This can be caused by incomplete XML code in the blkSymXML field for at least one record in the BlkInfo table in the backup. The BlkInfo table contains symbol definition information.

The project restore process has changed in SELECTseries 8 to reduce restore times. The tables are restored in bulk now instead of record-by-record. Therefore the error message prevents all records from being restored into the BlkInfo table in the project database.

Similar error messages may indicate a problem with different table, but such messages have not been reported.

How to Avoid

Option 1

Run [[Rebuild Project Database]] on the project after restoration completes. This has been found to populate missing data and fix incomplete data

Option 2

  1. Run [[Rebuild Project Database]] on the source project.
  2. Create a new [[Backup Project|backup]] of the source project.
  3. Restore the backup into the new version.

Troubleshooting details

These details below are provided for reference. It is typically not necessary to find the problem records using the techniques below; running [[Rebuild Project Database]] on the restored project has fixed the issue in the known cases.

Method 1

To determine which record is the problem when the error message refers to BlkInfo, add the highlighted line below to the default.SystemOptions.xml file then restore the backup again. The default.SystemOptions.xml file is found in the \[[Promise Data folder|Promise Data]]\Config\Options or \[[Substation Data folder|Substation Data]]\Config\Options folder.

  <BulkDb>
    <MaxRows>100000</MaxRows>
    <TimeoutFactorRowsPerSecond>0</TimeoutFactorRowsPerSecond>
    <DebugTables>BlkInfo</DebugTables>
  </BulkDb>

An additional error message should appear during the restore indicating the record id number and other details of the record.

If there is more than one problem record, the error message will return only the first one encountered.

Method 2

The ECADProject.mdb file in the project backup can be opened in Microsoft Access and a query executed to select records in the BlkInfo table that have incomplete values in the blkSymXML column (they do not end in "</symbol>"). Such a query would be:

SELECT * FROM BlkInfo WHERE ((BlkInfo.blkSymXML) Not Like '*symbol>*');

 Original Author:Matt_P

Keywords: "equal expected", TFS 454723