Unable to start SpringBoot application when Consul is configured with ACL

Hi Consul Team,

I have integrated Consul with SpringBoot application. Initially, I have connected Consul and SpringBoot application and did some testing. Everything was working good. Now, I have enabled ACLs, added the tokens (anonymous, Bootstrap Token (Global Management), Agent Token) and the required policies too.

To connect to Consul with ACL enabled from my SpringBoot application, I have added the property below in the bootstrap.yml of my application.

spring.cloud.consul.config.acl-token

I have provided the Agent Token value for this property. The application is not booting up, giving the error below.

Caused by: com.ecwid.consul.v1.OperationException: OperationException(statusCode=403, statusMessage=‘Forbidden’, statusContent=‘Permission denied: token with AccessorID ‘00000000-0000-0000-0000-000000000002’ lacks permission ‘service:write’ on “AppName”’)

I have added the write policy too under the anonymous token but I am not able to understand why it is using the anonymous token even though I have mentioned the Agent token. Even under the anonymous token, I have created the policy. But still, receiving this error and blocking our progress.

Please help me to resolve this issue.

Thanks & Regards,
Santosh.

This forum specialises in Hashicorp products - but this question is more about “How do I configure a particular third party client using Spring Boot?”.

You might need to go instead to the help resources of that particular third party client, as you may not find anyone familiar with it here.

I am sorry, I didn’t understand your reply. I am speaking about Consul which is under Hashicorp right?

Anyway, I receive the same error when I run a consul command.

I have setup a consul agent server cluster (3 nodes). All these servers are connected with each other and communicating good. Now, after I added the ACL, I am receiving this error when I ran the consul commands for example consul leave command.

Please provide more info on this error.