Failed to copy records from MAILBOX to GOLDMINETEMPCOPYTABLE - the Event log shows: Com Error IDispatch error #3121 - HRESULT:  -2147217871 - Description: Timeout expired when rebuilding a large table

Version 1

    Details

    Failed to copy records from MAILBOX to GOLDMINETEMPCOPYTABLE - the Event log shows: Com Error IDispatch error #3121 - HRESULT:  -2147217871 - Description: Timeout expired when rebuilding a large table


    [STEPS TO REPRODUCE]
    1. Make sure that all users are logged out of GoldMine and all services related to GoldMine are shut down (e.g. GoldSync)

    2. Make sure that all users are logged off or have closed all applications with an integration into GoldMine (e.g. GMME, GMWEB, Outlook, Word etc)

    3. Make sure to have a full running backup of your GoldMine database

    4. In GoldMine with master rights

    5. Tools >> Databases >> Maintain Database…
    6. Individual Files >> Next

    7. Select the specific table for example MAILBOX table from the list >> Next

    8. Select Rebuild and Pack the database files >> there appears a message that SQL tables need not to be rebuilt unless a table restructure is required… >> confirm this message

    9. Select Sort the database files + Verify the data and synchronization information >> Next

    10. Although there should be no user logged in anymore it might be recommended to select the Force all users to exit GoldMine with 1 minute >> Next

    11. Finish

    >> RESULT:


    Not straight away an error appears on screen:
    Failed to copy records from Mailbox to GoldMineTempCopyTable



    - In the Eventlog the following entry can be found


    ADO Error in AdoCommand::execute INSERT INTO [dbo].[GOLDMINETEMPCOPYTABLE] ( [LINKRECID] , [FLAGS] , [USERID] , [FOLDER] , [FOLDER2] , [ACCOUNTNO] , [CREATEON] , [MAILSIZE] , [MAILDATE] , [MAILTIME] , [MAILREF] , [LOPRECID] , [MAILID] , [EXT] , [RFC822] , [RECID] )

     SELECT [LINKRECID] , [FLAGS] , [USERID] , [FOLDER] , [FOLDER2] , [ACCOUNTNO] , [CREATEON] , [MAILSIZE] , [MAILDATE] , [MAILTIME] , [MAILREF] , [LOPRECID] , [MAILID] , [EXT] , [RFC822] , [RECID] from [dbo].[MAILBOX]

    Com Error IDispatch error #3121

        HRESULT    : -2147217871

        Description: Timeout expired.



     


    Resolution

    [CAUSE]
    - This error is related to the underlying database connection ADO and  simply doesn't respond within the required time, means a cancellation of  the executing command for the connection if it does not respond within  the specified time.


    ADO Command Timeout

    Runtime error -214721781 (80040e31)

    [Microsoft][ODBC SQL Server Driver]Timeout expired



    - Usually this is to due to the amount of data within the MAILBOX or the underlying table (usually MAILBOX is affected as one of the largest tables within a GoldMine system but a rebuild of other tables like CONTHIST may lead to the same error and especially Timeout expired error in the Windows Event viewer log.

    [RESOLUTION/SUGGESTION]
    - Whenever possible make sure to perform this action directly on the  machine with the SQL Server installation or at least on the GoldMine Application server

    - Set the  following settings in the GM.INI which will extend the Timeout on especially long SQL Queries as this happens for very large tables during a rebuild with a massive data volume

    SQLQueryTimeout=  <Minutes> Sets the global timeout for all database queries.
    LongSQLQueryTimeout = <minutes> Sets the global timeout for critical operations such as synchronization and database re-indexing.

    [STEPS]

    1. Close GoldMine
    2. Browse to the GM.INI in the shared GoldMine folder (where also the LicenseGM94.bin resides)
    3. Open the GM.INI with Notepad
    4. Add to or Adjust in the section [GoldMine]  the  following lines


    SQLQueryTimeout=10
    LongSQLQueryTimeout=15

    Additional Note:
    The timeout values are given in minutes, so in the above example 10 minutes and 15 minutes, this can be also set higher if necessary

    >> The entry may look then like



    5. Save the GM.INI and verify the rebuild of the specific table for example MAILBOX again