tleyden / open-ocr

Run your own OCR-as-a-Service using Tesseract and Docker
Apache License 2.0
1.33k stars 223 forks source link

Error: Unable to unmarshal json while running open-ocr on Tutum #49

Closed avinashsonee closed 8 years ago

avinashsonee commented 8 years ago

Hi,

I was trying to run open-ocr on Tutum for a personal project.

I've followed the instructions on https://github.com/tleyden/open-ocr/wiki/Installation-on-Tutum

I've completed all the steps but when I finally try to use it, I get the following error:

Unable to unmarshal json

The command I am running is:

C:\Users\sarkar\Downloads\curl-7.45.0-win64-mingw\bin>curl -X POST -H "Content-Type: application/json" -d '{"img_url":"http://bit.ly/ocrimage","engine":"tesseract"}' http://open-ocr-httpd-1.avinashsonee.cont.tutum.io:32772/ocr

In tutum logs, I get the following error:

open-ocr-httpd-1 | 2015-11-19T15:33:22.424910294Z 15:33:22.424668 OCR_HTTP: Starting listener on :8080 open-ocr-httpd-1 | 2015-11-19T15:34:23.939174296Z 15:34:23.938799 OCR_HTTP: serveHttp called open-ocr-httpd-1 | 2015-11-19T15:34:23.939211461Z 15:34:23.938850 ERROR: invalid character '\'' looking for beginning of value -- open-ocr.(*OcrHttpHandler).ServeHTTP() at ocr_http_handler.go:30

Attached below are my configurations on Tutum for your reference.

image

image

image

image

image

Let me know if you require any more details.

Thanks :)

tleyden commented 8 years ago

I just tried it against your server, and it's working!!

$ curl -X POST -H "Content-Type: application/json" -d '{"img_url":"http://bit.ly/ocrimage","engine":"tesseract"}' http://open-ocr-httpd-1.avinashsonee.cont.tutum.io:32772/ocr
You can create local variables for the pipelines within the template by
prefixing the variable name with a “$" sign. Variable names have to be
composed of alphanumeric characters and the underscore. In the example
below I have used a few variations that work for variable names.

That tells me that it's an issue with the way things are quoted/escaped on the command line. The example works on Linux, but apparently the Windows shell has different quoting/escaping mechanisms.

You might check this Stack Overflow post, or consider posting your own Stack Overflow question. If you figure it out, let me know and I'll update the README.

Another option would be to use a Graphical HTTP client.

Thanks for the issue report! I'm closing it, but feel free to post more comments here.

avinashsonee commented 8 years ago

Thanks for the info. I'm able to run it now :)

tleyden commented 8 years ago

Glad to hear!