External task client fetch and lock tasks 404 error

Hi. I’m using camunda-bpm-spring-boot-starter-external-task-client lib to fetch tasks. When the springboot application has started, it occurred an error. Here are the stack trace:

2022-02-23 14:26:20.470  INFO 56209 --- [           main] org.camunda.bpm.client                   : TASK/CLIENT-01026 Discovered data format provider: org.camunda.bpm.client.variable.impl.format.json.JacksonJsonDataFormatProvider[name = application/json]
2022-02-23 14:26:20.471  INFO 56209 --- [           main] org.camunda.bpm.client                   : TASK/CLIENT-01025 Discovered data format: org.camunda.bpm.client.variable.impl.format.json.JacksonJsonDataFormat[name = application/json]
2022-02-23 14:26:20.471  INFO 56209 --- [           main] org.camunda.bpm.client                   : TASK/CLIENT-01026 Discovered data format provider: org.camunda.bpm.client.variable.impl.format.serializable.SerializableDataFormatProvider[name = application/x-java-serialized-object]
2022-02-23 14:26:20.472  INFO 56209 --- [           main] org.camunda.bpm.client                   : TASK/CLIENT-01025 Discovered data format: org.camunda.bpm.client.variable.impl.format.serializable.SerializableDataFormat[name = application/x-java-serialized-object]
2022-02-23 14:26:20.472  INFO 56209 --- [           main] org.camunda.bpm.client                   : TASK/CLIENT-01026 Discovered data format provider: org.camunda.bpm.client.variable.impl.format.xml.DomXmlDataFormatProvider[name = application/xml]
2022-02-23 14:26:20.475  INFO 56209 --- [           main] org.camunda.bpm.client                   : TASK/CLIENT-01025 Discovered data format: org.camunda.bpm.client.variable.impl.format.xml.DomXmlDataFormat[name = application/xml]
2022-02-23 14:26:20.480 DEBUG 56209 --- [           main] org.camunda.bpm.client.spring            : TASK/CLIENT/SPRING-01003 Client successfully bootstrapped
2022-02-23 14:26:20.519  INFO 56209 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8081 (http) with context path ''
2022-02-23 14:26:20.533  INFO 56209 --- [           main] c.e.e.ExternalClientApplication          : Started ExternalClientApplication in 2.348 seconds (JVM running for 3.207)
2022-02-23 14:26:20.535 DEBUG 56209 --- [           main] org.camunda.bpm.client.spring            : TASK/CLIENT/SPRING-02006 Subscription for topic name test-external-task opened
2022-02-23 14:26:20.536 DEBUG 56209 --- [           main] org.camunda.bpm.client.spring            : TASK/CLIENT/SPRING-02005 Subscription for topic name test-external-task initialized
2022-02-23 14:26:20.642 ERROR 56209 --- [criptionManager] org.camunda.bpm.client                   : TASK/CLIENT-03001 Exception while fetch and lock task.

org.camunda.bpm.client.impl.EngineClientException: TASK/CLIENT-02001 Request 'POST http://localhost:8080/engine-rest/external-task/fetchAndLock HTTP/1.1' returned error: status code '404' - message: status code: 404, reason phrase: <html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.21.5</center>
</body>
</html>

	at org.camunda.bpm.client.impl.EngineClientLogger.exceptionWhileReceivingResponse(EngineClientLogger.java:30) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
	at org.camunda.bpm.client.impl.RequestExecutor.executeRequest(RequestExecutor.java:97) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
	at org.camunda.bpm.client.impl.RequestExecutor.postRequest(RequestExecutor.java:74) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
	at org.camunda.bpm.client.impl.EngineClient.fetchAndLock(EngineClient.java:83) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
	at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.fetchAndLock(TopicSubscriptionManager.java:135) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
	at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.acquire(TopicSubscriptionManager.java:101) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
	at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.run(TopicSubscriptionManager.java:87) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
	at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
Caused by: org.apache.http.client.HttpResponseException: status code: 404, reason phrase: <html>

Here is my external-task-client application.yml file

camunda:
  bpm:
    client:
      base-url: http://localhost:8080/engine-rest
      worker-id: spring-boot-worker
      max-tasks: 5

logging:
  level:
    org:
      camunda:
        bpm:
          client:
            spring: DEBUG

server:
  port: 8081

The Camunda rest engine has started on port 8080 in another process, why does the external task client send a HTTP request to fetch and lock task failed ? I curl [quote=“farewe1l, post:1, topic:33221, full:true”]
Hi. I’m using camunda-bpm-spring-boot-starter-external-task-client lib to fetch tasks. When the springboot application has started, it occurred an error. Here are the stack trace:

