I am trying to figure out why importing via the terminal is not finding a user that exists.
https://snipe-it.readme.io/docs/importer-issues
Describe the bug
Importing via csv cause it to throw an error saying it cannot find a user with the id with number
Even through that exact user exists. Note that users are import from AD
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Import assets and assign to applicable user.
Screenshots
Server (please complete the following information):
Desktop (please complete the following information):
Error Messages
Not browser based
User does not appear to be an id with number: First Last. Continuing through our processes
Additional context
[admin@computer snipeit]$ sudo php artisan snipeit:import /home/admin/Test2.txt -vvv
[sudo] password for centadmin:
======= Importing Items from /home/admin/Test2.txt =========
A matching category: Laptop already exists
Company Company X was created
Location Toronto already exists
Manufacturer Dell already exists
User does not appear to be an id with number: First Last. Continuing through our processes
User first.[email protected] already exists
In Importer.php line 319:
[ErrorException]
Undefined index: manager_id
Exception trace:
IlluminateFoundationBootstrapHandleExceptions->handleError() at /var/www/snipeit/app/Importer/Importer.php:319
AppImporterImporter->createOrFetchUser() at /var/www/snipeit/app/Importer/ItemImporter.php:109
AppImporterItemImporter->determineCheckout() at /var/www/snipeit/app/Importer/ItemImporter.php:88
AppImporterItemImporter->handle() at /var/www/snipeit/app/Importer/AssetImporter.php:24
AppImporterAssetImporter->handle() at /var/www/snipeit/app/Importer/Importer.php:130
AppImporterImporter->AppImporter{closure}() at /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php:29
IlluminateDatabaseConnection->transaction() at /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php:327
IlluminateDatabaseDatabaseManager->__call() at /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:221
IlluminateSupportFacadesFacade::__callStatic() at /var/www/snipeit/app/Importer/Importer.php:137
AppImporterImporter->import() at /var/www/snipeit/app/Console/Commands/ObjectImportCommand.php:83
AppConsoleCommandsObjectImportCommand->fire() at n/a:n/a
call_user_func_array() at /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29
IlluminateContainerBoundMethod::IlluminateContainer{closure}() at /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:87
IlluminateContainerBoundMethod::callBoundMethod() at /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:31
IlluminateContainerBoundMethod::call() at /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Container/Container.php:539
IlluminateContainerContainer->call() at /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Console/Command.php:182
IlluminateConsoleCommand->execute() at /var/www/snipeit/vendor/symfony/console/Command/Command.php:255
SymfonyComponentConsoleCommandCommand->run() at /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Console/Command.php:167
IlluminateConsoleCommand->run() at /var/www/snipeit/vendor/symfony/console/Application.php:946
SymfonyComponentConsoleApplication->doRunCommand() at /var/www/snipeit/vendor/symfony/console/Application.php:248
SymfonyComponentConsoleApplication->doRun() at /var/www/snipeit/vendor/symfony/console/Application.php:148
SymfonyComponentConsoleApplication->run() at /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:122
IlluminateFoundationConsoleKernel->handle() at /var/www/snipeit/artisan:35
[admin@computer snipeit]$
note that the "Company Company X was created" is a typo that does not actually happen. I just subbed in a different value.
Also forgot to mention the gui importer works but not for the specific list i have since it is about 450 entries.
is there maybe some sort of specific formatting to the Name value?
Seems like it able to read the value but not match it for some reason.
tried to import without the "Full Name" field and it works thou it does appears that two other values do not import. Those being MAC Address and Serial Number. Are maybe my column names incorrect?
However the asset does get added, without those fields.
To be honest we've had this problem for a while now. I've almost come to believe this is expected behavior. I wish it wasn't like this. It works with the web importer, but with the CLI, it will never check out an asset to a user. :(
Kind of a long shot, but do you know if long term they are intent on making the website importer the preferred tool to import? Cause reading the importing article it seems to imply that the CLI is the preferred method
@EnvistaGit what version of Snipe-IT are you using? Your issue says 5-something, but v5 isn鈥檛 out yet, so that can鈥檛 be true.
whoops my bad pulled the wrong number.
Snipe-IT version | v4.6.6 build 3926 (g1a10aa0dd)
Software License | AGPL3
PHP Version | 7.2.11
Laravel Version | 5.4.35
If it is the case where this is not the prefered method that fine it is not the biggest deal i can just break up the CSV and import it through the GUI importer.
Ya i just ended up breaking it up and importing through the gui.
I was thinking about doing this too for our setup. I made a Powershell script that runs when the user logs into the PC and it generate a csv file with the PC stats. Another script merge all the csvs into 1 csv. Snipe server auto imports the csvs. It's pretty neat. I just have to leave out the user and manually check out assets to users, or it won't work.
Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!
This issue has been automatically closed because it has not had recent activity. If you believe this is still an issue, please confirm that this issue is still happening in the most recent version of Snipe-IT and reply to this thread to re-open it.