[rabbitmq-discuss] Unable to delete vhost

Ben Corlett ben.corlett at gmail.com
Fri Feb 15 12:08:08 GMT 2013


I am having some issues when trying to delete a vhost. 

I'm using the latest version of rabbitmq 3.0.2 and my set up has two 
clusters (2 machines in each) with a federation for pub/sub messages. 

When trying to remove the vhost via the web interface I get the error :

Internal Server Error

The server encountered an error while processing this request:
{throw,
    {error,
        {{badmatch,
             {error_string,
                 "Validation failed\n\nname not recognised: undefined\n"}},
         [{rabbit_vhost,'-internal_delete/1-lc$^1/1-1-',2},
          {rabbit_vhost,internal_delete,1},
          {rabbit_vhost,'-delete/1-fun-0-',1},
          {mnesia_tm,apply_fun,3},
          {mnesia_tm,execute_transaction,5},
          {rabbit_misc,'-execute_mnesia_transaction/1-fun-0-',1},
          {worker_pool_worker,handle_call,3},
          {gen_server2,handle_msg,2}]}},
    [{rabbit_misc,execute_mnesia_transaction,1},
     {rabbit_mgmt_wm_vhost,delete_resource,2},
     {webmachine_resource,resource_call,3},
     {webmachine_resource,do,3},
     {webmachine_decision_core,resource_call,1},
     {webmachine_decision_core,decision,1},
     {webmachine_decision_core,handle_request,2},
     {rabbit_webmachine,'-makeloop/1-fun-0-',2}]}

When trying to remove the vhost from the command line I get something 
similar :

