Deploy Error - Unexpected '<' in Json at response body

I am getting this error when i am trying to deploy the diagram from Modeler, can someone advice please.

deploy Error: invalid json response body at http://localhost:8080/engine-rest/deployment/create reason: Unexpected token < in JSON at position 0

The reason why you are getting this error is because the response is html and not a json. If you change the {responseType:“text”} response type to text you want get this error and you can see that the response is an html file.

But this is not the solution I think that you are targeting the wrong endpoint.
Hope this helps.

Hi Team,

I am trying to follow the instructions to getting started with BPM (Payment retrieval) provided in the forum and I am ending up with the same issue.

"Invalid json response body at http://localhost:8080/rest/deployment reason: Unexpected token < in JSON at position 0. Can you please help?

Hi all, I am new in Camunda world and I know very few about web coding world.

Where and how to modify the responseType property ?

I am using Camunda community edition 7.12, deployed to Tomcat, and Camunda Modeler 2.0.0

I had the same problem of this topic, i.e., receiving the error about "unexpected < in JSON…’ when I try to use the menu “Deploy Current Diagram” and click “Deploy”.

Can you upload your model?
Also could you use a more recent version of the modeler, 3.7.0 is already out - you can download it here:

Thanks Niall.

(note that during the post, I drop the portion ‘http://’ from links, otherwise the web system rejects my post, as new user can just use two links)

About Modeler release 3.7.0, I installed it. Its deployment modal form is a little bit different, anyway it reads ‘Could not find the Camunda endpoint. Please checl the URL and make sure Camunda is running’
with the following endpoint hint ‘localhost:8080/rest’ which is different from the one proposed by Modeler 2.0.0 (‘localhost:8080/engine-rest/deployment/create’)
However, with each of them, the botton Deploy remains disabled (and also with a mix, as ‘localhost:8080/rest/deployment/create’)

Please, explain the conditions to have Deploy button enabled. Does it happen even before writing login information (Authentication, etc.) ? Unfortunately, documentation from docs.camunda.org/get-started/quick-start/deploy/ hints ‘engine-rest’.

About uploading the model, is there a way to attach to the post ?:

Yeah - it’s annoying and confusing but for now:

localhost:8080/rest/deployment/create
If you’re deploying to the springboot distro

localhost:8080/engine-rest/deployment/create
If you’re deploying to any other distro (tomcat, wildfly etc.)

You need to make sure that you have the platform running in one way or another before deploying. Depending on how you’re setup the distro authentication may be required.

I deployed Camunda community edition to tomcat environment.

Anyway, using localhost:8080/engine-rest/deployment/create, Deploy button is not enabled and the warning about endpoint remains. I suppose it is the correct endpoint since modeler 2.0.0 was able to send the deployment request using it.

About the model, can I attach it somewhere ?

Thanks for your support.

You should upload your model to the forum.
Or upload your project to github and link to it.

Hi @mauro,

the latest version of the modeler adds /deployment/create automatically.

You just have to choose between http://localhost:8080/engine-rest or http://localhost:8080/rest.

You should take the first one.

Hope this helps, Ingo

Mine latest version, 3.7.0 (26th of Feb 2020) did not add it automatically.

I tried both localhost:8080/rest/deployment/create and localhost:8080/engine-rest/deployment/create, but Deploy button remains disabled with each of them.

Any hint about possible causes ? Modeler 2.0.0 worked with “engine-rest” case (I use tomcat).

explain what you mean by this and also please upload your model.

Yes Niall, the Deploy button remains disable, I cannot press it, either if I use the path with ‘engine-rest’ or if I use the path with ‘rest’.

Thanks

What does the error message say?

The same as wrote above:

‘Could not find the Camunda endpoint. Please checl the URL and make sure Camunda is running’
(in the ‘Endpoint Configuration’ section)

It appears on the deplyment form before I can try to press Deploy button (but I can try to change the path).

Have you started Camunda up?
Are you able to open up this URL? - localhost:8080/camunda

Oh yes, I was just going to add this note.

The first attempt was I accessed again to the Camunda URL and it worked fine.

Well, I am going to try to close and reopen Tomcat, too.
I’ll write you in a while.

Thanks.

Interesting note: while Tomcat/Camunda are down, the message changes:

‘Could not connect to the server. Did you run the engine?’
alternating with attempts to ‘Validation connection…’

After Tomcat/Camunda restart, the message is the same as earlier, hence with Deploy button disabled, too.

Additional note: after installing Camund community edition, I did NOT change any configuration (database, LDAP, etc.). I am trying first to be able to store process definitions, and learn to work on Camunda world.

hi @mauro,

just to clarify my comment:

in the background.

If you enter http://localhost:8080/engine-rest, the button should be enabled.

Hope this helps, Ingo

Yes, it was clear.

Nevertheless, in my case, it does not :frowning:

Other options /configurations to check somewhere ?

Thanks