Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import CSV #7789

Closed
PDSmokes opened this issue Feb 4, 2020 · 13 comments
Closed

Cannot import CSV #7789

PDSmokes opened this issue Feb 4, 2020 · 13 comments
Labels

Comments

@PDSmokes
Copy link

PDSmokes commented Feb 4, 2020

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

Describe the bug
A clear and concise description of what the bug is.

When i try to import a CSV it gets stuck on processing. I have tried with my own CVS modeled after the sample CSV provided as well as the sample it self after splitting it to 10. Same issue.

Running in docker and the setup is from the official documentation. However php artisan does not seem to work in the containers so i am not able to i.e update AFAIK.

To Reproduce
Steps to reproduce the behavior:

  1. Go to http://slide-it.com/import
  2. Import sample-assets.csv
  3. process and choose assets in import type
  4. Press import after making sure all import fields have a value.

Expected behavior
I expect it to sit for a bit and then finish and give a completed message. However it doesn't go through

Screenshots
http://i.imgur.com/C6CPGah.png
http://i.imgur.com/XmTE0yT.png

Server (please complete the following information):

  • Snipe-IT Version : v4.8.0 Build 4186)
  • OS: Debian 10 (Docker)
  • Web Server: The one that came in the docker. Suppose it is Nginx
  • PHP Version: 7.1.33-3+ubuntu16.04.1+deb.sury.org+1

Desktop (please complete the following information):

  • OS: Ubuntu 18.04 / Windows 10 1909
  • Browser Chrome, Microsoft Edge (chrominium), Firefox.

Error Messages
https://pastebin.com/XDXqgCTH

Additional context
Fresh install.
Installed using the docker documentation provided by Snipe-IT. It is configured on Portainer.

  • Everything seems to work. Except for importing.
    -I have not edited anything in the database. I am fairly new to this setup.
@knorquist
Copy link

knorquist commented Feb 4, 2020

I'm getting the same error. I noticed pull #7787 added 'requestable' as a fillable attribute and wonder if it's related.

@Traceur10
Copy link

I had this problem when i was behind a reverse proxy and trying to pass HTTPS web traffic to the HTTP container. If you're using SSL, copy your SSL certs to this location inside the container:
/var/lib/snipeit/ssl/snipeit-ssl.crt
/var/lib/snipeit/ssl/snipeit-ssl.key

@itstallion
Copy link

itstallion commented Feb 6, 2020

I'm having the same issues as well. Import runs from the command line. I'm also having an issue where Serial numbers are not getting pulled in from the csv doing an Asset import. I've tried changing the serial number from letters and numbers to straight numbers with no change.

I also confirmed that the issue is reproduced using the sample-asset.csv

@fumunda
Copy link

fumunda commented Feb 6, 2020

I was having the same issue on a test environment i just set up this morning. It wouldnt import ANY of my csv's, even ones that I just used on my new site i spun up 2 days ago. after hours of screwing with it and debugging, i decided to add the field 'Requestable' to my import with a value of 'Yes' and tried again. Whaddya know, went through without a hitch.

I am guessing that Requestable is now a required field? And when did that change? I just set up another server on Tuesday, 2 days ago, using same exact procedure and didnt have any issues.

So try that...

@itstallion
Copy link

Yeah after some debugging of my own I found the problem.

Line 82 in app/Importer/ItemImporter.php

$this->item['serial'] = $this->findCsvMatch($row, "serial");

it should be

$this->item['serial'] = $this->findCsvMatch($row, "serial_number");

You can change the csv header name from 'Serial number' to 'Serial' or modify the code to get it working. I had to have serial numbers as I'm using Micro$oft Deployment Toolkit and it's setup to prepopulate the task list name/ hostname/ ou's by the machines serial number and I'm going to populate my MDT database with data from the Snipeit database.

@fumunda
Copy link

fumunda commented Feb 6, 2020

Interesting. I had tried both 'serial' and 'serial number' as fields and it didnt matter. I am going to have a look at the other server i just set up and see how that ItemImporter.php is coded. The other csv's i used for that worked fine but not this on most recent site i set up.

Good catch!

@knorquist
Copy link

@itstallion I got the same issue with the importer not doing serial numbers.

@zacharysandberg
Copy link

zacharysandberg commented Feb 24, 2020

I have also set up a new manual install of v4.8 within the last few weeks on top of Debian 9 with Apache 2.4.25, PHP 7.4, and MariaDB 10.1. Everything seems to be working great except for the importer, which is a critical feature for our test case.

Changing the serial/serial number suggestion didn't work for me, and in addition to the importer never completing during import, I am also unable to delete previous (attempted) imports, and when I click the trash can, I just get a blank red bar at the top of the page that has no text in it.

@wb-utsa
Copy link

wb-utsa commented Feb 28, 2020

I'm having this issue too with v4.8, local install. Console says:

all.js?id=bf1b244d8cc9096e4a18:4 POST http://localhost/snipeit/public/api/v1/imports/process/4 500 (Internal Server Error)

PHP 7.4

@abate
Copy link

abate commented Mar 31, 2020

same exact problem here. Last docker image behind a traefik reverse proxy ... Tried to change Requestable and Serial Number with no success ...
Digging a bit more :

[00:11:04] LOG.error: Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 1 passed to Spatie\DbDumper\DbDumper::setPort() must be of the type integer, string given, called in /var/www/html/vendor/spatie/laravel-backup/src/Tasks/Backup/DbDumperFactory.php on line 36 in /var/www/html/vendor/spatie/db-dumper/src/DbDumper.php:117
#0 /var/www/html/vendor/spatie/laravel-backup/src/Tasks/Backup/DbDumperFactory.php(36): Spatie\DbDumper\DbDumper->setPort('${MYSQL_PORT_33...')

and

[00:11:04] LOG.error: Type error: Argument 1 passed to Spatie\DbDumper\DbDumper::setPort() must be of the type integer, string given, called in /var/www/html/vendor/spatie/laravel-backup/src/Tasks/Backup/DbDumperFactory.php on line ...

so in my case I guess a problem with my mysql configuration, even though it seems strange as the site is working fine ...

that seems related to #7353

and fixed by adding DB_PORT=3306

@stale
Copy link

stale bot commented May 30, 2020

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!

@stale stale bot added the stale label May 30, 2020
@stale
Copy link

stale bot commented Jun 7, 2020

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.

@stale stale bot closed this as completed Jun 7, 2020
@chshanoo
Copy link

chshanoo commented Jun 9, 2020

I'm having this issue too with v4.8, local install. Console says:

all.js?id=bf1b244d8cc9096e4a18:4 POST http://localhost/snipeit/public/api/v1/imports/process/4 500 (Internal Server Error)

PHP 7.4

I had the same issue on localhost. Tried multiple solutions but what worked for me was a small change in .env file. In Outgoing Mail section
change "MAIL_DRIVER=smtp" to "MAIL_DRIVER=log"
Import worked after that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants