Bootstrap FreeKB - RabbitMQ - Resolve "Parameter does not exist" when attempting to delete a terminated shovel
RabbitMQ - Resolve "Parameter does not exist" when attempting to delete a terminated shovel

Updated:   |  RabbitMQ articles

Let's say Parameter does not exist is being returned when attempting to delete a shovel using the rabbitmqctl delete_shovel command.

~]# rabbitmqctl delete_shovel --vhost foo shovel001
Deleting shovel shovel001 in vhost foo
Error:
{{:badmatch, {:error_string, 'Parameter does not exist'}}, [{:rabbit_shovel_util, :delete_shovel, 3, [file: 'src/rabbit_shovel_util.erl', line: 44]}]}

 

The rabbitmqctl list_parameters command can be used to confirm that the parameter does not exist. In this example, there are no parameters, which is why the delete_shovel command is returning "parameter does not exist".

~]# rabbitmqctl list_parameters --vhost foo
Listing runtime parameters for vhost "foo" ...

 

However, let's say the rabbitmqctl shovel_status command lists the shovel. Most likely, the shovel will be in a terminated state.

~]# rabbitmqctl shovel_status --formatter json | python -m json.tool
[
    {
        "destination": "",
        "last_changed": "2022-02-03 14:36:26",
        "name": "shovel001",
        "source": "",
        "state": "terminated",
        "termination_reason": "\"needed a restart\"",
        "type": "dynamic",
        "vhost": "foo"
    }
]

 

In this scenario, restarting the RabbitMQ server should remove the terminated shovel. However, it is not ideal to have to restart the entire RabbitMQ server. Another option is to use the rabbitmq-plugins disable command to disable the rabbitmq_shovel and rabbitmq_shovel_management plugins.

AVOID TROUBLE

Be aware that disabling the rabbitmq_shovel and rabbitmq_shovel_management plugins will remove every shovel running on the RabbitMQ node. You may want to log the running shovels so that the shovels can be recreated after the plugins have been disabled and then enabled.

rabbitmq-plugins disable rabbitmq_shovel

 

And to then use the rabbitmq-plugins enable command to enable the rabbitmq_shovel and rabbitmq_shovel_management plugins.

rabbitmq-plugins disable rabbitmq_shovel

 

After the plugins have been disabled and then enabled, there should be no shovels running on the RabbitMQ node, which you can confirm using the rabbitmqctl shovel_status command.

~]# rabbitmqctl shovel_status --formatter json | python -m json.tool
[]

 

You can now use the rabbitmqctl set_parameter command to recreate the shovels that were removed.

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 366876 in the box below so that we can be sure you are a human.