EclecticIQ 2.4.0 hotfix 1

ID

EclecticIQ 2.4.0 hotfix 1

Severity

2 - MEDIUM

Affected versions

2.4.0

Hotfix

  1. eclecticiq-240-hotfix-1.zip

  2. eclecticiq-240-hotfix-1-script.zip

This hotfix addresses a functionality issue where entity tag data is not synced correctly when exchanging entity data between a source and a target platform instance.

Scenario

Entity data exchange in EclecticIQ JSON format between two platform instances through an outgoing and a corresponding incoming feed.

Issue

When exchanging tagged entity data in EclecticIQ JSON format between a source and a target platform instance through an outgoing and a corresponding incoming feed, source platform entity tag data is not synced correctly to the target platform instance.
The data is transmitted correctly from the source to the target platform instance, but it is not applied to update the corresponding entities in the target platform.

The issue affects entities that:

  1. Have already been sent from the source to the target platform instance, and that have already been synced between the two platforms.

  2. After that, they are updated in the source platform to change entity tag metadata.

  3. Then, they are sent again from the source to the target platform instance to sync the entity content between the linked platform instances.

The consequence of the issue is that tagged entities in the target platform instance lack tag data, compared to the same entities in the source platform instance, and the linked platform instances are off-sync.

Cause

The root cause of the issue is a last_updated_at timestamp mismatch, whereby entities in the target platform instance are not updated after editing the corresponding entities in the source platform using the bulk tagging feature, and after running the feed to exchange the data between the platforms.

Mitigation

Despite not being marked as updated, the affected entities retain their history events. Therefore, it is possible to retroactively mark them as updated to address the issue.

Recommended course of action:

  • Upgrade to release 2.5.0 or later to completely solve the issue.

  • If your platform instance is release 2.3.4 or earlier, upgrade to release 2.5.0 or later to completely solve the issue.

    2.5.0 is the upcoming EclecticIQ Platform release, which we plan to make available in the next few weeks.

Alternatively, and applicable only to release 2.4.0:

Download the hotfix

Apply the hotfix

To successfully execute commands in the command line or in the terminal, you may require root-level access rights.

  • Obtain root-level access by running sudo -i:

    # Root-access login shell
    sudo -i


    To access resources as a different user than the currently active one, append -u:

    # Grant the currently logged in user root-level access
    sudo -i
     
    # Grant root-level access to a different user
    sudo -i -u ${user_name}
     
    # Run a command as a different user, with root-level access
    sudo -i -u ${user_name} ${command} ${options}

To apply the EclecticIQ 2.4.0 hotfix 1 .patch file to your platform instance:

  1. Make sure the Linux /bin/patch utility is installed on the platform instance you are applying the hotfix .patch file to.
    If it is not available, install it by running the following command in a terminal session:

    # Install the /bin/patch utility
    yum install patch.x86_64
  2. Create a backup copy of the unpatched entities.py file:

    # The following command copies 'entities.py' to the 'tmp' dir
    cp /opt/eclecticiq/platform/api/lib/python3.6/site-packages/eiq/platform/entities.py /tmp
  3. Stop all platform services:

    # Stop all Supervisor-managed processes
    supervisorctl stop all


  4. Apply the eclecticiq-240-hotfix-1.patch hotfix:

    patch entities.py < eclecticiq-240-hotfix-1.patch
  5. Restart all platform services:

    # Restart all Supervisor-managed processes
    supervisorctl restart all

Test the hotfix

To test if the hotfix is applied successfully, update an entity that has already been sent from the source to the target platform instance, and that has already been synced between the two platforms at a previous moment in the past.

Test the hotfix by carrying out the following steps in the source platform instance:

  1. Tag an indicator entity.

  2. Run the outgoing feed.

  3. Inspect the outgoing feed task run content to verify that the new tag data is included:

    1. In the source platform, check the outgoing feed package to confirm that it includes the tag you manually added to test the hotfix.

    2. In the target platform, check the corresponding downloaded/ingested package to confirm that it includes the tag you manually added to test the hotfix.

    3. In the target platform, check that the new tag is applied to the ingested entity you originally added the tag to, to test the hotfix.

Download the script

After applying the .patch file, you can run the script.

  1. To download the script, click eclecticiq-240-hotfix-1-script.zip.

  2. Extract the archive content to a temporary download directory
    The archive contains the following script: eiq-platform entity sync-last-updated-at-from-history-events.

Install the script

  1. Copy sync_entity_last_updated_from_history_events.py to the /opt/eclecticiq/platform/api/lib/python3.6/site-packages/eiq/platform/scripts/ directory.

  2. sync_entity_last_updated_from_history_events.py must have the same owner, group, and permissions as the other files in the containing directory.
    In the terminal session, run the chown eclecticiq:eclecticiq ... and the chmod 644 ... commands to assign these flags to the script file.

Run the script

To run the hotfix script in your platform instance:

  1. Open a terminal shell as an eclecticiq platform user:

    # Switch to the 'eclecticiq user' with root-access level
    $ sudo -u eclecticiq -s
  2. To test the script, run the synchronization command with the --dry-run flag.
    This option only writes the IDs of the entities to update to the specified output file:

    # Run the script in test mode
    /opt/eclecticiq/platform/api/bin/eiq-platform entity sync-last-updated-at-from-history-events --dry-run --updated-entities-file /tmp/updated-entities.json
  3. Verify that the entity IDs in the script output file refer to the affected entities.
    To do so, in the platform look up and spot-check some entities whose IDs are included in the script output file.

  4. If the IDs in the script output file refer to the affected entities, run sync-last-updated-at-from-history-events again, this time without the --dry-run flag, to permanently apply the changes:

    # Run the script to update the affected entities
    /opt/eclecticiq/platform/api/bin/eiq-platform entity sync-last-updated-at-from-history-events --updated-entities-file /tmp/updated-entities.json

Verify the results

  1. After completing the script execution, run again any affected outgoing feeds.
    Now they should be able to detect and to select the updated entities for packaging and publication.

  2. After successfully running the affected outgoing feeds, inspect the packages the outgoing feed runs produced to verify that they contain the updated entities.