2022-02-23 14:26:20.470  INFO 56209 --- [           main] org.camunda.bpm.client                   : TASK/CLIENT-01026 Discovered data format provider: org.camunda.bpm.client.variable.impl.format.json.JacksonJsonDataFormatProvider[name = application/json]
2022-02-23 14:26:20.471  INFO 56209 --- [           main] org.camunda.bpm.client                   : TASK/CLIENT-01025 Discovered data format: org.camunda.bpm.client.variable.impl.format.json.JacksonJsonDataFormat[name = application/json]
2022-02-23 14:26:20.471  INFO 56209 --- [           main] org.camunda.bpm.client                   : TASK/CLIENT-01026 Discovered data format provider: org.camunda.bpm.client.variable.impl.format.serializable.SerializableDataFormatProvider[name = application/x-java-serialized-object]
2022-02-23 14:26:20.472  INFO 56209 --- [           main] org.camunda.bpm.client                   : TASK/CLIENT-01025 Discovered data format: org.camunda.bpm.client.variable.impl.format.serializable.SerializableDataFormat[name = application/x-java-serialized-object]
2022-02-23 14:26:20.472  INFO 56209 --- [           main] org.camunda.bpm.client                   : TASK/CLIENT-01026 Discovered data format provider: org.camunda.bpm.client.variable.impl.format.xml.DomXmlDataFormatProvider[name = application/xml]
2022-02-23 14:26:20.475  INFO 56209 --- [           main] org.camunda.bpm.client                   : TASK/CLIENT-01025 Discovered data format: org.camunda.bpm.client.variable.impl.format.xml.DomXmlDataFormat[name = application/xml]
2022-02-23 14:26:20.480 DEBUG 56209 --- [           main] org.camunda.bpm.client.spring            : TASK/CLIENT/SPRING-01003 Client successfully bootstrapped
2022-02-23 14:26:20.519  INFO 56209 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8081 (http) with context path ''
2022-02-23 14:26:20.533  INFO 56209 --- [           main] c.e.e.ExternalClientApplication          : Started ExternalClientApplication in 2.348 seconds (JVM running for 3.207)
2022-02-23 14:26:20.535 DEBUG 56209 --- [           main] org.camunda.bpm.client.spring            : TASK/CLIENT/SPRING-02006 Subscription for topic name test-external-task opened
2022-02-23 14:26:20.536 DEBUG 56209 --- [           main] org.camunda.bpm.client.spring            : TASK/CLIENT/SPRING-02005 Subscription for topic name test-external-task initialized
2022-02-23 14:26:20.642 ERROR 56209 --- [criptionManager] org.camunda.bpm.client                   : TASK/CLIENT-03001 Exception while fetch and lock task.

org.camunda.bpm.client.impl.EngineClientException: TASK/CLIENT-02001 Request 'POST http://localhost:8080/engine-rest/external-task/fetchAndLock HTTP/1.1' returned error: status code '404' - message: status code: 404, reason phrase: <html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.21.5</center>
</body>
</html>

	at org.camunda.bpm.client.impl.EngineClientLogger.exceptionWhileReceivingResponse(EngineClientLogger.java:30) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
	at org.camunda.bpm.client.impl.RequestExecutor.executeRequest(RequestExecutor.java:97) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
	at org.camunda.bpm.client.impl.RequestExecutor.postRequest(RequestExecutor.java:74) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
	at org.camunda.bpm.client.impl.EngineClient.fetchAndLock(EngineClient.java:83) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
	at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.fetchAndLock(TopicSubscriptionManager.java:135) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
	at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.acquire(TopicSubscriptionManager.java:101) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
	at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.run(TopicSubscriptionManager.java:87) ~[camunda-external-task-client-7.16.0.jar:7.16.0]
	at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
Caused by: org.apache.http.client.HttpResponseException: status code: 404, reason phrase: <html>

Here is my external-task-client application.yml file

camunda:
  bpm:
    client:
      base-url: http://localhost:8080/engine-rest
      worker-id: spring-boot-worker
      max-tasks: 5

logging:
  level:
    org:
      camunda:
        bpm:
          client:
            spring: DEBUG

server:
  port: 8081

The Camunda rest engine has started on port 8080 in another process, why does the external task client send a HTTP request to fetch and lock task failed? And when I curl http://localhost:8080//engine-rest/external-task/fetchAndLock whitout nothing, the Camunda rest engine returns {"type":"NullPointerException","message":null}. It’s strange. By the way, the version of the Camuda lib is 7.16.0.

Are you able to reach camunda directly through the rest API with this call

localhost:8080/engine-rest/engine
if everything is working on the Camunda side it should return

[{"name":"default"}]

Yes, it’s work.

Are you adding anything else to the call?
Any security?

No auth, just simple fetch request.

I curl the fetchAndLock api, and it’s work.
image
But the program was failed, when it has started.
By the way, there are no url filter in my project.

1 Like