0

I would like to use sanctum as a guard, I switch the driver from session to sanctum and then this gives the error message. I don't know where to look for the error or which way to start.

'guards' => [
        'web' => [
            'driver' => 'session' -> // --> to this 'sanctum',
            'provider' => 'members',
        ],
In WorkerCrashedException.php line 41:

  The command "PARATEST='1' TEST_TOKEN='11' UNIQUE_TEST_TOKEN='11_63bbc9686d4b6' '/usr/local/bin/php' '/var/www/html/vendor/phpunit/phpunit/phpunit' '--configuration' '/var/www/html/phpunit.xml' '--filter' '/
  shouldRejectLoginAsMemberGivingCorrectPasswordAndGivingInvalidEmail(?:\s|$)/' '--no-logging' '--no-coverage' '--printer' 'ParaTest\Runners\PHPUnit\Worker\NullPhpunitPrinter' '--log-junit' '/tmp/PT_BPNPOL' '
  /var/www/html/tests/Unit/Controllers/AuthControllerTest.php'" failed.

  Exit Code: 139(Segmentation violation)

  Working directory: /var/www/html

  Output:
  ================


  Error Output:
  ================
Bálint Bakos
  • 474
  • 2
  • 5
  • 21
  • Please edit your question to include properly formatted text for all output (including errors). See [Please do not upload images of code/data/errors.](//meta.stackoverflow.com/q/285551) for many reasons why this is important. – David Makogon Dec 16 '22 at 21:38

1 Answers1

1

I also experienced the same issue in the same case and resolved it as follows. Laravel 10.

config/sanctum.php

    /*
    |--------------------------------------------------------------------------
    | Sanctum Guards
    |--------------------------------------------------------------------------
    |
    | This array contains the authentication guards that will be checked when
    | Sanctum is trying to authenticate a request. If none of these guards
    | are able to authenticate the request, Sanctum will use the bearer
    | token that's present on an incoming request for authentication.
    |
    */

    // 'guard' => ['my_api_guard'], <- In my case, this setting could reproduce `Exit Code: 139 error` .
    'guard' => [], // <- Please try using an empty array!
Hirotaka Miyata
  • 276
  • 2
  • 3