Closed TheManTheMythThePanda closed 9 months ago
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
Have you tried using the --item-type=asset
flag? if you run php artisan snipeit:import -help
you can see all the options available:
it doesn't seem to change the output. It doesn't fail the asset tag when i rename the csv header to "asset_tag" instead of "Asset Tag". But the same sadly doesnt work with the model id/name.
Hello, I had the same issue, with the error model_id is required.
I changed Model Name
to asset_model
in the CSV and it imported correctly. (along with replacing Asset Tag
to asset_tag
)
I checked this file to get this info: https://github.com/snipe/snipe-it/blob/73ddc0f6693ae5f297d4cfd7187325f1f552e31f/app/Importer/Importer.php#L57
Also, using "model name" in lowercase doesn't work.
I think something might be broken with the field mapping...
@Krafting Thank you so much! It is working now as expected. And yea, something is clearly broken with the field mapping haha. But thanks for the fix :D
Oops. I forgor to close the issue. The issue is still sorta there, but the workaround worked, ye.
Debug mode
Describe the bug
When importing an Asset CSV file from the console i get this error:
The following Errors were encountered. Error: Item: failed validation: {"Asset \"\"":{"model_id":["The model id field is required."],"asset_tag":["The asset tag must be at least 1 characters.","The asset tag must be unique."]}}
The command i run is:
php artisan snipeit:import /var/tmp/ssh.csv --verbose
I've read other people having this issue, but i haven't being able to fix the problem for my case. I started with a full .csv file, but i scaled it down to this:
Category,Model Name,Asset Tag
CGTest,MNTest,KJH90890
I know that there can be a lot more fields used, but the documentation says this is the bare minimum needed, and even this dont work. As you can see, the code says the tag should be unique, but it is. I've also made sure that there are no spaces at the end of the csv file. I have no idea why this wouldn't work, cuz i also didnt get the template asset.csv to work.
Edit: I should by the way remember to mention that it works when using the browser importer. So even tho i could just use the browser importer, in my case it'll be faster and easier to just do it from the console.
Reproduction steps
Expected behavior
It should import the asset/assets into Snipe-IT.
Screenshots
No response
Snipe-IT Version
6.2.3 build 11759
Operating System
Ubuntu Server 64-bit
Web Server
Apache
PHP Version
8.2.10-2ubuntu1
Operating System