[rabbitmq-discuss] Unable to delete vhost
Ben Corlett
ben.corlett at gmail.com
Fri Feb 15 14:53:01 GMT 2013
Hey Simon,
Thanks for the quick response.
I did a :
rabbitmqadmin --username=admin --password=***** --vhost=v46997afd74174f1ea120fbeae38877b9 list parameters
and could see :
+-----------------------------------+----------------+---------------------+---------------------------------------------------------------------------------------------------------+
| vhost | name | component | value |
+-----------------------------------+----------------+---------------------+---------------------------------------------------------------------------------------------------------+
| v46997afd74174f1ea120fbeae38877b9 | local-nodename | federation | rabbit at chi-sc-cget-m-rabbitmq-001.cg.company.com |
| v4e73843117c745bb8c1796c2a423b177 | local-nodename | federation | rabbit at chi-sc-cget-m-rabbitmq-001.cg.company.com |
| v6619a14c89694ca99530ee96d97fd40b | local-nodename | federation | rabbit at chi-sc-cget-m-rabbitmq-001.cg.company.com |
| v6619a14c89694ca99530ee96d97fd40b | local-username | federation | auXTfXm39IuzJX |
| v6619a14c89694ca99530ee96d97fd40b | my-upstream | federation-upstream | {"expires": 3600000, "uri": "amqp://auXTfXm39IuzJX:*****@stage-rabbitmq.onx-sc.cg.company.com"} |
+-----------------------------------+----------------+---------------------+---------------------------------------------------------------------------------------------------------+
I removed the local-nodename for v46997afd74174f1ea120fbeae38877b9 with a :
rabbitmqadmin --username=admin --password=***** --vhost=v46997afd74174f1ea120fbeae38877b9 delete parameter name=local-nodename component=federation
parameter deleted
I tried the delete again:
[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}]}
I verified it had been removed :
[rabbitmq at chi-sc-cget-m-rabbitmq-001 ~]$ rabbitmqadmin --username=admin --password=***** --vhost=v46997afd74174f1ea120fbeae38877b9 list parameters
+-----------------------------------+----------------+---------------------+--------------------------------------------------------------------------------------------------------+
| vhost | name | component | value |
+-----------------------------------+----------------+---------------------+--------------------------------------------------------------------------------------------------------+
| v4e73843117c745bb8c1796c2a423b177 | local-nodename | federation | rabbit at chi-sc-cget-m-rabbitmq-001.cg.company.com |
| v6619a14c89694ca99530ee96d97fd40b | local-nodename | federation | rabbit at chi-sc-cget-m-rabbitmq-001.cg.company.com |
| v6619a14c89694ca99530ee96d97fd40b | local-username | federation | auXTfXm39IuzJX |
| v6619a14c89694ca99530ee96d97fd40b | my-upstream | federation-upstream | {"expires": 3600000, "uri": "amqp://auXTfXm39IuzJX:*****@stage-rabbitmq.onx-sc.cg.company.com"} |
+-----------------------------------+----------------+---------------------+--------------------------------------------------------------------------------------------------------+
I tried listing the polices to see if anything was remaining :
[rabbitmq at chi-sc-cget-m-rabbitmq-001 ~]$ rabbitmqadmin --username=admin --password=***** --vhost=v46997afd74174f1ea120fbeae38877b9 list policies
+-----------------------------------+-------------+------------------------------------+---------+----------+
| vhost | name | definition | pattern | priority |
+-----------------------------------+-------------+------------------------------------+---------+----------+
| v6619a14c89694ca99530ee96d97fd40b | federate-me | {"federation-upstream-set": "all"} | ^ps. | 0 |
| v6619a14c89694ca99530ee96d97fd40b | ha-all | {"ha-mode": "all"} | ^ha. | 0 |
+-----------------------------------+-------------+------------------------------------+---------+----------+
No such luck. Anything else likely to be lingering?
Ben.
On 15 Feb 2013, at 14:20, Simon MacMullen <simon at rabbitmq.com> wrote:
> Hi Ben. I think you have found a bug. In theory it should not be necessary to delete parameters / policies that are associated with a vhost before deleting the vhost - but it looks like in 3.0.2 it is. I would invoke "rabbitmqadmin --vhost=... list parameters" and see what you have got left - possibly an instance of "local-nodename".
>
> This should get fixed in the next release.
>
> Cheers, Simon
>
> On 15/02/13 12:08, Ben Corlett wrote:
>> 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.
>>
>>
>> _______________________________________________
>> rabbitmq-discuss mailing list
>> rabbitmq-discuss at lists.rabbitmq.com
>> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>>
>
>
> --
> Simon MacMullen
> RabbitMQ, VMware
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130215/94b8da5a/attachment.htm>
More information about the rabbitmq-discuss
mailing list