Project

General

Profile

Actions

tickets #166121

closed

Error performing PastesCleanupJob

Added by crameleon 4 months ago. Updated 4 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Paste
Target version:
-
Start date:
2024-09-01
Due date:
% Done:

0%

Estimated time:

Description

This message along with its backtraces seems to be filling up the file:

paste ():~ # grep -c 'Error performing PastesCleanupJob' /srv/www/paste-o-o/log/production.log
72932
paste ():~ # du -hs /srv/www/paste-o-o/log/production.log
2.1G    /srv/www/paste-o-o/log/production.log
Actions #1

Updated by crameleon 4 months ago

  • Category set to Paste
  • Assignee set to hellcp
  • Private changed from Yes to No
Actions #2

Updated by hellcp 4 months ago

This is a result of removing the pastes before the time they expire (presumably because of spam). It's a matter of adding an if condition to check if the paste still exists when trying to remove it

Actions #3

Updated by crameleon 4 months ago

Thanks for the pointer!

I try enclosing the destroy call in app/jobs/pastes_cleanup_job.rb with if paste or if paste.present?, but both seem to be true even if the paste does not exist. I also tried paste.destroy unless paste.nil? after inspecting the console for a paste which does not exist

irb(main):047> Paste.where(title: 'test')[0].nil?
  Paste Load (0.6ms)  SELECT "pastes".* FROM "pastes" WHERE "pastes"."title" = $1  [["title", "test"]]
=> true

with no luck. The destroy is still always executed.

How to check if it exists inside the job?

Actions #4

Updated by crameleon 4 months ago

  • Status changed from New to In Progress
  • Assignee changed from hellcp to crameleon
Actions #5

Updated by crameleon 4 months ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF