Skip to content Skip to sidebar Skip to footer

Django Celery 4 - Valueerror: Invalid Literal For Int() With Base 10 When Start Celery Worker

I have configured my celery.py as its documents but I put my celery broker url to AWS SQS but I cannot start it to work. When I run the celery worker, I get the ValueError as:

Solution 1:

I encountered the same problem, and resolved it.

First check (it's very likely) that your AWS access key ID or secret key contains 'xi/' somewhere, and that you have:

BROKER_URL = "sqs://%s:%s@" % (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)

If so, then your problem is in URL unsafe keys, and the fix is:

BROKER_URL = 'sqs://{0}:{1}@'.format(
    urllib.parse.quote(AWS_ACCESS_KEY_ID, safe=''),
    urllib.parse.quote(AWS_SECRET_ACCESS_KEY, safe='')
)

Note: Use urllib.quote if using Python 2.x

Post a Comment for "Django Celery 4 - Valueerror: Invalid Literal For Int() With Base 10 When Start Celery Worker"