ArthurGuy / BBMembershipSystem

A membership management system for the Maker Space Build Brighton
https://arthurguy.co.uk/portfolio/bbms
GNU General Public License v3.0
20 stars 16 forks source link

BB\Exceptions\ValidationException: User Not Trained #289

Open ArthurGuy opened 1 year ago

ArthurGuy commented 1 year ago

View details in Rollbar: https://rollbar.com/arthurguy/BBMS/items/467/


BB\Exceptions\ValidationException: User Not Trained
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/app/Services/KeyFobAccess.php", line 224, in verifyForDevice
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/app/Http/Controllers/ACS/ActivityController.php", line 69, in store
  File "<internal>", line unknown, in call_user_func_array
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 8937, in callAction
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 9006, in call
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 8986, in Illuminate\Routing\{closure}
  File "<internal>", line unknown, in call_user_func
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 9657, in Illuminate\Pipeline\{closure}
  File "<internal>", line unknown, in call_user_func
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 9639, in then
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 8987, in callWithinStack
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 8972, in dispatch
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 7917, in runWithCustomDispatcher
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 7888, in run
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 7541, in Illuminate\Routing\{closure}
  File "<internal>", line unknown, in call_user_func
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 9657, in Illuminate\Pipeline\{closure}
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/app/Http/Middleware/ACSAuthentication.php", line 45, in handle
  File "<internal>", line unknown, in call_user_func_array
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 9649, in Illuminate\Pipeline\{closure}
  File "<internal>", line unknown, in call_user_func
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 9639, in then
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 7542, in runRouteWithinStack
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 7530, in dispatchToRoute
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 7515, in dispatch
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 2310, in Illuminate\Foundation\Http\{closure}
  File "<internal>", line unknown, in call_user_func
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 9657, in Illuminate\Pipeline\{closure}
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/app/Http/Middleware/BrandingHeaders.php", line 21, in handle
  File "<internal>", line unknown, in call_user_func_array
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 9649, in Illuminate\Pipeline\{closure}
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/app/Http/Middleware/SSLOnly.php", line 22, in handle
  File "<internal>", line unknown, in call_user_func_array
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 9649, in Illuminate\Pipeline\{closure}
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 13008, in handle
  File "<internal>", line unknown, in call_user_func_array
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 9649, in Illuminate\Pipeline\{closure}
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 11600, in handle
  File "<internal>", line unknown, in call_user_func_array
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 9649, in Illuminate\Pipeline\{closure}
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 12745, in handle
  File "<internal>", line unknown, in call_user_func_array
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 9649, in Illuminate\Pipeline\{closure}
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 12682, in handle
  File "<internal>", line unknown, in call_user_func_array
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 9649, in Illuminate\Pipeline\{closure}
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 2982, in handle
  File "<internal>", line unknown, in call_user_func_array
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 9649, in Illuminate\Pipeline\{closure}
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/app/Http/Middleware/ACSSessionControl.php", line 41, in handle
  File "<internal>", line unknown, in call_user_func_array
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 9649, in Illuminate\Pipeline\{closure}
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/ClockworkMiddleware.php", line 41, in handle
  File "<internal>", line unknown, in call_user_func_array
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 9649, in Illuminate\Pipeline\{closure}
  File "<internal>", line unknown, in call_user_func
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 9639, in then
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 2257, in sendRequestThroughRouter
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/bootstrap/cache/compiled.php", line 2240, in handle
  File "/home/forge/bbms.buildbrighton.com/releases/20230306090657/public/index.php", line 52, in <main>
nes0 commented 1 year ago

Thanks for looking at this. These log messages were to do with us figuring out how to get user validation through the API working. I think there might be a bug in Services/KeyFobAccess.php: verifyForDevice() in that it apparently calls isUserTrained() with the device key rather than the slug.

After a bit of trial and error with the settings presented on /equipment/<slug>/edit we found that by ensuring Slug matches Device Key matches Induction Category, the equipment activity log, the trained/pending users and the user validation API all seem to work correctly. If any of these strings differ from the others then something breaks.