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

Test the REST API -- Connection Refused Issue #26

Closed jnevin closed 9 years ago

jnevin commented 9 years ago

Everything good in install up to point of "Test the REST API" -- where I get a "connection refused"

For the curl command, I am substituting my local IP address (at this time, 10.58.105.52) for the example's IP, so: curl -X POST -H "Content-Type: application/json" -d '{"img_url":"http://bit.ly/ocrimage","engine":"tesseract"}' http://10.58.105.52:$HTTP_PORT/ocr

I get a: Failed to connect to 10.58.105.52 port 8080: Connection refused

Any clues?

tleyden commented 9 years ago

Which paas are you running on? On gce and aws you have to explicitly open ports.

On Nov 26, 2014, at 10:41 AM, Jim Nevin notifications@github.com wrote:

Everything good in install up to point of "Test the REST API" -- where I get a "connection refused"

For the curl command, I am substituting my local IP address (at this time, 10.58.105.52) for the example's IP, so: curl -X POST -H "Content-Type: application/json" -d '{"img_url":"http://bit.ly/ocrimage","engine":"tesseract"}' http://10.58.105.52:$HTTP_PORT/ocr

I get a: Failed to connect to 10.58.105.52 port 8080: Connection refused

Any clues?

— Reply to this email directly or view it on GitHub.

jnevin commented 9 years ago

Just testing locally - no?

Sent from my iPhone

On Nov 26, 2014, at 2:54 PM, Traun Leyden notifications@github.com wrote:

Which paas are you running on? On gce and aws you have to explicitly open ports.

On Nov 26, 2014, at 10:41 AM, Jim Nevin notifications@github.com wrote:

Everything good in install up to point of "Test the REST API" -- where I get a "connection refused"

For the curl command, I am substituting my local IP address (at this time, 10.58.105.52) for the example's IP, so: curl -X POST -H "Content-Type: application/json" -d '{"img_url":"http://bit.ly/ocrimage","engine":"tesseract"}' http://10.58.105.52:$HTTP_PORT/ocr

I get a: Failed to connect to 10.58.105.52 port 8080: Connection refused

Any clues?

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub.

tleyden commented 9 years ago

Ok, for local testing, it should be creating a portmapping:

https://github.com/tleyden/open-ocr/blob/master/launcher/launcher.sh#L44

-p ${HTTP_PORT}:${HTTP_PORT}

so either the port mapping isn't working, or the http process isn't running.

If you run sudo docker ps, what output do you see? Also, are you on Linux, or running Linux under OSX via vagrant? Are you running the curl command on the host where you kicked off the docker image?

tleyden commented 9 years ago

@jnevin any update?

I'm going to close this issue because so far it doesn't look like an issue w/ openocr, but I can re-open it if you can show otherwise.

jnevin commented 9 years ago

just re-engaging on this now. if needed, we can re-open. thanks!

On Dec 3, 2014, at 11:20 AM, Traun Leyden notifications@github.com wrote:

Closed #26 https://github.com/tleyden/open-ocr/issues/26.

— Reply to this email directly or view it on GitHub https://github.com/tleyden/open-ocr/issues/26#event-202037574.

tleyden commented 8 years ago

I haven't tried on boot2docker, but 0.0.0.0 looks like an invalid address (or is that from boot2docker documentation?)

What about 127.0.0.1:8080?

nicktackes commented 6 years ago

Hello (and thanks for providing this project),

I'm adding to this issue because I also get to the testing of the curl request on local. docker machine env .... export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://192.168.99.100:2376" export DOCKER_CERT_PATH="/Users/nicktackes/.docker/machine/machines/default" export DOCKER_MACHINE_NAME="default"

documentation indicates HTTP_POST is the port number inside the .yml file inside the docker-compose directory presuming it should be the same 9292. ... ports:

running the curl curl -X POST -H "Content-Type: application/json" -d '{"img_url":"http://bit.ly/ocrimage","engine":"tesseract"}' http://192.168.99.100:9292/ocr

curl: (7) Failed to connect to 192.168.99.100 port 9292: Connection refused

any advice is appreciated.

tleyden commented 6 years ago

@nicktackes can you open a new ticket for this? I think at the very least the docs should be improved.