snipe / snipe-it

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

Check-in Unique serial error #13905

Closed kelsen closed 10 months ago

kelsen commented 10 months ago

Debug mode

Describe the bug

When I try to check-in any asset it is showing this error: Asset was not returned, please try again{"serial":["The serial must be unique."]}

Reproduction steps

  1. Navigate to all assets page
  2. Click on "check-in" button on any asset
  3. Click on "check-in" once again on "return page"

Expected behavior

check-in the asset.

Screenshots

image

Snipe-IT Version

6.2.3

Operating System

Ubuntu 20.04

Web Server

Apache

PHP Version

7.4

Operating System

No response

Browser

No response

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

[2023-10-24 13:53:29] production.ERROR: SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from `users` where `id` = 135 and `users`.`deleted_at` is null limit 1) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 2002): SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from `users` where `id` = 135 and `users`.`deleted_at` is null limit 1) at /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Connection.php:712)#41 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#42 /var/www/html/snipeit/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle()
#43 {main}

Next Illuminate\Database\QueryException: SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from `users` where `id` = 135 and `users`.`deleted_at` is null limit 1) in /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
Stack trace:
#0 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Connection.php(672): Illuminate\Database\Connection->runQueryCallback()
#1 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Connection.php(376): Illuminate\Database\Connection->run()
#2 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2414): Illuminate\Database\Connection->select()
#3 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2402): Illuminate\Database\Query\Builder->runSelect()
#4 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2936): Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()
#5 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2403): Illuminate\Database\Query\Builder->onceWithColumns()
#6 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(625): Illuminate\Database\Query\Builder->get()
#7 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(609): Illuminate\Database\Eloquent\Builder->getModels()
#8 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(294): Illuminate\Database\Eloquent\Builder->get()
#9 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php(53): Illuminate\Database\Eloquent\Builder->first()
#10 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Auth/SessionGuard.php(148): Illuminate\Auth\EloquentUserProvider->retrieveById()
#11 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Auth/GuardHelpers.php(60): Illuminate\Auth\SessionGuard->user()
#12 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php(336): Illuminate\Auth\SessionGuard->check()
#13 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Auth\AuthManager->__call()
#14 /var/www/html/snipeit/app/Http/Middleware/CheckForDebug.php(21): Illuminate\Support\Facades\Facade::__callStatic()
#15 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckForDebug->handle()
#16 /var/www/html/snipeit/app/Http/Middleware/CheckForSetup.php(32): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#17 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckForSetup->handle()
#18 /var/www/html/snipeit/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#19 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle()
#20 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#21 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\View\Middleware\ShareErrorsFromSession->handle()
#22 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#23 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\Session\Middleware\StartSession->handleStatefulRequest()
#24 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Session\Middleware\StartSession->handle()
#25 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#26 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
#27 /var/www/html/snipeit/app/Http/Middleware/NoSessionStore.php(28): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#28 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\NoSessionStore->handle()
#29 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#30 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\Pipeline\Pipeline->then()
#31 /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#32 /var/www/html/snipeit/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle()
#33 {main}

Additional context

The installation was moved to another server (whole directory copied and database backup restored) and then upgraded from 6.1.1-pre-alpha to 6.2.3 using git.

kmain4 commented 10 months ago

I'm having the same issue!

kmain4 commented 10 months ago

Rolled back to v6.2.2 via Docker and it resolved; its a bug in v6.2.3.

snipe commented 10 months ago

Do you have a unique constraint on the serial number in your settings?

snipe commented 10 months ago

AFAIK, this was fixed in https://github.com/snipe/snipe-it/pull/13887, which is currently on master.

whitephnx1 commented 10 months ago

when is this expected to be pushed out?

snipe commented 10 months ago

It's already on master, as I mentioned.

kelsen commented 10 months ago

I'm not versated on git, could you provide me the steps in order to fix this error? I tried the commands below and I'm still seeing this error when I try to check-in an asset.

Snipe-it Version v6.2.3 - build 11936 (master)

thhowson commented 10 months ago

Hey @snipe, we were looking into #13887 however it appears that it has only been committed to the development branch and not the master unless there is something that we couldn't see.

Thanks for the speedy resolution to this hope to see in the master branch soon.

snipe commented 10 months ago

@thhowson - that PR didn't actually fix the issue (tho it was in fact on master). This one should hopefully do the trick tho. https://github.com/snipe/snipe-it/pull/13913 - it's currently being tested.