[rabbitmq at chi-sc-cget-m-rabbitmq-001 ~]$ rabbitmqctl delete_vhost 
v4e73843117c745bb8c1796c2a423b177
Deleting vhost "v4e73843117c745bb8c1796c2a423b177" ...
Error: {{badmatch,{error_string,"Validation failed\n\nname not recognised: 
undefined\n"}},
        [{rabbit_vhost,'-internal_delete/1-lc$^1/1-1-',2},
         {rabbit_vhost,internal_delete,1},
         {rabbit_vhost,'-delete/1-fun-0-',1},
         {mnesia_tm,apply_fun,3},
         {mnesia_tm,execute_transaction,5},
         {rabbit_misc,'-execute_mnesia_transaction/1-fun-0-',1},
         {worker_pool_worker,handle_call,3},
         {gen_server2,handle_msg,2}]}


Here are the commands to initially set up the vhost via a script (the hosts 
used here are vips which are load balanced across both nodes in the 
cluster) :

Running ... rabbitmqadmin --host=stage-rabbitmq.chi-sc.cg.company.com 
--port=80 --username=admin --password=***** declare vhost 
name=v46997afd74174f1ea120fbeae38877b9 2>&1
vhost declared
Running ... rabbitmqadmin --host=stage-rabbitmq.onx-sc.cg.company.com 
--port=80 --username=admin --password=***** declare vhost 
name=v46997afd74174f1ea120fbeae38877b9 2>&1
vhost declared
Running ... rabbitmqadmin --host=stage-rabbitmq.chi-sc.cg.company.com 
--port=80 --username=admin --password=***** declare user 
name=aumh4l0SBFJBe3 password=***** tags= 2>&1
user declared
Running ... rabbitmqadmin --host=stage-rabbitmq.onx-sc.cg.company.com 
--port=80 --username=admin --password=***** declare user 
name=aumh4l0SBFJBe3 password=***** tags= 2>&1
user declared
Running ... rabbitmqadmin --host=stage-rabbitmq.chi-sc.cg.company.com 
--port=80 --username=admin --password=***** declare permission 
vhost=v46997afd74174f1ea120fbeae38877b9 user=aumh4l0SBFJBe3 configure=.* 
read=.* write=.* 2>&1
permission declared
Running ... rabbitmqadmin --host=stage-rabbitmq.onx-sc.cg.company.com 
--port=80 --username=admin --password=***** declare permission 
vhost=v46997afd74174f1ea120fbeae38877b9 user=aumh4l0SBFJBe3 configure=.* 
read=.* write=.* 2>&1
permission declared
Running ... rabbitmqadmin --host=stage-rabbitmq.chi-sc.cg.company.com 
--port=80 --username=admin --password=***** declare permission 
vhost=v46997afd74174f1ea120fbeae38877b9 user=admin configure=.* read=.* 
write=.* 2>&1
permission declared
Running ... rabbitmqadmin --host=stage-rabbitmq.onx-sc.cg.company.com 
--port=80 --username=admin --password=***** declare permission 
vhost=v46997afd74174f1ea120fbeae38877b9 user=admin configure=.* read=.* 
write=.* 2>&1
permission declared
Running ... rabbitmqadmin --host=stage-rabbitmq.chi-sc.cg.company.com 
--port=80 --username=admin --password=***** 
--vhost=v46997afd74174f1ea120fbeae38877b9 declare policy name=federate-me 
pattern="^ps." 'definition={"federation-upstream-set":"all"}' 2>&1
policy declared
Running ... rabbitmqadmin --host=stage-rabbitmq.onx-sc.cg.company.com 
--port=80 --username=admin --password=***** 
--vhost=v46997afd74174f1ea120fbeae38877b9 declare policy name=federate-me 
pattern="^ps." 'definition={"federation-upstream-set":"all"}' 2>&1
policy declared
Running ... rabbitmqadmin --host=stage-rabbitmq.chi-sc.cg.company.com 
--port=80 --username=admin --password=***** 
--vhost=v46997afd74174f1ea120fbeae38877b9 declare policy name=ha-all 
pattern="^ha." 'definition={"ha-mode":"all"}' 2>&1
policy declared
Running ... rabbitmqadmin --host=stage-rabbitmq.onx-sc.cg.company.com 
--port=80 --username=admin --password=***** 
--vhost=v46997afd74174f1ea120fbeae38877b9 declare policy name=ha-all 
pattern="^ha." 'definition={"ha-mode":"all"}' 2>&1
policy declared
Running ... rabbitmqadmin --host=stage-rabbitmq.chi-sc.cg.company.com 
--port=80 --username=admin --password=***** 
--vhost=v46997afd74174f1ea120fbeae38877b9 declare parameter 
component=federation-upstream name=my-upstream 
value='{"uri":"amqp://aumh4l0SBFJBe3:*****@stage-rabbitmq.onx-sc.cg.company.com","expires":3600000}'
parameter declared
Running ... rabbitmqadmin --host=stage-rabbitmq.chi-sc.cg.company.com 
--port=80 --username=admin --password=***** 
--vhost=v46997afd74174f1ea120fbeae38877b9 declare parameter 
component=federation name=local-username value='"aumh4l0SBFJBe3"'
parameter declared
Running ... rabbitmqadmin --host=stage-rabbitmq.onx-sc.cg.company.com 
--port=80 --username=admin --password=***** 
--vhost=v46997afd74174f1ea120fbeae38877b9 declare parameter 
component=federation-upstream name=my-upstream 
value='{"uri":"amqp://aumh4l0SBFJBe3:*****@stage-rabbitmq.chi-sc.cg.company.com","expires":3600000}'
parameter declared
Running ... rabbitmqadmin --host=stage-rabbitmq.onx-sc.cg.company.com 
--port=80 --username=admin --password=***** 
--vhost=v46997afd74174f1ea120fbeae38877b9 declare parameter 
component=federation name=local-username value='"aumh4l0SBFJBe3"'
parameter declared
Running ... rabbitmqadmin --host=stage-rabbitmq.chi-sc.cg.company.com 
--port=80 --username=admin --password=***** declare user name=urFZ5xudDA1Sk 
password=***** tags= 2>&1
user declared
Running ... rabbitmqadmin --host=stage-rabbitmq.onx-sc.cg.company.com 
--port=80 --username=admin --password=***** declare user name=urFZ5xudDA1Sk 
password=***** tags= 2>&1
user declared
Running ... rabbitmqadmin --host=stage-rabbitmq.chi-sc.cg.company.com 
--port=80 --username=admin --password=***** declare permission 
vhost=v46997afd74174f1ea120fbeae38877b9 user=urFZ5xudDA1Sk configure=.* 
read=.* write=.* 2>&1
permission declared
Running ... rabbitmqadmin --host=stage-rabbitmq.onx-sc.cg.company.com 
--port=80 --username=admin --password=***** declare permission 
vhost=v46997afd74174f1ea120fbeae38877b9 user=urFZ5xudDA1Sk configure=.* 
read=.* write=.* 2>&1
permission declared
Running ... rabbitmqadmin --host=stage-rabbitmq.chi-sc.cg.company.com 
--port=80 --username=admin --password=***** declare permission 
vhost=v46997afd74174f1ea120fbeae38877b9 user=admin configure=.* read=.* 
write=.* 2>&1
permission declared
Running ... rabbitmqadmin --host=stage-rabbitmq.onx-sc.cg.company.com 
--port=80 --username=admin --password=***** declare permission 
vhost=v46997afd74174f1ea120fbeae38877b9 user=admin configure=.* read=.* 
write=.* 2>&1
permission declared

Here are the commands used to clean away this vhost :

Running ... rabbitmqadmin --host=stage-rabbitmq.chi-sc.cg.company.com 
--port=80 --username=admin --password=***** delete user name=urFZ5xudDA1Sk 
2>&1
user deleted\n
Running ... rabbitmqadmin --host=stage-rabbitmq.onx-sc.cg.company.com 
--port=80 --username=admin --password=***** delete user name=urFZ5xudDA1Sk 
2>&1
user deleted\n
Running ... rabbitmqadmin --host=stage-rabbitmq.chi-sc.cg.company.com 
--port=80 --username=admin --password=***** 
--vhost=v46997afd74174f1ea120fbeae38877b9 delete parameter 
component=federation-upstream name=my-upstream 2>&1
parameter deleted\n
Running ... rabbitmqadmin --host=stage-rabbitmq.onx-sc.cg.company.com 
--port=80 --username=admin --password=***** 
--vhost=v46997afd74174f1ea120fbeae38877b9 delete parameter 
component=federation-upstream name=my-upstream 2>&1
parameter deleted\n
Running ... rabbitmqadmin --host=stage-rabbitmq.chi-sc.cg.company.com 
--port=80 --username=admin --password=***** 
--vhost=v46997afd74174f1ea120fbeae38877b9 delete parameter 
component=federation name=local-username 2>&1
parameter deleted\n
Running ... rabbitmqadmin --host=stage-rabbitmq.onx-sc.cg.company.com 
--port=80 --username=admin --password=***** 
--vhost=v46997afd74174f1ea120fbeae38877b9 delete parameter 
component=federation name=local-username 2>&1
parameter deleted\n
Running ... rabbitmqadmin --host=stage-rabbitmq.chi-sc.cg.company.com 
--port=80 --username=admin --password=***** 
--vhost=v46997afd74174f1ea120fbeae38877b9 delete policy name=federate-me 
2>&1
policy deleted\n
Running ... rabbitmqadmin --host=stage-rabbitmq.onx-sc.cg.company.com 
--port=80 --username=admin --password=***** 
--vhost=v46997afd74174f1ea120fbeae38877b9 delete policy name=federate-me 
2>&1
policy deleted\n
Running ... rabbitmqadmin --host=stage-rabbitmq.chi-sc.cg.company.com 
--port=80 --username=admin --password=***** 
--vhost=v46997afd74174f1ea120fbeae38877b9 delete policy name=ha-all 2>&1
policy deleted\n
Running ... rabbitmqadmin --host=stage-rabbitmq.onx-sc.cg.company.com 
--port=80 --username=admin --password=***** 
--vhost=v46997afd74174f1ea120fbeae38877b9 delete policy name=ha-all 2>&1
policy deleted\n
Running ... rabbitmqadmin --host=stage-rabbitmq.chi-sc.cg.company.com 
--port=80 --username=admin --password=***** delete vhost 
name=v46997afd74174f1ea120fbeae38877b9 2>&1
Traceback (most recent call last):\n  File 
"/apps/nimbus/built/rabbitmq/3.0.0/sbin/rabbitmqadmin", line 889, in 
<module>\n    main()\n  File 
"/apps/nimbus/built/rabbitmq/3.0.0/sbin/rabbitmqadmin", line 354, in main\n 
   method()\n  File "/apps/nimbus/built/rabbitmq/3.0.0/sbin/rabbitmqadmin", 
line 534, in invoke_delete\n    self.delete(uri)\n  File 
"/apps/nimbus/built/rabbitmq/3.0.0/sbin/rabbitmqadmin", line 386, in 
delete\n    return self.http("DELETE", "/api%s" % path, "")\n  File 
"/apps/nimbus/built/rabbitmq/3.0.0/sbin/rabbitmqadmin", line 421, in http\n 
   % (resp.status, resp.reason, path, resp.read()))\nException: Received 
500 Internal Server Error for path 
/api/vhosts/v46997afd74174f1ea120fbeae38877b9\n<html><head><title>500 
Internal Server Error</title></head><body><h1>Internal Server Error</h1>The 
server encountered an error while processing this 
request:<br><pre>{throw,\n    {error,\n        {{badmatch,\n             
{error_string,\n                 "Validation failed\n\nname not recognised: 
undefined\n"}},\n         
[{rabbit_vhost,'-internal_delete/1-lc$^1/1-1-',2},\n         
 {rabbit_vhost,internal_delete,1},\n         
 {rabbit_vhost,'-delete/1-fun-0-',1},\n          {mnesia_tm,apply_fun,3},\n 
         {mnesia_tm,execute_transaction,5},\n         
 {rabbit_misc,'-execute_mnesia_transaction/1-fun-0-',1},\n         
 {worker_pool_worker,handle_call,3},\n         
 {gen_server2,handle_msg,2}]}},\n   
 [{rabbit_misc,execute_mnesia_transaction,1},\n     
{rabbit_mgmt_wm_vhost,delete_resource,2},\n     
{webmachine_resource,resource_call,3},\n     {webmachine_resource,do,3},\n 
    {webmachine_decision_core,resource_call,1},\n     
{webmachine_decision_core,decision,1},\n     
{webmachine_decision_core,handle_request,2},\n     
{rabbit_webmachine,'-makeloop/1-fun-0-',2}]}</pre><P><HR><ADDRESS>mochiweb+webmachine 
web server</ADDRESS></body></html>\n
Running ... rabbitmqadmin --host=stage-rabbitmq.chi-sc.cg.company.com 
--port=80 --username=admin --password=***** delete user name=aumh4l0SBFJBe3 
2>&1
user deleted\n
Running ... rabbitmqadmin --host=stage-rabbitmq.onx-sc.cg.company.com 
--port=80 --username=admin --password=***** delete user name=aumh4l0SBFJBe3 
2>&1
user deleted\n

Anyone got any ideas?

Thanks,

Ben.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130215/dacdad8b/attachment.htm>


More information about the rabbitmq-discuss mailing list