Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocr-file-upload failed on ubuntu & aws ec2 when running outside #106

Open
EvgenyKislyy opened this issue Nov 12, 2018 · 2 comments
Open

Comments

@EvgenyKislyy
Copy link

EvgenyKislyy commented Nov 12, 2018

If i run inside the ubuntu instance it works fine
docs/upload-local-file.sh http://localhost:9292/ocr-file-upload ocrimage

if i run it outside (from the internet)
./upload-local-file.sh http://xxx.xx.xx.xx:9292/ocr-file-upload ocrimage.png

I see

sh-3.2# ./upload-local-file.sh http://100.24.24.203:9292/ocr-file-upload ocrimage.png 
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 100.24.24.203...
* TCP_NODELAY set
* Connected to 100.24.24.203 (100.24.24.203) port 9292 (#0)
> POST /ocr-file-upload HTTP/1.1
> Host: 100.24.24.203:9292
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Type: multipart/related; boundary="d2649535728a8d270eb98fd5d8a8412f"
> Content-Length: 59595
> Expect: 100-continue
> 
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
* Empty reply from server
* Connection #0 to host 100.24.24.203 left intact
curl: (52) Empty reply from server

And in the server logs i see

13:29:32.660526 OCR_HTTP: request to ocr-file-upload
13:29:32.660550 OCR_HTTP: content type: multipart/related; boundary="d2649535728a8d270eb98fd5d8a8412f"
13:29:32.660562 OCR_HTTP: content type: multipart/related
2018/11/12 13:29:33 http: panic serving 93.76.243.43:62112: runtime error: invalid memory address or nil pointer dereference
goroutine 5 [running]:
net/http.(*conn).serve.func1(0xc82005a380)
	/usr/lib/go-1.6/src/net/http/server.go:1389 +0xc1
panic(0x7f0a60, 0xc82000e080)
	/usr/lib/go-1.6/src/runtime/panic.go:443 +0x4e9
github.com/tleyden/open-ocr.(*OcrHttpMultipartHandler).extractParts(0xc82000a690, 0xc8200d6000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/opt/go/src/github.com/tleyden/open-ocr/ocr_http_multipart_handler.go:52 +0xa7f
github.com/tleyden/open-ocr.(*OcrHttpMultipartHandler).ServeHTTP(0xc82000a690, 0x7f236dc65b30, 0xc820059ad0, 0xc8200d6000)
	/opt/go/src/github.com/tleyden/open-ocr/ocr_http_multipart_handler.go:94 +0x97
net/http.(*ServeMux).ServeHTTP(0xc820056ab0, 0x7f236dc65b30, 0xc820059ad0, 0xc8200d6000)
	/usr/lib/go-1.6/src/net/http/server.go:1910 +0x17d
net/http.serverHandler.ServeHTTP(0xc82005a300, 0x7f236dc65b30, 0xc820059ad0, 0xc8200d6000)
	/usr/lib/go-1.6/src/net/http/server.go:2081 +0x19e
net/http.(*conn).serve(0xc82005a380)
	/usr/lib/go-1.6/src/net/http/server.go:1472 +0xf2e
created by net/http.(*Server).Serve
	/usr/lib/go-1.6/src/net/http/server.go:2137 +0x44e

Could you please help me how to fix it?

@EvgenyKislyy EvgenyKislyy changed the title ocr-file-upload failed on ubuntu & aws when running outside ocr-file-upload failed on ubuntu & aws ec2 when running outside Nov 12, 2018
@tleyden
Copy link
Owner

tleyden commented Nov 13, 2018

Thanks for the issue report. Nothing obvious jumps out at me ..

@tleyden
Copy link
Owner

tleyden commented Nov 13, 2018

Have you tried using https://github.com/tleyden/open-ocr/blob/master/docs/upload-local-file.py? If that worked, it might tell us something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants