index-management
index-management copied to clipboard
[BUG] Snapshots policy creation issue (Using UI)
Describe the bug
Hello,
We have found an inconsistent behavior when creating snapshot policy from the UI for index pattern which includes * resulting the indices being Indices: [Object object]
Related component
Storage:Snapshots
To Reproduce
Create a snapshot policy using the UI for indices including * in the name.
Expected behavior
It should add the index pattern and not [Object Ojbect]
@opensearch-project/admin Could you please transfer this issue to the OpenSearch-Dashboards repo?
@elwali10 I also faced the same issue, the workaround is that you do not press enter/return after providing the index pattern, instead select from the drop-down options.
@opensearch-project/admin Can you route this to ISM plugin?
@mgodwan to triage
Good morning,
same situation here :
when i tried via dev tools:
PUT _plugins/_sm/policies/lejbl { "sm_policy": { "name": "lejbl", "description": "Daily snapshot for the harvester with retention time of 90 days", "schema_version": 21, "creation": { "schedule": { "cron": { "expression": "0 21 * * *", "timezone": "Europe/Bratislava" } } }, "deletion": { "schedule": { "cron": { "expression": "0 21 * * ", "timezone": "Europe/Bratislava" } }, "condition": { "max_age": "90d", "min_count": 1 } }, "snapshot_config": { "indices": ["harvester-"], "repository": "OTC_S3_harvester", "partial": true } } }
got:
{ "error": { "root_cause": [ { "type": "action_request_validation_exception", "reason": "Validation Failed: 1: Sequence number and primary term must be provided when updating a snapshot management policy;" } ], "type": "action_request_validation_exception", "reason": "Validation Failed: 1: Sequence number and primary term must be provided when updating a snapshot management policy;" }, "status": 400 }
. . . . Via dashboard is possible, but without set index pattern and set notification channel as well:
- im getting warning when i just lick on create button within snapshot policies:
and then inside of creation policy when want to type index patter (without enter) :
logs from pod:
# k logs opensearch-cluster-master-3 | grep lejbl --color
Defaulted container "opensearch" out of: opensearch, configfile (init)
[2024-08-06T22:03:14,822][DEBUG][o.o.i.s.SMRunner ] [opensearch-cluster-master-3] Snapshot management running job: SMPolicy(id=lejbl-sm-policy, description=, schemaVersion=21, creation=Creation(schedule={"cron":{"expression":"0 20 * * *","timezone":"Europe/Bratislava"}}, timeLimit=null), deletion=Deletion(schedule={"cron":{"expression":"0 20 * * *","timezone":"Europe/Bratislava"}}, scheduleProvided=true, condition=DeleteCondition(maxAge=90d, minCount=1, maxCount=null), timeLimit=null), snapshotConfig={indices=[object Object], repository=OTC_S3_harvester, partial=true}, jobEnabled=true, jobLastUpdateTime=2024-08-06T21:57:14.822Z, jobEnabledTime=2024-08-06T21:57:14.821Z, jobSchedule={"interval":{"start_time":1722981434821,"period":1,"unit":"Minutes"}}, seqNo=76525030, primaryTerm=126, notificationConfig=null, user=User[name=admin, backend_roles=[admin], roles=[security_rest_api_access, all_access], custom_attribute_names=[], user_requested_tenant=null])
[2024-08-06T22:03:14,823][DEBUG][o.o.j.s.u.LockService ] [opensearch-cluster-master-3] lock is released or expired: {"job_index_name":".opendistro-ism-config","job_id":"lejbl-sm-policy","lock_time":1722981734,"lock_duration_seconds":1800,"released":true}
[2024-08-06T22:03:14,839][DEBUG][o.o.i.o.IndexManagementSecurityContext] [opensearch-cluster-master-3] Setting security context in thread DefaultDispatcher-worker-4 for job lejbl-sm-policy
[2024-08-06T22:03:14,839][DEBUG][o.o.c.InjectSecurity ] [opensearch-cluster-master-3] DefaultDispatcher-worker-4, InjectSecurity - inject roles: lejbl-sm-policy
[2024-08-06T22:03:14,839][DEBUG][o.o.c.InjectSecurity ] [opensearch-cluster-master-3] DefaultDispatcher-worker-4, InjectSecurity - inject property: lejbl-sm-policy
[2024-08-06T22:03:14,839][DEBUG][o.o.i.o.IndexManagementSecurityContext] [opensearch-cluster-master-3] Cleaning up security context in thread DefaultDispatcher-worker-4 for job lejbl-sm-policy
[2024-08-06T22:03:14,839][DEBUG][o.o.i.s.e.SMStateMachine ] [opensearch-cluster-master-3] Update metadata: SMMetadata(policySeqNo=76525030, policyPrimaryTerm=126, creation=WorkflowMetadata(currentState=CREATION_START, trigger=Trigger(time=2024-08-07T18:00:00Z), started=null, latestExecution=null, retry=null), deletion=WorkflowMetadata(currentState=DELETION_START, trigger=Trigger(time=2024-08-07T18:00:00Z), started=null, latestExecution=null, retry=null), id=lejbl-sm-metadata, seqNo=76525071, primaryTerm=126)
[2024-08-06T22:03:14,839][DEBUG][o.o.i.o.IndexManagementSecurityContext] [opensearch-cluster-master-3] Setting security context in thread DefaultDispatcher-worker-4 for job lejbl-sm-policy
[2024-08-06T22:03:14,839][DEBUG][o.o.c.InjectSecurity ] [opensearch-cluster-master-3] DefaultDispatcher-worker-4, InjectSecurity - inject roles: lejbl-sm-policy
[2024-08-06T22:03:14,839][DEBUG][o.o.c.InjectSecurity ] [opensearch-cluster-master-3] DefaultDispatcher-worker-4, InjectSecurity - inject property: lejbl-sm-policy
[2024-08-06T22:03:14,839][DEBUG][o.o.i.o.IndexManagementSecurityContext] [opensearch-cluster-master-3] Cleaning up security context in thread DefaultDispatcher-worker-4 for job lejbl-sm-policy
[2024-08-06T22:03:14,840][DEBUG][o.o.i.s.e.SMStateMachine ] [opensearch-cluster-master-3] Update metadata: SMMetadata(policySeqNo=76525030, policyPrimaryTerm=126, creation=WorkflowMetadata(currentState=CREATION_START, trigger=Trigger(time=2024-08-07T18:00:00Z), started=null, latestExecution=null, retry=null), deletion=WorkflowMetadata(currentState=DELETION_START, trigger=Trigger(time=2024-08-07T18:00:00Z), started=null, latestExecution=null, retry=null), id=lejbl-sm-metadata, seqNo=76525071, primaryTerm=126)
[2024-08-06T22:03:14,840][DEBUG][o.o.j.s.u.LockService ] [opensearch-cluster-master-3] Releasing lock: {"job_index_name":".opendistro-ism-config","job_id":"lejbl-sm-policy","lock_time":1722981794,"lock_duration_seconds":1800,"released":false}
[2024-08-06T22:04:14,822][DEBUG][o.o.i.s.SMRunner ] [opensearch-cluster-master-3] Snapshot management running job: SMPolicy(id=lejbl-sm-policy, description=, schemaVersion=21, creation=Creation(schedule={"cron":{"expression":"0 20 * * *","timezone":"Europe/Bratislava"}}, timeLimit=null), deletion=Deletion(schedule={"cron":{"expression":"0 20 * * *","timezone":"Europe/Bratislava"}}, scheduleProvided=true, condition=DeleteCondition(maxAge=90d, minCount=1, maxCount=null), timeLimit=null), snapshotConfig={indices=[object Object], repository=OTC_S3_harvester, partial=true}, jobEnabled=true, jobLastUpdateTime=2024-08-06T21:57:14.822Z, jobEnabledTime=2024-08-06T21:57:14.821Z, jobSchedule={"interval":{"start_time":1722981434821,"period":1,"unit":"Minutes"}}, seqNo=76525030, primaryTerm=126, notificationConfig=null, user=User[name=admin, backend_roles=[admin], roles=[security_rest_api_access, all_access], custom_attribute_names=[], user_requested_tenant=null])
[2024-08-06T22:04:14,822][DEBUG][o.o.j.s.u.LockService ] [opensearch-cluster-master-3] lock is released or expired: {"job_index_name":".opendistro-ism-config","job_id":"lejbl-sm-policy","lock_time":1722981794,"lock_duration_seconds":1800,"released":true}
[2024-08-06T22:04:14,838][DEBUG][o.o.i.o.IndexManagementSecurityContext] [opensearch-cluster-master-3] Setting security context in thread DefaultDispatcher-worker-1 for job lejbl-sm-policy
[2024-08-06T22:04:14,838][DEBUG][o.o.c.InjectSecurity ] [opensearch-cluster-master-3] DefaultDispatcher-worker-1, InjectSecurity - inject roles: lejbl-sm-policy
[2024-08-06T22:04:14,838][DEBUG][o.o.c.InjectSecurity ] [opensearch-cluster-master-3] DefaultDispatcher-worker-1, InjectSecurity - inject property: lejbl-sm-policy
[2024-08-06T22:04:14,838][DEBUG][o.o.i.o.IndexManagementSecurityContext] [opensearch-cluster-master-3] Cleaning up security context in thread DefaultDispatcher-worker-1 for job lejbl-sm-policy
[2024-08-06T22:04:14,839][DEBUG][o.o.i.s.e.SMStateMachine ] [opensearch-cluster-master-3] Update metadata: SMMetadata(policySeqNo=76525030, policyPrimaryTerm=126, creation=WorkflowMetadata(currentState=CREATION_START, trigger=Trigger(time=2024-08-07T18:00:00Z), started=null, latestExecution=null, retry=null), deletion=WorkflowMetadata(currentState=DELETION_START, trigger=Trigger(time=2024-08-07T18:00:00Z), started=null, latestExecution=null, retry=null), id=lejbl-sm-metadata, seqNo=76525071, primaryTerm=126)
[2024-08-06T22:04:14,839][DEBUG][o.o.i.o.IndexManagementSecurityContext] [opensearch-cluster-master-3] Setting security context in thread DefaultDispatcher-worker-1 for job lejbl-sm-policy
[2024-08-06T22:04:14,839][DEBUG][o.o.c.InjectSecurity ] [opensearch-cluster-master-3] DefaultDispatcher-worker-1, InjectSecurity - inject roles: lejbl-sm-policy
[2024-08-06T22:04:14,839][DEBUG][o.o.c.InjectSecurity ] [opensearch-cluster-master-3] DefaultDispatcher-worker-1, InjectSecurity - inject property: lejbl-sm-policy
[2024-08-06T22:04:14,839][DEBUG][o.o.i.o.IndexManagementSecurityContext] [opensearch-cluster-master-3] Cleaning up security context in thread DefaultDispatcher-worker-1 for job lejbl-sm-policy
[2024-08-06T22:04:14,840][DEBUG][o.o.i.s.e.SMStateMachine ] [opensearch-cluster-master-3] Update metadata: SMMetadata(policySeqNo=76525030, policyPrimaryTerm=126, creation=WorkflowMetadata(currentState=CREATION_START, trigger=Trigger(time=2024-08-07T18:00:00Z), started=null, latestExecution=null, retry=null), deletion=WorkflowMetadata(currentState=DELETION_START, trigger=Trigger(time=2024-08-07T18:00:00Z), started=null, latestExecution=null, retry=null), id=lejbl-sm-metadata, seqNo=76525071, primaryTerm=126)
[2024-08-06T22:04:14,840][DEBUG][o.o.j.s.u.LockService ] [opensearch-cluster-master-3] Releasing lock: {"job_index_name":".opendistro-ism-config","job_id":"lejbl-sm-policy","lock_time":1722981854,"lock_duration_seconds":1800,"released":false}
the old ones policies works fine including notification channel (slack), so snapshot are created as configured , but not possible to edit anymore..
Thanks a lot
edit:
after update to 2.16.0, errors with index option and notification are gone, but main issue with [Object object] still persist ,also not possible schedule time, it still set to 20:00.
I can confirm this behaviour. When I specify an index pattern like data.*
, after saving the policy overview shows:
The backup fails:
[2024-08-30T20:03:48Z]: Caught exception while creating snapshot daily-snapshot-logs-2024-08-30t20:03:48-acse9stp.