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

Unable to encode lists with elements that are not 2-tuples when sending to remote processor #214

Closed
mytoursapp opened this issue Aug 24, 2015 · 2 comments

Comments

@mytoursapp
Copy link

I have a Raspberry Pi configured to use spreads (not via the spreadpi, but via the archivist build as this wouldn't install, see - DIYBookScanner/spreadpi#36).

I have scanned a book and wanted to send it to a post processing server. The other server seems to acknowledge the request but when the pi tries to send it errors out:

334415865.487 spreadsplug.web.discovery DEBUG    Discovering servers
334415870.617 spreadsplug.web.discovery DEBUG    Sending multicast datagram
334416114.776 spreadsplug.web.discovery DEBUG    Server 192.168.1.16 replied.
334416119.532 spreadsplug.web.discovery DEBUG    Server is listening on port 5000
334416748.677 requests.packages.urllib3.connectionpool INFO     Starting new HTTP connection (1): 192.168.1.16
334416811.176 requests.packages.urllib3.connectionpool DEBUG    "GET /api/plugins ('HTTP/1.1',)" 200 99
334416833.928 requests.packages.urllib3.connectionpool INFO     Starting new HTTP connection (1): 192.168.1.16
334416867.157 requests.packages.urllib3.connectionpool DEBUG    "GET /api/config ('HTTP/1.1',)" 200 940
334416892.288 requests.packages.urllib3.connectionpool INFO     Starting new HTTP connection (1): 192.168.1.16
334416916.538 requests.packages.urllib3.connectionpool DEBUG    "GET /api/templates ('HTTP/1.1',)" 200 3917
334447849.01 huey.consumer.ConsumerThread INFO     Executing <spreadsplug.web.tasks.queuecmd_upload_workflow object at 0x304a990>
334447862.14 spreadsplug.web.tasks DEBUG    Uploading workflow to postprocessing server
334448104.879 spreadsplug.web.tasks DEBUG    Projected size for upload: 831220050
334448114.719 huey.consumer.ConsumerThread ERROR    Unhandled exception in worker thread
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/spreads/vendor/huey/consumer.py", line 149, in process_task
    self.huey.execute(task)
  File "/usr/local/lib/python2.7/dist-packages/spreads/vendor/huey/api.py", line 236, in execute
    result = task.execute()
  File "/usr/local/lib/python2.7/dist-packages/spreads/vendor/huey/api.py", line 415, in execute
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/spreadsplug/web/tasks.py", line 143, in upload_workflow
    headers={'Content-Type': 'application/zip'})
  File "/usr/lib/python2.7/dist-packages/requests/api.py", line 85, in post
    return request('post', url, data=data, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/api.py", line 40, in request
    return s.request(method=method, url=url, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 229, in request
    r.send(prefetch=prefetch)
  File "/usr/lib/python2.7/dist-packages/requests/models.py", line 527, in send
    body = self._encode_params(self.data)
  File "/usr/lib/python2.7/dist-packages/requests/models.py", line 348, in _encode_params
    raise ValueError('Unable to encode lists with elements that are not 2-tuples.')
ValueError: Unable to encode lists with elements that are not 2-tuples.

Any ideas of the error?

@adongy
Copy link
Contributor

adongy commented Aug 24, 2015

You seem to be using a pretty old version of requests. Try to upgrade it with pip install -U requests and try again.

@barnaclebarnes
Copy link

Yep - That was it! All working now.

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

3 participants