EclecticIQ 2.4.0 hotfix 1
ID |
EclecticIQ 2.4.0 hotfix 1 |
Severity |
2 - MEDIUM |
Affected versions |
2.4.0 |
Hotfix |
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:
Have already been sent from the source to the target platform instance, and that have already been synced between the two platforms.
After that, they are updated in the source platform to change entity tag metadata.
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:
If your platform instance is release 2.4.0, and if you are currently not planning to upgrade it to release 2.5.0. or later:
First, apply the EclecticIQ 2.4.0 hotfix 1 .patch file.
Then, run the script to update the affected entities.
This completely solves the issue.
Download the hotfix
To download the hotfix, click eclecticiq-240-hotfix-1.zip.
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:
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
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
Stop all platform services:
# Stop all Supervisor-managed processes
supervisorctl stop all
Apply the eclecticiq-240-hotfix-1.patch hotfix:
patch entities.py < eclecticiq-240-hotfix-1.patch
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:
Tag an indicator entity.
Inspect the outgoing feed task run content to verify that the new tag data is included:
In the source platform, check the outgoing feed package to confirm that it includes the tag you manually added to test the hotfix.
In the target platform, check the corresponding downloaded/ingested package to confirm that it includes the tag you manually added to test the hotfix.
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.
To download the script, click eclecticiq-240-hotfix-1-script.zip.
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
Copy sync_entity_last_updated_from_history_events.py to the /opt/eclecticiq/platform/api/lib/python3.6/site-packages/eiq/platform/scripts/ directory.
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:
Open a terminal shell as an eclecticiq platform user:
# Switch to the 'eclecticiq user' with root-access level
$
sudo
-u eclecticiq -s
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
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.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
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.After successfully running the affected outgoing feeds, inspect the packages the outgoing feed runs produced to verify that they contain the updated entities.