snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
10.79k stars 3.12k forks source link

LDAP auth fails with 500 Server Error. #10891

Open tomjones1977 opened 2 years ago

tomjones1977 commented 2 years ago

Debug mode

Describe the bug

Docker-compose based installation of Snipe-IT. Compose file pasted below for reference.

LDAP auth was set up and working correctly and has recently stopped working. In an attempt to fault find debug mode was enabled and the following error appears when trying to test either LDAP Sync or LDAP Login from the admin panel.

LOG.error: LogicException: Unable to read key in /var/www/html/vendor/league/oauth2-server/src/CryptKey.php:77

There are no OAuth configs set up on this instance of SnipeIT, only the LDAP setup. Removing and recreating the container does not fix the issue.

docker-compose.yml

version: '3'

services:

  snipe-mysql:
    container_name: snipe-mysql
    image: mysql:5.6
    restart: unless-stopped
    env_file:
      - ./.env
    volumes:
      - ./mysql:/var/lib/mysql
    command: --default-authentication-plugin=mysql_native_password

  snipe-it:
    container_name: snipe-it
    image: snipe/snipe-it:v5.4.1
    restart: unless-stopped
    env_file:
      - ./.env
    depends_on:
      - snipe-mysql

  nginx:
    image: nginx:latest
    restart: unless-stopped
    container_name: production_nginx
    volumes:
      - /etc/ssl/certs:/etc/ssl/certs:ro
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
      - ./nginx/certs/assets.key:/etc/nginx/cert/assets.key
      - ./nginx/certs/assets.crt:/etc/nginx/cert/assets.crt
    ports:
      - 80:80
      - 443:443

Reproduction steps

  1. Deploy container based instance of SnipeIT
  2. Configure LDAP settings
  3. Test LDAP - Error 500 ...

Expected behavior

LDAP authentication and tests working without issue.

Screenshots

No response

Snipe-IT Version

5.4.1

Operating System

Ubuntu 20.04 LTS

Web Server

Snipe-IT official container image

PHP Version

7.4.3

Operating System

Ubuntu 20.04 Desktop

Browser

Firefox

Version

98.0.2

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

[15:29:14] LOG.error: LogicException: Unable to read key in /var/www/html/vendor/league/oauth2-server/src/CryptKey.php:77
Stack trace:
#0 /var/www/html/vendor/laravel/passport/src/PassportServiceProvider.php(255): League\OAuth2\Server\CryptKey->__construct()
#1 /var/www/html/vendor/laravel/passport/src/PassportServiceProvider.php(236): Laravel\Passport\PassportServiceProvider->makeCryptKey()
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(799): Laravel\Passport\PassportServiceProvider->Laravel\Passport\{closure}()
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(681): Illuminate\Container\Container->build()
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(785): Illuminate\Container\Container->resolve()
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(629): Illuminate\Foundation\Application->resolve()
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(770): Illuminate\Container\Container->make()
#7 /var/www/html/vendor/laravel/passport/src/PassportServiceProvider.php(296): Illuminate\Foundation\Application->make()
#8 [internal function]: Laravel\Passport\PassportServiceProvider->Laravel\Passport\{closure}()
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Auth/RequestGuard.php(58): call_user_func()
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Auth/GuardHelpers.php(60): Illuminate\Auth\RequestGuard->user()
#11 /var/www/html/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(62): Illuminate\Auth\RequestGuard->check()
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(41): Illuminate\Auth\Middleware\Authenticate->authenticate()
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Auth\Middleware\Authenticate->handle()
#14 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(683): Illuminate\Pipeline\Pipeline->then()
#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(658): Illuminate\Routing\Router->runRouteWithinStack()
#17 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(624): Illuminate\Routing\Router->runRoute()
#18 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(613): Illuminate\Routing\Router->dispatchToRoute()
#19 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(170): Illuminate\Routing\Router->dispatch()
#20 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}()
#21 /var/www/html/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#22 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Barryvdh\Debugbar\Middleware\InjectDebugbar->handle()
#23 /var/www/html/vendor/fruitcake/laravel-cors/src/HandleCors.php(52): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#24 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Fruitcake\Cors\HandleCors->handle()
#25 /var/www/html/app/Http/Middleware/PreventBackHistory.php(23): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#26 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): App\Http\Middleware\PreventBackHistory->handle()
#27 /var/www/html/app/Http/Middleware/SecurityHeaders.php(26): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#28 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): App\Http\Middleware\SecurityHeaders->handle()
#29 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#30 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#31 /var/www/html/app/Http/Middleware/CheckForDebug.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#32 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): App\Http\Middleware\CheckForDebug->handle()
#33 /var/www/html/app/Http/Middleware/CheckForSetup.php(26): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#34 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): App\Http\Middleware\CheckForSetup->handle()
#35 /var/www/html/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#36 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Fideloper\Proxy\TrustProxies->handle()
#37 /var/www/html/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#38 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\View\Middleware\ShareErrorsFromSession->handle()
#39 /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(56): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#40 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Session\Middleware\StartSession->handle()
#41 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(63): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#42 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle()
#43 /var/www/html/app/Http/Middleware/NoSessionStore.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#44 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): App\Http\Middleware\NoSessionStore->handle()
#45 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#46 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\Pipeline\Pipeline->then()
#47 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#48 /var/www/html/public/index.php(58): Illuminate\Foundation\Http\Kernel->handle()
#49 {main}

Additional context

No response

welcome[bot] commented 2 years ago

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.