Skip to content

Cannot register script health check on service #171

Description

@pparthenhs

Hello to everyone,

I am using the current library (1.4.1) as a maven dependency, also I am using consul version 1.3. But I cannot register script Health check on service.

My code was working on consul version 1.0.7, and using the library version 1.4.0

        NewService.Check serviceCheck = new NewService.Check();
        serviceCheck.setScript("docker exec mysql  mysqladmin -uroot -pxUNvbFUbHvv6hnkrTg86g7fXe87W9fTg status");
        serviceCheck.setInterval("30s");

But now I am getting

Exception in thread "main" OperationException{statusCode=400, statusMessage='Bad Request', statusContent='Invalid check: TTL must be > 0 for TTL checks'}
	at com.ecwid.consul.v1.agent.AgentConsulClient.agentServiceRegister(AgentConsulClient.java:278)
	at com.ecwid.consul.v1.agent.AgentConsulClient.agentServiceRegister(AgentConsulClient.java:265)
	at com.ecwid.consul.v1.ConsulClient.agentServiceRegister(ConsulClient.java:304)
	at eu.orchestrator.agent.Agent.checkIfContainerServiceRunning(Agent.java:838)
	at eu.orchestrator.agent.Agent.phase6(Agent.java:296)
	at eu.orchestrator.agent.Agent.bootAgent(Agent.java:84)
	at eu.orchestrator.agent.Agent.main(Agent.java:69)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions