snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Importing CSV Errors

Open elJoeyJojo opened this issue 10 years ago • 17 comments

Expected Behavior (or desired behavior if a feature request)

I want to be able to import a simple *.CSV file so that I don't have to manually enter all the records from another database.


Actual Behavior

Whenever I upload a *.csv file I just get the "Process" logo and nothing happens. When I click on the process button it gives me an "Server Error: 500 (Internal Server Error)

Also I can't seem to remove them from the list, how can I remove these?

image


Please confirm you have done the following before posting your bug report:


Please provide answers to these questions before posting your bug report:

  • Version of Snipe-IT you're running - Running SnipeIt v.2.1.1
  • What OS and web server you're running Snipe-IT on - Running SnipeIt on CentOS 6.8
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) - Manual Installation
  • If you're getting an error in your browser, include that error - Server Error: 500 (Internal Server Error)
  • What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error - I am on the http://snipeit.domain.com/hardware/import
  • If a stacktrace is provided in the error, include that too.
  • Any errors that appear in your browser's error console.
  • Confirm whether the error is reproduceable on the demo.
  • Include any additional information you can find in app/storage/logs and your webserver's logs. - [2016-07-08 15:22:48] production.ERROR: exception 'ErrorException' with message 'Undefined variable: first_name' in /opt/snipe-it/app/commands/AssetImportCommand.php:252 Stack trace:
  • Include what you've done so far in the installation, and if you got any error messages along the way. - Not much really, I tried uploading the same file a few times, uploading them from different locations with same result.
  • Indicate whether or not you've manually edited any data directly in the database

elJoeyJojo avatar Jul 08 '16 22:07 elJoeyJojo

You may want to upgrade to v3. The importer is much better in v3

snipe avatar Jul 08 '16 22:07 snipe

Do you have any user name fields that are atypical? (.i.e. three names instead of two , or one name instead of two)

snipe avatar Jul 08 '16 22:07 snipe

v3? there's a new release already? i just installed this thing a few days ago

elJoeyJojo avatar Jul 08 '16 22:07 elJoeyJojo

It's still pre-release, but is very stable. https://snipe-it.readme.io/blog/v3-is-coming

snipe avatar Jul 08 '16 22:07 snipe

Thanks! well since I have nothing in there, let the UPGRADE BEGIN! THANKS!

elJoeyJojo avatar Jul 08 '16 22:07 elJoeyJojo

:)

Upgrading docs are here: https://snipe-it.readme.io/docs/upgrading

snipe avatar Jul 08 '16 22:07 snipe

Also, the import process has changed a little. See updated import info for v3 here: https://snipe-it-manual.readme.io/docs/importing-assets

snipe avatar Jul 08 '16 22:07 snipe

thanks! btw, i can just pull it with git clone right? Assuming that will pull V3 or do I have to use wget to get V3?

elJoeyJojo avatar Jul 08 '16 22:07 elJoeyJojo

You'll want to git checkout the v3-master branch

snipe avatar Jul 08 '16 23:07 snipe

any different permissions i have set up?

i think i did everything all right but can't seem open anything when access snipeit.domain.com

i check the logs and:

[Fri Jul 08 17:45:24 2016] [error] [client 192.168.163.16] PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/opt/snipe-it/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied' in /opt/snipe-it/bootstrap/cache/compiled.php:13832\nStack trace:\n#0

When I change it back to v2 Snipe It everything works so I am sure there is some permissions issue

elJoeyJojo avatar Jul 09 '16 00:07 elJoeyJojo

/opt/snipe-it/storage (and all subdirs and files) should be writable by the web server.

snipe avatar Jul 09 '16 03:07 snipe

hey there! thanks for your help! that seemed to work however for some reason it won't let me in with the same account "snipeit" local admin I created in v2. It is trying to authenticate with LDAP, how can I disable LDAP via the configuration files?

elJoeyJojo avatar Jul 11 '16 20:07 elJoeyJojo

Answered in the other ticket :)

snipe avatar Jul 11 '16 20:07 snipe

hey @snipe back to this issue, i have a .csv file that i got from an application called InFlow Inventory. When i try to upload it i get this:

image

In my .csv file I changed the "name" filed to "asset" and also I have a field called "Category" but not "Category Monitors"but it saids it's already been taken. Also saids it requires a "Asset Model Unknown" and not sure what that is for. My csv file only has a (name, category, description, barcode and default location)

Now the Category types seemed to have been imported but no assets in there. How can I change my csv file to import all those?

Thanks a bunch!

elJoeyJojo avatar Jul 14 '16 21:07 elJoeyJojo

Without knowing what your CSV looks like, there's not really a way to help you here. You'll have to check the documentation, and check that your CSV format matches the samples provided: https://snipe-it-manual.readme.io/docs/importing-assets

snipe avatar Jul 15 '16 18:07 snipe

I got it working! Thanks :)

elJoeyJojo avatar Jul 18 '16 15:07 elJoeyJojo

I'm going to make a few changes that should make it clearer that the "Monitors" and "Unknown" are the names of the category/Asset Model, not the name of the field.

mnemonicly avatar Jul 18 '16 16:07 mnemonicly