You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the migratepolicies.py I am seeing crashes when trying to migrate the channels for some policies
Steps to Reproduce
python3 migratepolicies.py --fromFile list.txt --sourceAccount REDACTED --sourceRegion eu --sourceApiKey REDACTED --targetAccount REDACTED --targetRegion eu --targetApiKey REDACTED
Expected Behavior
All of the channels are migrated for every single policy
Relevant Logs / Console output
2024-09-19 09:32:02,021 - migratepolicies.py - INFO - Using fromFile : list.txt
2024-09-19 09:32:02,022 - migratepolicies.py - INFO - Using sourceAccount : REDACTED
2024-09-19 09:32:02,022 - migratepolicies.py - INFO - sourceRegion : eu
2024-09-19 09:32:02,022 - migratepolicies.py - INFO - Using sourceApiKey : ****************************
2024-09-19 09:32:02,022 - migratepolicies.py - INFO - Using targetAccount : REDACTED
2024-09-19 09:32:02,022 - migratepolicies.py - INFO - targetRegion : eu
2024-09-19 09:32:02,022 - migratepolicies.py - INFO - Using targetApiKey : ****************************
2024-09-19 09:32:02,022 - migratepolicies.py - INFO - Default fetch_channels :True
2024-09-19 09:32:02,022 - migratepolicies.py - INFO - Alert migration started.
2024-09-19 09:32:02,022 - migratepolicies.py - INFO - Fetching latest channel info and policy assignment. This may take a while.....
2024-09-19 09:32:06,271 - migratepolicies.py - INFO - Migrating the following policies:
2024-09-19 09:32:06,272 - migratepolicies.py - INFO - ['REDACTED', 'REDACTED', 'REDACTED', 'REDACTED']
2024-09-19 09:32:06,847 - migratepolicies.py - INFO - Policy exists : REDACTED
2024-09-19 09:32:06,848 - migratepolicies.py - INFO - Updating notification channels for REDACTED
2024-09-19 09:32:06,848 - migratepolicies.py - INFO - Channel already existed : email-REDACTED
2024-09-19 09:32:06,848 - migratepolicies.py - INFO - Channel already existed : email-REDACTED
2024-09-19 09:32:06,848 - migratepolicies.py - INFO - Channel already existed : email-REDACTED
2024-09-19 09:32:06,849 - migratepolicies.py - INFO - Channel already existed : email-REDACTED
2024-09-19 09:32:06,849 - migratepolicies.py - INFO - Channel already existed : email-REDACTED
2024-09-19 09:32:06,849 - migratepolicies.py - INFO - Channel already existed : email-REDACTED
2024-09-19 09:32:06,849 - migratepolicies.py - INFO - Channel already existed : email-REDACTED
2024-09-19 09:32:08,705 - alertsclient.py - INFO - Updated policy with notification channels [REDACTED, REDACTED, REDACTED, REDACTED, REDACTED, REDACTED, REDACTED]
2024-09-19 09:32:09,104 - migratepolicies.py - INFO - Policy exists : REDACTED
2024-09-19 09:32:09,104 - migratepolicies.py - INFO - Updating notification channels for REDACTED
Traceback (most recent call last):
File "/Users/REDACTED/Downloads/nr-account-migration-2.2.2/migratepolicies.py", line 386, in <module>
main()
File "/Users/REDACTED/Downloads/nr-account-migration-2.2.2/migratepolicies.py", line 372, in main
migrate(
File "/Users/REDACTED/Downloads/nr-account-migration-2.2.2/migratepolicies.py", line 269, in migrate
status = migrate_alert_policies(
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/REDACTED/Downloads/nr-account-migration-2.2.2/migratepolicies.py", line 236, in migrate_alert_policies
update_notification_channels(tgt_api_key, tgt_region, src_policy, tgt_policy, loaded_src_channels,
File "/Users/REDACTED/Downloads/nr-account-migration-2.2.2/migratepolicies.py", line 165, in update_notification_channels
for source_channel_id in src_channel_ids:
^^^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'src_channel_ids' where it is not associated with a value
Your Environment
MacOS Squoia
Python 3.12.6
Additional context
It seems like a very core functionality of this script for it to be failing, so I am unsure whether this is a bug or user error. I have tried many times and looked into the channels that did get migrated to see whether there was any difference between those and the ones that were crashing when trying the migration, but I have not been able to find the cause.
The text was updated successfully, but these errors were encountered:
Description
When using the
migratepolicies.py
I am seeing crashes when trying to migrate the channels for some policiesSteps to Reproduce
Expected Behavior
All of the channels are migrated for every single policy
Relevant Logs / Console output
Your Environment
Additional context
It seems like a very core functionality of this script for it to be failing, so I am unsure whether this is a bug or user error. I have tried many times and looked into the channels that did get migrated to see whether there was any difference between those and the ones that were crashing when trying the migration, but I have not been able to find the cause.
The text was updated successfully, but these errors were encountered: