HPE OneView
cancel
Showing results for 
Search instead for 
Did you mean: 

Cant delete alerts - alert resource could not be found

 
Tropisk
Occasional Advisor

Cant delete alerts - alert resource could not be found

I'm trying to clear all cleared alerts and it was going good for about 20k+ alerts, but now I get an error message and can't continue.

 

Get-HPOVAlert -State cleared -Count 40 | Remove-HPOVAlert -Confirm

Get-HPOVAlert : The requested resource '/rest/alerts/148101' could not be found. Provide a valid alert URI.
At line:1 char:1
+ Get-HPOVAlert -State cleared -Count 40 | Remove-HPOVAlert -Confirm
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (URI:String) [Get-HPOVAlert], ResourceNotFoundException
+ FullyQualifiedErrorId : ResourceNotFound,Get-HPOVAlert

 

How can I remove this alert so that I can continue with deleting all the cleared alerts?

 

I got the message with OneView 4.20.01.01-0385523 and I just updated to  5.00.00-0400525 and the error is also there.

8 REPLIES 8
BradV
Respected Contributor

Re: Cant delete alerts - alert resource could not be found

The state may have already cleared.  I would repull your active alerts and verify that it still exists.  

Tropisk
Occasional Advisor

Re: Cant delete alerts - alert resource could not be found

I also get the error when only running "Get-HPOVAlert -State cleared -Count 10"

It is like it is trying to retreive an alert that does not exist

 

PS C:\WINDOWS\system32> Get-HPOVAlert -State cleared -Count 10
Get-HPOVAlert : The requested resource '/rest/alerts/148101' could not be found. Provide a valid alert URI.
At line:1 char:1
+ Get-HPOVAlert -State cleared -Count 10
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (URI:String) [Get-HPOVAlert], ResourceNotFoundException
    + FullyQualifiedErrorId : ResourceNotFound,Get-HPOVAlert
Tropisk
Occasional Advisor

Re: Cant delete alerts - alert resource could not be found

I have been using the -TimeSpan switch to continue the cleanup and I'm down to 306 alerts from 88377.

Get-HPOVAlert -State cleared -Count 7500 -TimeSpan (New-TimeSpan -Days 498)

This results in the same error but a different alert resource

PS C:\WINDOWS\system32> Get-HPOVAlert -State cleared -Count 7500 -TimeSpan (New-TimeSpan -Days 498) | Remove-HPOVAlert -Confirm
Get-HPOVAlert : The requested resource '/rest/alerts/152768' could not be found. Provide a valid alert URI.
At line:1 char:1
+ Get-HPOVAlert -State cleared -Count 7500 -TimeSpan (New-TimeSpan -Day ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (URI:String) [Get-HPOVAlert], ResourceNotFoundException
    + FullyQualifiedErrorId : ResourceNotFound,Get-HPOVAlert

 

So we now know that I get the issue with several alerts

ChrisLynch
Neighborhood Moderator

Re: Cant delete alerts - alert resource could not be found

Folks, unless otherwise directed by HPE Support, there is no need to perform this operation.  Alerts are automatically purged from the system that have been cleared in order to make space for newer alerts.

Is there a specific reason why you need to remove all cleared alerts?


I am an HPE employee

Accept or Kudo

Tropisk
Occasional Advisor

Re: Cant delete alerts - alert resource could not be found

Two reasons

* The Activity part of OneView was insane slow to work with. Even when using our best and newest hardware to run the VM.

* The second is to reduce backup size.

 

I'm amazed on how fast things is working now after deleting all the old activities. The backup size was reduced with about 40mb, so not that much. 

We dont need a archive of 100k+ alerts.


So I'm still interested on how I can delete the activities that does not exists, so that I can schedule a task to clean this every couple of months. 

Tropisk
Occasional Advisor

Re: Cant delete alerts - alert resource could not be found

And, this error causes the "Get-HPOVAlert" function to not work.

It is not possible to list up any alerts

 

PS C:\WINDOWS\system32> Get-HPOVAlert
Get-HPOVAlert : The requested resource '/rest/alerts/148101' could not be found. Provide a valid alert URI.
At line:1 char:1
+ Get-HPOVAlert
+ ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (URI:String) [Get-HPOVAlert], ResourceNotFoundException
    + FullyQualifiedErrorId : ResourceNotFound,Get-HPOVAlert
 

PS C:\WINDOWS\system32> 
ChrisLynch
Neighborhood Moderator

Re: Cant delete alerts - alert resource could not be found

In the future, resolving issues like this would be better served opening an Issue on the project tracker.  I did, and have what should be a fix for this issue.  It won't fix the appliance mis-reporting resources from the Index, but at least the PowerShell library will not generate the exception.


I am an HPE employee

Accept or Kudo

ChrisLynch
Neighborhood Moderator

Re: Cant delete alerts - alert resource could not be found

I just published an updated 4.20 release that should address the "resource not found" issue.  Please update your 4.20 library to this version.  Even though I just now closed the issue, you can use that instead to report if you still get the same error when using Get-HPOVAlert, or any other Get-HPOV Cmdlets.


I am an HPE employee

Accept or Kudo