Doopler with Celery

Hello everyone,
I am trying to use doppler in my app that uses the celery (with Redis)queue system.
I am having trouble with it.
when I run my app without the doppler run command, it runs fine and sends a task to the Redis queue. (python myapp.py)
whereas when I use doppler and run my app with the doppler run command, it does not send any task to the Redis queue.
(doppler run – python myapp.py or doppler run --command=“python myapp.py”)

Any help would be appreciated.

Thanks.

HI @Owais_Multani and welcome to the Doppler community!

I can’t think of a reason off the top of my head why Doppler would be interfering with Celery task processing. Are you able to configure step-debugging to see what’s different between when using Doppler and not?

One thing I would check is if the values in Doppler are slightly different to the values used without Doppler, as that’s most likely the cause of the issue.

@BradRyan
Thanks for the reply.
I double checked the credentials but I am still facing the same issue.

I did a little test. I created a file with hardcoded values, but it still doesnt work.

app.py

from celery import Celery
taa_app = Celery('task', broker='redis://localhost:6379/5')
taa_app.conf.result_backend = 'redis://localhost:6379/5'
print(taa_app.send_task('test', task_id="doppler_test"))

I used docker for redis.
sudo docker run -d -p 6379:6379 redis

Then I exported the doppler token
export ENV=doppler_token_here

now when I run python app.py, it sends the task to redis, whereas when I run doppler run – python app.py there’s no task in redis

I’m not sure if this is the root cause, but the command to export the Doppler service token should be:

export DOPPLER_TOKEN=dt.st.XXXX

Also, could you try changing the command from doppler run – python app.py to doppler run --command="python app.py" instead to see if an error is occurring?

@ryan-blunden
I did retry it with export DOPPLER_TOKEN=dt.st.XXXX and doppler run --command="python app.py"

still facing the issue

Ok, thanks Owais. I’ll create a project locally to try and replicate the issue you’re facing.

1 Like

@ryan-blunden any update on this?

Hi @Owais_Multani. I’ll be working on a solution for you today. Sorry for the wait.

Hi @Owais_Multani,

I’ve put together a public repository that has a complete working sample app for using Doppler with Django and Celery using Docker Compose.

I wasn’t able to see any issues when using Doppler with Django and Celery and hopefully you can compare this example with your own Django code in order to find what the problem might be.