Error in command log-analytics storage purge-storage-data
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 669
- Forks
- 236
- Avg merge
- 1m
- Merged PRs (30d)
- 4
Description
I am purging logs using OCI CLI
oci log-analytics storage purge-storage-data --compartment-id "$MONITORING_COMPARTMENT_OCID" \
--namespace-name "$TENANCY_NAME" --purge-query-string "\"log group\"=\"${STACK_NAME}\"" \
--time-data-ended "$(date +%Y-%m-%d -d '+1 day')" --wait-for-state SUCCEEDED --wait-for-state FAILED \
--wait-interval-seconds 10
This is purging logs, I can confirm it from web console, but however this command return error as,
Action completed. Waiting until the work request has entered state: ('SUCCEEDED', 'FAILED')
Encountered error while waiting for work request to enter the specified state. Outputting last known resource state
{
"opc-work-request-id": "ocid1.loganalyticsstorageworkrequest.oc1.phx.amaaaaaaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwzndq"
}
TypeError: get_storage_work_request() missing 1 required positional argument: 'namespace_name'
due to this error, seems command is not waiting until mentioned logs are purged.
And early exiting with error.
However purge is happening.
I have verified namespace is provided correctly --namespace-name "$TENANCY_NAME"
& this variable will not be blank, it is holding tenancy name, which is also same as object storage namespace.
This is web console, where purge requests are showing success.. and logs are purged also as per the query submitted.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the OCI CLI entry point for log-analytics storage purge-storage-data and inspect the call to get_storage_work_request, which the error shows is missing namespace_name. Reproduce the listed purge command with valid values and trace the work-request wait path. Done means the command waits for the purge work request and exits without the TypeError while preserving the reported final state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100