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

A job requiring a not granted scope has been queued Error #910

Open
nuclear4547 opened this issue Jun 22, 2024 · 2 comments
Open

A job requiring a not granted scope has been queued Error #910

nuclear4547 opened this issue Jun 22, 2024 · 2 comments

Comments

@nuclear4547
Copy link

  • Problem: Errors A job requiring a not granted scope has been queued User have only publicData scope
  • Expected: If no scope is available, the task should not be queued
  • Logs / Screenshots / Proof: The more information you give the better!
Illuminate\Queue\ManuallyFailedException: A job requiring a not granted scope has been queued. in /var/www/seat/vendor/laravel/framework/src/Illuminate/Queue/InteractsWithQueue.php:53
Stack trace:
#0 /var/www/seat/vendor/eveseat/eveapi/src/Jobs/Middleware/CheckTokenScope.php(98): Seat\Eveapi\Jobs\AbstractJob->fail('A job requiring...')
#1 /var/www/seat/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Seat\Eveapi\Jobs\Middleware\CheckTokenScope->handle(Object(Seat\Eveapi\Jobs\Character\Notifications), Object(Closure))
#2 /var/www/seat/vendor/eveseat/eveapi/src/Jobs/Middleware/CheckEsiRouteStatus.php(80): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Seat\Eveapi\Jobs\Character\Notifications))
#3 /var/www/seat/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Seat\Eveapi\Jobs\Middleware\CheckEsiRouteStatus->handle(Object(Seat\Eveapi\Jobs\Character\Notifications), Object(Closure))
#4 /var/www/seat/vendor/eveseat/eveapi/src/Jobs/Middleware/CheckServerStatus.php(55): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Seat\Eveapi\Jobs\Character\Notifications))
#5 /var/www/seat/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Seat\Eveapi\Jobs\Middleware\CheckServerStatus->handle(Object(Seat\Eveapi\Jobs\Character\Notifications), Object(Closure))
#6 /var/www/seat/vendor/eveseat/eveapi/src/Jobs/Middleware/CheckEsiRateLimit.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Seat\Eveapi\Jobs\Character\Notifications))
#7 /var/www/seat/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Seat\Eveapi\Jobs\Middleware\CheckEsiRateLimit->handle(Object(Seat\Eveapi\Jobs\Character\Notifications), Object(Closure))
#8 /var/www/seat/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Seat\Eveapi\Jobs\Character\Notifications))
#9 /var/www/seat/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(122): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#10 /var/www/seat/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(70): Illuminate\Queue\CallQueuedHandler->dispatchThroughMiddleware(Object(Illuminate\Queue\Jobs\RedisJob), Object(Seat\Eveapi\Jobs\Character\Notifications))
#11 /var/www/seat/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(102): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\RedisJob), Array)
#12 /var/www/seat/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(439): Illuminate\Queue\Jobs\Job->fire()
#13 /var/www/seat/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(389): Illuminate\Queue\Worker->process('redis', Object(Illuminate\Queue\Jobs\RedisJob), Object(Illuminate\Queue\WorkerOptions))
#14 /var/www/seat/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(176): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\RedisJob), 'redis', Object(Illuminate\Queue\WorkerOptions))
#15 /var/www/seat/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(137): Illuminate\Queue\Worker->daemon('redis', 'notifications', Object(Illuminate\Queue\WorkerOptions))
#16 /var/www/seat/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(120): Illuminate\Queue\Console\WorkCommand->runWorker('redis', 'notifications')
#17 /var/www/seat/vendor/laravel/horizon/src/Console/WorkCommand.php(51): Illuminate\Queue\Console\WorkCommand->handle()
#18 /var/www/seat/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Laravel\Horizon\Console\WorkCommand->handle()
#19 /var/www/seat/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#20 /var/www/seat/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))
#21 /var/www/seat/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#22 /var/www/seat/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#23 /var/www/seat/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call(Array)
#24 /var/www/seat/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#25 /var/www/seat/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#26 /var/www/seat/vendor/symfony/console/Application.php(1096): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /var/www/seat/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(Laravel\Horizon\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 /var/www/seat/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 /var/www/seat/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 /var/www/seat/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 {main}
data:

image

Another

Illuminate\Queue\ManuallyFailedException: A job requiring a not granted scope has been queued. in /var/www/seat/vendor/laravel/framework/src/Illuminate/Queue/InteractsWithQueue.php:53
Stack trace:
#0 /var/www/seat/vendor/eveseat/eveapi/src/Jobs/Middleware/CheckTokenScope.php(98): Seat\Eveapi\Jobs\AbstractJob->fail('A job requiring...')
#1 /var/www/seat/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Seat\Eveapi\Jobs\Middleware\CheckTokenScope->handle(Object(Seat\Eveapi\Jobs\Killmails\Character\Recent), Object(Closure))
#2 /var/www/seat/vendor/eveseat/eveapi/src/Jobs/Middleware/CheckEsiRouteStatus.php(80): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Seat\Eveapi\Jobs\Killmails\Character\Recent))

data
image

  • Version Info: PHP Version, SeAT Version, Operating System etc.
PHP Version: 8.2.20
Host OS: Linux 6d0ddd5abda3 5.15.0-112-generic #122-Ubuntu SMP Thu May 23 07:48:21 UTC 2024 x86_64
SeAT Basepath: /var/www/seat

Checking Local and Latest Versions. Please wait...
+--------------------+---------------+----------------+
| Package Name       | Local Version | Latest Version |
+--------------------+---------------+----------------+
| SeAT API           | 5.0.0         | 5.0.0          |
| SeAT Eseye         | 3.0.1         | 3.0.1          |
| SeAT Eve API       | 5.0.13        | 5.0.13         |
| SeAT Notifications | 5.0.8         | 5.0.8          |
| SeAT Services      | 5.0.7         | 5.0.7          |
| SeAT Web           | 5.0.13        | 5.0.13         |
+--------------------+---------------+----------------+
@akturis
Copy link

akturis commented Jun 23, 2024

Need PR in Jobs\Middleware\CheckTokenScope.php like this

        // in case token got required scope and job require it - forward
        if (in_array($job->getScope(), $job->getToken()->scopes)) {
            $next($job);

            return;
        } else {
            logger()->warning(
                sprintf('[Jobs][Middlewares][%s] Check Token Scope -> Removing job due to required scopes not matching with token related scopes profile.', $job->job->getJobId()),
                [
                    'fqcn' => get_class($job),
                    'job_scopes' => $job->getScope(),
                    'character_id' => $job->getToken()->character_id,
                    'scopes_profile' => $job->getToken()->scopes_profile,
                ]);            
            $job->delete();
            return;
        }

@Crypta-Eve
Copy link
Member

I think the actual solution is preventing the job being queued if the scope is not available. Is it always killmail jobs?

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

No branches or pull requests

3 participants