Bogdanp / Bogdanp/dramatiq

Logs are no longer being written, and it's unable to receive task information from the server.

Open
#560 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5.3k
Forks
383
Avg merge
9h 41m
Merged PRs (30d)
2

Description

# Issues

GitHub issues are for bugs. If you have questions, please ask them on the [mailing list](https://groups.io/g/dramatiq-users/topics).

## Checklist

* [x] Does your title concisely summarize the problem?
* [x] Did you include a minimal, reproducible example?
* [x] What OS are you using?
* [x] What version of Dramatiq are you using?
* [x] What did you do?
* [x] What did you expect would happen?
* [x] What happened?

## What OS are you using?

Ubuntu 22.04

## What version of Dramatiq are you using?

Dramatiq '1.14.2'

## What did you do?
I am using the Sanic framework, with Dramatiq as a queue, but I've encountered two peculiar issues.

1. I am simply using dramatiq dramatiq_tasks -p 1 -t 1 --log-file /app/log/dramatiq.log. After executing a few times and encountering some simple errors, if I exit and restart, the log file no longer receives any input.
image

Only the startup log will be displayed, and no further logs will be written.

```
$ dramatiq dramatiq_tasks -p 1 -t 1 --log-file /app/log/dramatiq.log

import dramatiq
from dramatiq.brokers.redis import RedisBroker
from tasks.task_1 import task_1

redis_broker = RedisBroker(url='redis://redis.xxxxxxx/10')
dramatiq.set_broker(redis_broker)

@dramatiq.actor(max_retries = 0)
def handle_task(data, session_url):
result = task_1(data, session_url)
```

2. I start both Sanic and Dramatiq with PM2, but separately. However, I find that Dramatiq cannot receive messages sent from Sanic, even with the official demo.

```
apps:
- name: sanic
script: sanic
args: server:app --fast
cwd: /app/current/app
interpreter: python3
instances: 1
autorestart: true
watch: false
max_restarts: 5
restart_delay: 5000
log_date_format: YYYY-MM-DD HH:mm:ss
log_file: /app/shared/log/root.log
error_file: /app/shared/log/error.log
env:
SANIC_ENV: production
```

```
apps:
- name: dramatiq
script: dramatiq
args: dramatiq dramatiq_tasks -p 1 -t 1 --log-file /app/shared/log/dramatiq.log
cwd: /app/current/app
interpreter: python3
instances: 1
autorestart: true
watch: false
max_restarts: 5
restart_delay: 5000
log_date_format: YYYY-MM-DD HH:mm:ss
env:
SANIC_ENV: production
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.