annullato Anche se ho seguenti linee in settings.py:Sedano contenuti tipo salamoia errore
CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_TASKS_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
from kombu import serialization
serialization.registry._decoders.pop("application/x-python-serialize")
ancora sto ottenendo il contenuto salamoia annullato traceback. Strano che ho già il sedano che funziona perfettamente con le stesse impostazioni in un altro posto. Se qualcuno potesse suggerire una soluzione, sarebbe davvero utile. La versione di Django è 1.7.1 e il sedano è stato scaricato oggi, quindi dovrebbe essere più recente. Utilizzando rabbitmq come broker. Di seguito è riportato il traceback completo dell'errore.
[2015-01-01 23:45:20,652: CRITICAL/MainProcess] Can't decode message body: ContentDisallowed('Refusing to deserialize untrusted content of type pickle (application/x-python-serialize)',) [type:u'application/x-python-serialize' encoding:u'binary' headers:{}]
body: '\x80\x02}q\x01(U\x07expiresq\x02NU\x03utcq\x03\x88U\x04argsq\x04X\x04\x00\x00\x00dsgfq\x05\x85q\x06U\x05chordq\x07NU\tcallbacksq\x08NU\x08errbacksq\tNU\x07tasksetq\nNU\x02idq\x0bU$76263889-0ef2-4193-8286-1a38630df08aq\x0cU\x07retriesq\rK\x00U\x04taskq\x0eU"pricematch.tasks.amazon_pricematchq\x0fU\ttimelimitq\x10NN\x86U\x03etaq\x11NU\x06kwargsq\x12}q\x13u.' (241b)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/kombu/messaging.py", line 586, in _receive_callback
decoded = None if on_m else message.decode()
File "/usr/local/lib/python2.7/dist-packages/kombu/message.py", line 142, in decode
self.content_encoding, accept=self.accept)
File "/usr/local/lib/python2.7/dist-packages/kombu/serialization.py", line 174, in loads
raise self._for_untrusted_content(content_type, 'untrusted')
ContentDisallowed: Refusing to deserialize untrusted content of type pickle (application/x-python-serialize)
Questo è quello che ho in archivio celery.py nella directory del progetto parallelo a settings.py di file:
from __future__ import absolute_import
import os
from celery import Celery
from django.conf import settings
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'projectname.settings')
app = Celery('projectname',broker='amqp://',backend='amqp://',)
app.config_from_object('django.conf:settings')
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
@app.task(bind=True)
def debug_task(self):
print('Request: {0!r}'.format(self.request))
prega fatemi sapere se è necessario informazioni aggiuntive
Credo che questo sia il problema, anche se ho spostato in un'altra implementazione, io ancora di ricreare lo scenario per controllare e quindi accettare la risposta .. – Shark