V3 Error When Checking Out Licenses
Expected Behavior (or desired behavior if a feature request)
When checking out a license, the license should be able to be checked out to any device or user regardless of the licensed to name and email.
Actual Behavior
Example - TeamViewer has 12 licenses, the registered to user and email is set to the software asset manager who purchased the software. When attempting to checkout any of the seats to the devices the licenses are installed on, the following error appears:
Error: The asset you are trying to associate with this license is owned by somene other than the person selected in the assigned to dropdown.
If I remove the licensed to name and email, I can then check the license out. Not sure if this is the intended behavior, but most of our licenses are only licensed to one email address, but are assigned to several workstations. This is especially true for licenses with a large seat number with 200 more seats.
Please confirm you have done the following before posting your bug report:
- [X] I have enabled debug mode
- [X] I have read checked the Common Issues page
Please provide answers to these questions before posting your bug report:
- Version of Snipe-IT you're running = v3.0.0-dev-3-g6d810a9
- What OS and web server you're running Snipe-IT on = CentOS 7, Apache
- What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) = Manual upgrade from V2*
- What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error = /admin/licenses/12774/checkout
- Confirm whether the error is reproduceable on the demo. = cannot reproduce error in V3 demo
- Indicate whether or not you've manually edited any data directly in the database = no
Are you selecting an asset AND a user from that checkout screen?
No, I thought that might have been what was happening too. I think I might have something wonky going on with my install, as did a clean install on a VM and imported my DB and was unable to replicate. I'm now doing a clean install on the test server to see if that fixes it.
Okay, I'm going to close this for now, since you can't replicate it, but feel free to update this issue if you run into it again.
Yeah, I got it working now. I dropped the database and started from scratch with the v3 install.sh script. Re-imported my database and copied over my files and all is good now. Sorry for not trying that first! :)
Still weird that it happened at all. I'm glad you got it working though.

lmao - you and your gifs!
Heh - those gifs are sometimes the only thing between me and losing my mind.

So, things were working fine when I left work yesterday. I came in today, applied the updates from your most recent commits and am back to where I was before lol. I think I found the issue though.
Here is a view of an asset that I want to assign a license to. You can see it is assigned to the user Math Lab.
However, when I go into the license and search for this device, it is displaying as (unassigned).
If I select both the device and the user, I am able to successfully check-out the license, but if I select only the device, I get the error mentioned above. Any ideas?
Huh. I didn't make any changes to that process yesterday, I don't think. I'll take a look.
Not that process in particular... I just saw you pushed out some new commits last night, so applied them this morning.
Are you on v3, or v3-master? I think I may have fixed your issue. My change is pushed out to the v3 branch
v3-Master
K, I just pushed it up to master. Let me know if that helps.
Will do! I get into to work around 6:30 am Eastern. I'll apply it first thing and let you know!
Ok, so I am no longer getting the message Error: The asset you are trying to associate with this license is owned by somene other than the person selected in the assigned to dropdown. Now I am getting the Whoops! Looks like something went wrong. error. Here is my laravel log for this error:
[2016-07-07 07:06:17] production.ERROR: ErrorException: Undefined variable: is_asset_id in /var/www/html/snipeit/app/Http/Controllers/LicensesController.php:551 Stack trace: #0 /var/www/html/snipeit/app/Http/Controllers/LicensesController.php(551): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Undefined varia...', '/var/www/html/s...', 551, Array) #1 [internal function]: App\Http\Controllers\LicensesController->postCheckout('10000') #2 /var/www/html/snipeit/bootstrap/cache/compiled.php(9419): call_user_func_array(Array, Array) #3 /var/www/html/snipeit/bootstrap/cache/compiled.php(9481): Illuminate\Routing\Controller->callAction('postCheckout', Array) #4 /var/www/html/snipeit/bootstrap/cache/compiled.php(9461): Illuminate\Routing\ControllerDispatcher->call(Object(App\Http\Controllers\LicensesController), Object(Illuminate\Routing\Route), 'postCheckout') #5 [internal function]: Illuminate\Routing\ControllerDispatcher->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #6 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #7 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #8 /var/www/html/snipeit/bootstrap/cache/compiled.php(9938): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #9 /var/www/html/snipeit/bootstrap/cache/compiled.php(9462): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #10 /var/www/html/snipeit/bootstrap/cache/compiled.php(9449): Illuminate\Routing\ControllerDispatcher->callWithinStack(Object(App\Http\Controllers\LicensesController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'postCheckout') #11 /var/www/html/snipeit/bootstrap/cache/compiled.php(8517): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'App\Http\Contro...', 'postCheckout') #12 /var/www/html/snipeit/bootstrap/cache/compiled.php(8504): Illuminate\Routing\Route->runController(Object(Illuminate\Http\Request)) #13 /var/www/html/snipeit/bootstrap/cache/compiled.php(8218): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request)) #14 [internal function]: Illuminate\Routing\Router->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #15 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #16 /var/www/html/snipeit/app/Http/Middleware/CheckPermissions.php(27): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #17 [internal function]: App\Http\Middleware\CheckPermissions->handle(Object(Illuminate\Http\Request), Object(Closure), 'licenses.view') #18 /var/www/html/snipeit/bootstrap/cache/compiled.php(9953): call_user_func_array(Array, Array) #19 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #20 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #21 /var/www/html/snipeit/app/Http/Middleware/Authenticate.php(45): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #22 [internal function]: App\Http\Middleware\Authenticate->handle(Object(Illuminate\Http\Request), Object(Closure)) #23 /var/www/html/snipeit/bootstrap/cache/compiled.php(9953): call_user_func_array(Array, Array) #24 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #25 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #26 /var/www/html/snipeit/app/Http/Middleware/CheckLocale.php(40): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #27 [internal function]: App\Http\Middleware\CheckLocale->handle(Object(Illuminate\Http\Request), Object(Closure)) #28 /var/www/html/snipeit/bootstrap/cache/compiled.php(9953): call_user_func_array(Array, Array) #29 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #30 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #31 /var/www/html/snipeit/bootstrap/cache/compiled.php(3225): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #32 [internal function]: Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure)) #33 /var/www/html/snipeit/bootstrap/cache/compiled.php(9953): call_user_func_array(Array, Array) #34 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #35 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #36 /var/www/html/snipeit/bootstrap/cache/compiled.php(13139): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #37 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure)) #38 /var/www/html/snipeit/bootstrap/cache/compiled.php(9953): call_user_func_array(Array, Array) #39 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #40 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #41 /var/www/html/snipeit/bootstrap/cache/compiled.php(13076): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #42 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure)) #43 /var/www/html/snipeit/bootstrap/cache/compiled.php(9953): call_user_func_array(Array, Array) #44 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #45 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #46 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #47 /var/www/html/snipeit/bootstrap/cache/compiled.php(9938): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #48 /var/www/html/snipeit/bootstrap/cache/compiled.php(8219): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #49 /var/www/html/snipeit/bootstrap/cache/compiled.php(8210): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request)) #50 /var/www/html/snipeit/bootstrap/cache/compiled.php(8200): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request)) #51 /var/www/html/snipeit/bootstrap/cache/compiled.php(2419): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request)) #52 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request)) #53 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #54 /var/www/html/snipeit/vendor/fideloper/proxy/src/TrustProxies.php(46): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #55 [internal function]: Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure)) #56 /var/www/html/snipeit/bootstrap/cache/compiled.php(9953): call_user_func_array(Array, Array) #57 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #58 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #59 /var/www/html/snipeit/app/Http/Middleware/CheckForSetup.php(22): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #60 [internal function]: App\Http\Middleware\CheckForSetup->handle(Object(Illuminate\Http\Request), Object(Closure)) #61 /var/www/html/snipeit/bootstrap/cache/compiled.php(9953): call_user_func_array(Array, Array) #62 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #63 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #64 /var/www/html/snipeit/app/Http/Middleware/NosniffGuard.php(17): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #65 [internal function]: App\Http\Middleware\NosniffGuard->handle(Object(Illuminate\Http\Request), Object(Closure)) #66 /var/www/html/snipeit/bootstrap/cache/compiled.php(9953): call_user_func_array(Array, Array) #67 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #68 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #69 /var/www/html/snipeit/app/Http/Middleware/XssProtectHeader.php(17): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #70 [internal function]: App\Http\Middleware\XssProtectHeader->handle(Object(Illuminate\Http\Request), Object(Closure)) #71 /var/www/html/snipeit/bootstrap/cache/compiled.php(9953): call_user_func_array(Array, Array) #72 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #73 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #74 /var/www/html/snipeit/app/Http/Middleware/FrameGuard.php(17): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #75 [internal function]: App\Http\Middleware\FrameGuard->handle(Object(Illuminate\Http\Request), Object(Closure)) #76 /var/www/html/snipeit/bootstrap/cache/compiled.php(9953): call_user_func_array(Array, Array) #77 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #78 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #79 /var/www/html/snipeit/bootstrap/cache/compiled.php(13400): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #80 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure)) #81 /var/www/html/snipeit/bootstrap/cache/compiled.php(9953): call_user_func_array(Array, Array) #82 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #83 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #84 /var/www/html/snipeit/bootstrap/cache/compiled.php(11943): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #85 [internal function]: Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure)) #86 /var/www/html/snipeit/bootstrap/cache/compiled.php(9953): call_user_func_array(Array, Array) #87 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #88 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #89 /var/www/html/snipeit/bootstrap/cache/compiled.php(3286): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #90 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure)) #91 /var/www/html/snipeit/bootstrap/cache/compiled.php(9953): call_user_func_array(Array, Array) #92 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #93 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #94 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #95 /var/www/html/snipeit/bootstrap/cache/compiled.php(9938): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #96 /var/www/html/snipeit/bootstrap/cache/compiled.php(2366): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #97 /var/www/html/snipeit/bootstrap/cache/compiled.php(2350): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request)) #98 /var/www/html/snipeit/public/index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request)) #99 {main}
I can still check out to users without an issue. I can also check out to an asset, as long as the corresponding user is also selected, but checking out to just an asset is a no go.
Pull and try again please
On it!

