Menu

DataSync : truncated error messages

schirrms
2021-02-10
2021-03-30
  • schirrms

    schirrms - 2021-02-10

    Hello everyone,

    I'm a big user of the datasync funct, and this solution reallys rocks. But, sometimes, things doesn't go as expected, and we then get error messages. But those messages are truncated.

    For instance, this night, I got this message :

    Unable to update destination object: Found issue(s): target_class = lnkIPInterfaceToIPAddress, target_id = 690, issues = You <b>cannot delete the object</b> because it is owned by the external data so...(495 chars)...

    Obviously, I would like to know the 'offending datasource'...

    Is there a way to see the whole message (the short version is commonly useless...)

    Thanks,

    Pascal

     
  • Pierre Goiffon

    Pierre Goiffon - 2021-03-08

    Hello Pascal,

    It reminds me of something but I wasn't able to found a corresponding bug in the Combodo db nor in the pull requests :/

    Isn't this caused by a field that hasn't got enough capacity in the DB ? Where is this error stored ?

     
    • schirrms

      schirrms - 2021-03-08

      Hi Pierre,

      Thanks for the reply. I didn't do a search in the database, (where the record is maybe complete ?), that 'truncated message is in the admin console.
      I'm 'officialy' on vacation this week, but I'll probaly have a look one evening, and let you know.

      Thanks,

      Pascal

       
    • schirrms

      schirrms - 2021-03-08

      Hi Pierre,

      Thanks for the reply. I didn't do a search in the database, (where the record is maybe complete ?), that 'truncated message is in the admin console.
      I'm 'officialy' on vacation this week, but I'll probaly have a look one evening, and let you know.

      Thanks,

      Pascal

       
      • Pierre Goiffon

        Pierre Goiffon - 2021-03-09

        Ok !
        Sorry I'm not an expert on datasynchro, where is the message located exactly ? I may track it down reading the page code...
        Have great holidays in the meantime !

         
  • schirrms

    schirrms - 2021-03-17

    Hi Pierre,

    Sorry for the delayed answer.

    I don't have in mind a current sample, but I just jound an old one in our iTop server :

    For one sync, we encountered this error, as seen in the control panel, with that specific part in the url :
    https://{itop url}//synchro/replica.php?operation=details&class=SynchroReplica&id=13642&

    Source de données               S_DBSchema
    Objet destination               1831
    Type de l'objet                 Instance de base de données
    Etat                            Obsolete
    Dernière détection              2019-10-22 19:17:39
    Créé par la source ?            Oui
    Dernière erreur                 Unable to delete the destination object: No result for the single row query: 
                                    'SELECT DISTINCT `DatabaseSchema`.`id` AS `DatabaseSchemaid`, `DatabaseSchema_FunctionalCI`.`name` AS `DatabaseSchemaname...(4012 chars)...
    Avertissements
    Date de création                2019-10-22 19:17:44
    

    As you can see, the 'Last error message is truncated, and ends with a "4012 chars" text. And (even in not in that case, I had had cases hard to understand because that 'shortened message' didn't contain the useful message.

    As I saw in the url an id 13642, I started some diggind in the MariDB database. sure enough, I found a record with the id 13642 in the 'priv_sync_replica' table, but in the field 'status_last_error' of type VARCHAR (255), the text was already truncated :
    Direct copy from mysql command :

    MariaDB [itop_db]> SELECT * FROM `priv_sync_replica` WHERE id=13642
        -> ;
    +-------+----------------+---------+----------------+---------------------+----------+---------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+---------------------+--------------------+
    | id    | sync_source_id | dest_id | dest_class     | status_last_seen    | status   | status_dest_creator | status_last_error                                                                                                                                                                                                          | status_last_warning | info_creation_date  | info_last_modified |
    +-------+----------------+---------+----------------+---------------------+----------+---------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+---------------------+--------------------+
    | 13642 |             51 |    1831 | DatabaseSchema | 2019-10-22 19:17:39 | obsolete |                   1 | Unable to delete the destination object: No result for the single row query: 'SELECT  DISTINCT `DatabaseSchema`.`id` AS `DatabaseSchemaid`,`DatabaseSchema_FunctionalCI`.`name` AS `DatabaseSchemaname...(4012 chars)...   |                     | 2019-10-22 19:17:44 | NULL               |
    +-------+----------------+---------+----------------+---------------------+----------+---------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+---------------------+--------------------+
    1 row in set (0.001 sec)
    

    It seems to me that the error message is truncated before storage, witch is indeed a very good idea, as the destination field is a varchar(255). Buit could that field be upgraded ?

    Thanks,

    Pascal

     
  • Pierre Goiffon

    Pierre Goiffon - 2021-03-30

    Hello,
    Many thanks for this very detailed investigation !

    This reminds me of something, but I wasn't able to find any related ticket in Combodo DB :/
    In the develop branch (next 3.0.0) the field is still an AttributeString so 255 chars max :( The trim is done in \SynchroReplica::SetLastError. There are multiple callers, but many times there is also a call to \SynchroLog::AddTrace... Can you check if you get something in the corresponding \SynchroLog object (priv_sync_log table) ?

    I'll ask the products team if they are ok to change the last_error field type

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.