opencultureconsulting / openrefine-client

The OpenRefine Python Client from Paul Makepeace provides a library for communicating with an OpenRefine server. This fork extends the command line interface (CLI) and is distributed as a convenient one-file-executable (Windows, Linux, Mac). It is also available via Docker Hub, PyPI and Binder.
GNU General Public License v3.0
83 stars 19 forks source link

Issue in create project on openrefine server #13

Closed kishore0709 closed 3 years ago

kishore0709 commented 4 years ago

Hi Team,

I'm getting below error while creating a new project in openrefine server. I'm using the docker openrefine client. Could you please help resolve this issue.

Note: Actually I'm able to list the projects which are manually created from openrefine server.

Command: docker run --rm --network=host -v ${PWD}:/data:z felixlohmeier/openrefine-client:v0.3.9 -H <openrefine-server-hostname>-P 3333 -c business-operations-survey-2019-international-engagement-csv.csv

Error:

Traceback (most recent call last):
  File "/app/refine.py", line 35, in <module>
    __main__.main()
  File "/app/google/refine/__main__.py", line 251, in main
    cli.create(options.create, **kwargs)
  File "/app/google/refine/cli.py", line 127, in create
    **kwargs)
  File "/app/google/refine/refine.py", line 272, in new_project
    'create-project-from-upload', options, params
  File "/app/google/refine/refine.py", line 83, in urlopen
    response = urllib2.urlopen(req)
  File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/site-packages/urllib2_file.py", line 207, in http_open
    return self.do_open(httplib.HTTP, req)
  File "/usr/lib/python2.7/site-packages/urllib2_file.py", line 281, in do_open
    l = send_data(v_vars, v_files, boundary, h)
  File "/usr/lib/python2.7/site-packages/urllib2_file.py", line 194, in send_data
    sock.send(chunk)
  File "/usr/lib/python2.7/httplib.py", line 870, in send
    self.sock.sendall(data)
  File "/usr/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 32] Broken pipe

Project is working fine:

docker run --rm --network=host -v ${PWD}:/data:z felixlohmeier/openrefine-client:v0.3.9 -H <openrefine-server-hostname> -P 3333 --list
 2577522848751: annual enterprise survey 2019 financial year provisional csv csv

Thanks!

felixlohmeier commented 4 years ago

Hi @kishore0709,

which version of OpenRefine do you use? Unfortunately the openrefine-client is not yet compatible with 3.3+ (see https://github.com/opencultureconsulting/openrefine-client/issues/7).

With OpenRefine 3.2 it should work (hopefully):

[felix@tux ~]$ sudo docker run --rm --network=host -v ${PWD}:/data:z felixlohmeier/openrefine-client:v0.3.9 --download https://www.stats.govt.nz/assets/Uploads/Business-operations-survey/Business-operations-survey-2019/Download-data/business-operations-survey-2019-international-engagement-csv.csv
Download to file business-operations-survey-2019-international-engagement-csv.csv complete
[felix@tux ~]$ sudo docker run --rm --network=host -v ${PWD}:/data:z felixlohmeier/openrefine-client:v0.3.9 --create business-operations-survey-2019-international-engagement-csv.csv
id: 1844436318306
rows: 14617
felixlohmeier commented 3 years ago

release v0.3.10 now works with OpenRefine 3.3+