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

TaskState.args and TaskState.kwargs in djcelery model are currently limited to 200 chars. #20

Closed
tdcarrol opened this issue Oct 11, 2010 · 1 comment

Comments

@tdcarrol
Copy link

I'm using some tasks with very long kwargs. When running the camera I received this stack trace:

Traceback (most recent call last):
File "manage.py", line 11, in
execute_manager(settings)
File "/opt/py26/lib/python2.6/site-packages/django/core/management/init.py", line 438, in execute_manager
utility.execute()
File "/opt/py26/lib/python2.6/site-packages/django/core/management/init.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/py26/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(_args, *_options.dict)
File "/opt/py26/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute
output = self.handle(_args, *_options)
File "/opt/py26/lib/python2.6/site-packages/djcelery/management/commands/celerycam.py", line 19, in handle
run_celeryev(_args, *_options)
File "/opt/py26/lib/python2.6/site-packages/celery/bin/celeryev.py", line 49, in run_celeryev
loglevel=loglevel, logfile=logfile)
File "/opt/py26/lib/python2.6/site-packages/celery/events/snapshot.py", line 96, in evcam
cam.cancel()
File "/opt/py26/lib/python2.6/site-packages/celery/events/snapshot.py", line 61, in cancel
self._tref()
File "/opt/py26/lib/python2.6/site-packages/celery/utils/timer2.py", line 41, in call
return self.fun(_self.args, *_self.kwargs)
File "/opt/py26/lib/python2.6/site-packages/celery/utils/timer2.py", line 192, in _reschedules
return fun(_args, *_kwargs)
File "/opt/py26/lib/python2.6/site-packages/celery/events/snapshot.py", line 57, in capture
return self.state.freeze_while(self.shutter)
File "/opt/py26/lib/python2.6/site-packages/celery/events/state.py", line 198, in freeze_while
return fun(_args, *_kwargs)
File "/opt/py26/lib/python2.6/site-packages/celery/events/snapshot.py", line 53, in shutter
self.on_shutter(self.state)
File "/opt/py26/lib/python2.6/site-packages/djcelery/snapshot.py", line 82, in on_shutter
map(self.handle_task, state.tasks.items())
File "/opt/py26/lib/python2.6/site-packages/djcelery/snapshot.py", line 55, in handle_task
"worker": worker})
File "/opt/py26/lib/python2.6/site-packages/djcelery/snapshot.py", line 65, in update_task
return objects.create(**dict(kwargs, **defaults))
File "/opt/py26/lib/python2.6/site-packages/django/db/models/manager.py", line 138, in create
return self.get_query_set().create(**kwargs)
File "/opt/py26/lib/python2.6/site-packages/django/db/models/query.py", line 352, in create
obj.save(force_insert=True, using=self.db)
File "/opt/py26/lib/python2.6/site-packages/django/db/models/base.py", line 434, in save
self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "/opt/py26/lib/python2.6/site-packages/django/db/models/base.py", line 527, in save_base
result = manager._insert(values, return_id=update_pk, using=using)
File "/opt/py26/lib/python2.6/site-packages/django/db/models/manager.py", line 195, in _insert
return insert_query(self.model, values, **kwargs)
File "/opt/py26/lib/python2.6/site-packages/django/db/models/query.py", line 1479, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "/opt/py26/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 783, in execute_sql
cursor = super(SQLInsertCompiler, self).execute_sql(None)
File "/opt/py26/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 727, in execute_sql
cursor.execute(sql, params)
File "/opt/py26/lib/python2.6/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
return self.cursor.execute(query, args)
django.db.utils.DatabaseError: value too long for type character varying(200)

I was able to resolve the issue for my case by increasing the size of the TaskState.args and TaskState.kwargs to 1900. However the correct solution is probably to use a TextField.

@ask
Copy link
Contributor

ask commented Oct 12, 2010

TaskState.args+kwargs should be TextField for long arguments. Closed by 555c163. Thanks to tdcarrol

This issue was closed.
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