eveseat / seat

🌀✳️ SeAT: A Simple, EVE Online API Tool and Corporation Manager
https://eveseat.github.io/docs/
GNU General Public License v2.0
433 stars 142 forks source link

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

Open nuclear4547 opened 5 months ago

nuclear4547 commented 5 months ago

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

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 commented 5 months ago

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 commented 4 months ago

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