index-management icon indicating copy to clipboard operation
index-management copied to clipboard

[BUG] Snapshots policy creation issue (Using UI)

Open elwali10 opened this issue 11 months ago • 7 comments

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]

image

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]

image

elwali10 avatar Mar 06 '24 10:03 elwali10

@opensearch-project/admin Could you please transfer this issue to the OpenSearch-Dashboards repo?

peternied avatar Mar 06 '24 16:03 peternied

@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.

rishabh6788 avatar Mar 06 '24 19:03 rishabh6788

@opensearch-project/admin Can you route this to ISM plugin?

manasvinibs avatar Mar 12 '24 18:03 manasvinibs

@mgodwan to triage

mgodwan avatar Mar 13 '24 05:03 mgodwan

Catch All Triage - 1 2 3 4 5

dblock avatar Jun 17 '24 16:06 dblock

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: image

and then inside of creation policy when want to type index patter (without enter) :

image image

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.

lazzio7 avatar Aug 06 '24 22:08 lazzio7

I can confirm this behaviour. When I specify an index pattern like data.*, after saving the policy overview shows:

grafik

The backup fails:

[2024-08-30T20:03:48Z]: Caught exception while creating snapshot daily-snapshot-logs-2024-08-30t20:03:48-acse9stp.

schroedermatthias avatar Aug 30 '24 21:08 schroedermatthias