Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear-RabbitMQQueue doesn't work anymore, it throws the exception "Object not found" #31

Open
Spamme1 opened this issue Feb 27, 2018 · 0 comments

Comments

@Spamme1
Copy link

Spamme1 commented Feb 27, 2018

A couple of days ago a script using the "Clear-RabbitMQQueue" stopped working because now the function throws an exception. From the verbose output it seems that the default virtual host "/" shouldn't be un-escaped in the invoked URL (%2f) but for some unknown reasons now it is un-escaped to "/", and the result is an "Object not found" error.
The output of a PS shell below shows, how the queue "Monitor 1-C347847 Technical" exists in the virtual host "/", but clearing it throws the exception "Object not found".

PS C:\Scripts> Get-RabbitMQQueue @rabbitmq -Name "Monitor $name Technical"
VERBOSE: Invoking REST API: http://localhost:15672/api/queues
VERBOSE: GET http://localhost:15672/api/queues with 0-byte payload
VERBOSE: received 36349-byte response of content type application/json

Name                               VHost                     Params          Messages    Unacked     Memory
----                               -----                     ------          ----------- ----------- ------------------
Monitor 1-C347847 Technical        /                         D                         0           0           17,368 B


PS C:\Scripts> Clear-RabbitMQQueue @rabbitmq -Name "Monitor $name Technical" -Confirm:$false
VERBOSE: Invoking REST API: http://localhost:15672/api/queues/%2f/Monitor+1-C347847+Technical/contents
VERBOSE: Switching off UnEscapesDotsAndSlashes flag on UriParser.
VERBOSE: DELETE http://localhost:15672/api/queues///Monitor+1-C347847+Technical/contents with 0-byte payload
VERBOSE: Restoring UriParser flags - switching on UnEscapesDotsAndSlashes flag.
Invoke-RestMethod : {"error":"Object Not Found","reason":"Not Found"}
At C:\Program Files\WindowsPowerShell\Modules\RabbitMQTools\1.2\Public\Clear-RabbitMQQueue.ps1:64 char:13
+             $result = Invoke-RestMethod $url -Credential $Credentials ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : {"error":"Object Not Found","reason":"Not Found"}
At C:\Program Files\WindowsPowerShell\Modules\RabbitMQTools\1.2\Public\Clear-RabbitMQQueue.ps1:64 char:13
+             $result = Invoke-RestMethod $url -Credential $Credentials ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
PS C:\Scripts>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant