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

Running manage.py retry_deferred crashes. #1

Closed
houdinihound opened this issue Nov 27, 2009 · 6 comments
Closed

Running manage.py retry_deferred crashes. #1

houdinihound opened this issue Nov 27, 2009 · 6 comments

Comments

@houdinihound
Copy link

Running the retry_deferred command causes the following traceback:

Traceback (most recent call last):
  File "manage.py", line 11, in 
    execute_manager(settings)
  File "/home/zerobug/webapps/fbs/lib/python2.6/django/core/management/__init__.py", line 362, in execute_manager
    utility.execute()
  File "/home/zerobug/webapps/fbs/lib/python2.6/django/core/management/__init__.py", line 303, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/zerobug/webapps/fbs/lib/python2.6/django/core/management/base.py", line 195, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/zerobug/webapps/fbs/lib/python2.6/django/core/management/base.py", line 222, in execute
    output = self.handle(*args, **options)
  File "/home/zerobug/webapps/fbs/lib/python2.6/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/home/zerobug/webapps/fbs/fbs/../fbs/django_mailer/management/commands/retry_deferred.py", line 11, in handle_noargs
    count = models.QueuedMessage.objects.retry_deferred()
  File "/home/zerobug/webapps/fbs/fbs/django_mailer/managers.py", line 53, in retry_deferred
    self.deferred().update(**update_kwargs)
  File "/home/zerobug/webapps/fbs/lib/python2.6/django/db/models/query.py", line 413, in update
    query.add_update_values(kwargs)
  File "/home/zerobug/webapps/fbs/lib/python2.6/django/db/models/sql/subqueries.py", line 232, in add_update_values
    return self.add_update_fields(values_seq)
  File "/home/zerobug/webapps/fbs/lib/python2.6/django/db/models/sql/subqueries.py", line 245, in add_update_fields
    val = field.get_db_prep_save(val)
  File "/home/zerobug/webapps/fbs/lib/python2.6/django/db/models/fields/__init__.py", line 192, in get_db_prep_save
    return self.get_db_prep_value(value)
  File "/home/zerobug/webapps/fbs/lib/python2.6/django/db/models/fields/__init__.py", line 569, in get_db_prep_value
    return connection.ops.value_to_db_datetime(self.to_python(value))
  File "/home/zerobug/webapps/fbs/lib/python2.6/django/db/models/fields/__init__.py", line 565, in to_python
    _('Enter a valid date/time in YYYY-MM-DD HH:MM[:ss[.uuuuuu]] format.'))
django.core.exceptions.ValidationError: Enter a valid date/time in YYYY-MM-DD HH:MM[:ss[.uuuuuu]] format.

Environment 1:
Win XP
Django 1.1.1
Python 2.6.4
PostgreSQL 8.2.7

Environment 2:
RHEL
Django 1.1.1
Python 2.6
PostgreSQL 8.2.3
Just found this - could be related: http://code.djangoproject.com/ticket/10443

Will keep digging and update with any new info.

Joe

@SmileyChris
Copy link
Owner

Why don't you try django trunk and see if it fixes your problem, since that ticket is marked fixed?

@houdinihound
Copy link
Author

Yep, that was 1st on my to do list this morning ;) Although it seems like that issue was fixed as of the 1.0.x series?

Anyway, ran it against latest revision (11782) - exact same error. Only difference in the traceback is the line numbers of the error in the first 2 function calls:

Traceback (most recent call last):
  File "manage.py", line 11, in 
    execute_manager(settings)
  File "c:\django-trunk\django\core\management\__init__.py", line 439, in execute_manager
    utility.execute()
  File "c:\django-trunk\django\core\management\__init__.py", line 380, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
.
.
.

The rest of the traceback is identical (barring the path to django version).

Also ran it with Python 2.5.4, against trunk and 1.1.1 - same results.

@SmileyChris
Copy link
Owner

It does seem like this is a database problem. If you can muck around with the database, here's a test:

My guess is that it's failing trying to update the datetimefield "deferred" on the QueuedMessage model.

From a shell, try QueuedMessage.objects.update(deferred=None)
If that fails, ensure that your deferred column of the database is nullable (the model definition says it should be).

@houdinihound
Copy link
Author

Ok, so in the shell, QueuedMessage.objects.update(deferred=None) works (returns the # of records updated).

The db field 'deferred' is nullable and is of type "timestamp with time zone".

Tested the above in both environments, works in both.

@houdinihound
Copy link
Author

Resolved. I was running an older version of django-mailer-2 (files were stamped Sep 10) and noticed the latest files have a stamp of Sep 24 and the comment
"Change the retry_deferred management command to output result when on
normal verbosity level." which is why I didn't update sooner :(

Suggestion: Perhaps a version or changes file in the directory?

Anyway, downloaded the latest version of django-mailer-2 and it now works in both environments.

I apologise for wasting your time on this and thank you for your help.

Regards,
Joe

@SmileyChris
Copy link
Owner

Glad you got it resolved. Yeah, I should start a todo. It's a common question for what the difference between this and the original mailer is.

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