Skip to content

Race condition between anti-spam and anti-malware #1018

@MarkKoz

Description

@MarkKoz

An anti-spam DeletionContext will re-upload attachments to the #attachment-log channel. The anti-malware cog will delete attachments that are blacklisted. This sometimes results in a 404 when anti-spam is trying to upload the attachments:

Sentry Issue: BOT-6D

NotFound: 404 Not Found (error code: 0): asset not found
  File "bot/utils/messages.py", line 81, in send_attachments
    await attachment.save(file, use_cached=True)
  File "discord/message.py", line 124, in save
    data = await self.read(use_cached=use_cached)
  File "discord/message.py", line 166, in read
    data = await self._http.get_from_cdn(url)
  File "discord/http.py", line 235, in get_from_cdn
    raise NotFound(resp, 'asset not found')

Failed to re-upload attachment <REDACTED> from message <REDACTED> with status 404.

Metadata

Metadata

Assignees

Labels

a: filtersRelated to message filters: (antimalware, antispam, filtering, token_remover)p: 2 - normalNormal Priorityt: bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions