Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] App\Jobs\ProcessStartedAnnounceRequest has been attempted too many times or run too long #2054

Closed
espiman opened this issue Dec 22, 2021 · 6 comments
Assignees
Labels

Comments

@espiman
Copy link

espiman commented Dec 22, 2021

Describe the bug
if i run sudo php artisan queue:failed I get quite a few errors like:
+--------------------------------------+------------+---------+----------------------------------------+---------------------+
| ID | Connection | Queue | Class | Failed At |
+--------------------------------------+------------+---------+----------------------------------------+---------------------+
| 9baf-7ddb9e327575 | redis | default | App\Jobs\ProcessStartedAnnounceRequest | 2021-12-22 08:39:28 |
| bd32-87f784930079 | redis | default | App\Jobs\ProcessStartedAnnounceRequest | 2021-12-22 08:39:28 |
| b038-bcab51a071be | redis | default | App\Jobs\ProcessStartedAnnounceRequest | 2021-12-22 08:39:28 |
| a29f-72cd2f2b9204 | redis | default | App\Jobs\ProcessStartedAnnounceRequest | 2021-12-22 08:39:28 |

And, in laravel log, i get:
[2021-12-22 00:51:34] prod.ERROR: App\Jobs\ProcessStartedAnnounceRequest has been attempted too many times or run too long. The job may have previously timed out. {"exception":"[object] (Illuminate\Queue\MaxAttemptsExceededException(code: 0): App\Jobs\ProcessStartedAnnounceRequest has been attempted too many times or run too long. The job may have previously timed out. at /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php:750)
[stacktrace]
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(504): Illuminate\Queue\Worker->maxAttemptsExceededException()
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(418): Illuminate\Queue\Worker->markJobAsFailedIfAlreadyExceedsMaxAttempts()
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(378): Illuminate\Queue\Worker->process()
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(172): Illuminate\Queue\Worker->runJob()
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(117): Illuminate\Queue\Worker->daemon()
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(101): Illuminate\Queue\Console\WorkCommand->runWorker()
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Queue\Console\WorkCommand->handle()
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\Container\BoundMethod::call()
#11 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\Container\Container->call()
#12 /var/www/html/vendor/symfony/console/Command/Command.php(298): Illuminate\Console\Command->execute()
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\Component\Console\Command\Command->run()
#14 /var/www/html/vendor/symfony/console/Application.php(1005): Illuminate\Console\Command->run()
#15 /var/www/html/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand()
#16 /var/www/html/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#17 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php(94): Symfony\Component\Console\Application->run()
#18 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Console\Application->run()
#19 /var/www/html/artisan(37): Illuminate\Foundation\Console\Kernel->handle()
#20 {main}
"}

UNIT3D (please complete the following information):

  • UNIT3D Version: 5.3.0 with latest changes
  • Laravel Version: 8.73.2
  • PHP Version: 8.1.0
  • Database Driver & Version: 8.0.27-0ubuntu0.20.04.1
  • Web Server Driver & Version: ngnix
  • OS Driver and Version: Ubuntu 20.4.3

Thanks

@Alkl58
Copy link
Contributor

Alkl58 commented Dec 22, 2021

Same issue here. Already 2400 entries in 2 hours.

My guess it could either be:
2b604ad#diff-228079360625e1703fd57ce6dab98bec3ace11d90773c534fff556b849e335e6
or
1c44bea#diff-228079360625e1703fd57ce6dab98bec3ace11d90773c534fff556b849e335e6

Not sure tho.

@Alkl58
Copy link
Contributor

Alkl58 commented Dec 22, 2021

After chatting with the other Devs and HDVinnie, they told me the following:

This commit: add: overlap protection to announce job solves an issue, where clients send duplicate announces in different queues, resulting in duplicate announce entries.

However, depending on the amount of queue workers, this can result in workers timing out.

Therefore, changing queue workers can mitigate this issue:

  1. sudo nano /etc/supervisor/conf.d/unit3d.conf
    This is a config for small / medium sized trackers:
    [program:unit3d-queue]
    process_name=%(program_name)s_%(process_num)02d
    command=php /var/www/html/artisan queue:work --sleep=3 --tries=3 --max-time=3600
    startsecs = 0
    autostart=true
    autorestart=true
    killasgroup=true
    user=www-data
    numprocs=5
  2. php artisan queue:restart && sudo supervisorctl reread && sudo supervisorctl update && sudo supervisorctl reload

@espiman
Copy link
Author

espiman commented Dec 23, 2021

Thank you very much Alkl58.

I have modified the unit3d.conf file according to your indications, but leaving the value of numprocs=10.

@Gideon75
Copy link
Contributor

Is the same solution on unit3d v6?

@HDVinnie
Copy link
Collaborator

Yes

@Gideon75
Copy link
Contributor

Gideon75 commented Mar 8, 2022

in unit3d v 6.0.3
i try with :
[program:unit3d-queue]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/artisan queue:work --sleep=3 --tries=3
#--max-time=3600
startsecs = 0
autostart=true
autorestart=true
user=www-data
numprocs=10

but, I haven't solved, I still have those mistakes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants