Search code examples
nats.io

Enabling account deletion on nats server


I was trying to prune some users from my nats server by doing:

nsc push --system-account SYS -u nats://localhost:4222 -P

but I got the following error:

server nats-comm-2 responded with error: delete accounts request by SOME_KEY_VALUE failed - delete must be enabled in server config

The meaning of the error is pretty obvious, when I examine the help documentation for nsc push -P:

Only works with nats-resolver enabled nats-server. Mutually exclusive of account-removal/diff

But I'm not sure how to enable this in my nats server config. How do I allow for account pruning?


Solution

  • I found documentation in the resolver section, here, showing that I could add allow_delete: true to the config, but as the YAML format is in camel-case, I had to modify it to be allowDelete: true instead.

    nats:
      auth:
        enabled: true
        resolver:
          type: full
          allowDelete: true