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

BadFormatError for reserve_job #8

Closed
ropetin opened this issue Oct 6, 2021 · 2 comments
Closed

BadFormatError for reserve_job #8

ropetin opened this issue Oct 6, 2021 · 2 comments

Comments

@ropetin
Copy link

ropetin commented Oct 6, 2021

I can't help but think I'm missing something obvious, but I can't for the life of me get reserve_job working. Using the basic code below to reserve a job ID I know exists and is available in the watched tube:

import greenstalk
client = greenstalk.Client(('192.168.1.2', 11300), watch='testtube')
client.reserve_job(1)

I get a BadFormatError which the documentation suggests shouldn't be hit unless something is amiss in the library.

Traceback (most recent call last):
  File "/Users/ropetin/greenstalk/./testgreen.py", line 3, in <module>
    client.reserve_job(1)
  File "/Users/ropetin/.local/share/virtualenvs/greenstalk-evfV_dNi/lib/python3.9/site-packages/greenstalk.py", line 261, in reserve_job
    return self._job_cmd(b'reserve-job %d' % id, b'RESERVED')
  File "/Users/ropetin/.local/share/virtualenvs/greenstalk-evfV_dNi/lib/python3.9/site-packages/greenstalk.py", line 187, in _job_cmd
    id, size = (int(n) for n in self._send_cmd(cmd, expected))
  File "/Users/ropetin/.local/share/virtualenvs/greenstalk-evfV_dNi/lib/python3.9/site-packages/greenstalk.py", line 176, in _send_cmd
    return _parse_response(line, expected)
  File "/Users/ropetin/.local/share/virtualenvs/greenstalk-evfV_dNi/lib/python3.9/site-packages/greenstalk.py", line 411, in _parse_response
    raise ERROR_RESPONSES[status](values)
greenstalk.BadFormatError: []
@justinmayhew
Copy link
Owner

The reserve-job command was added in beanstalkd 1.12. Are you on an older version?

@ropetin
Copy link
Author

ropetin commented Oct 6, 2021

See, I told you it was something obvious! I'm running 1.10 for some unknown reason. Thanks for the prompt response.

@ropetin ropetin closed this as completed Oct 6, 2021
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