Import Issue
Please confirm you have done the following before posting your bug report:
- [x ] I have enabled debug mode
- [x ] I have read checked the Common Issues page
Describe the bug Attempting to import your sample-assets.csv, receive the following error:
Argument 3 passed to App\Events\CheckoutableCheckedOut::__construct() must be an instance of App\Models\User, null given, called in /var/www/snipeit/app/Models/Asset.php on line 312
To Reproduce Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior File would be imported.
Screenshots If applicable, add screenshots to help explain your problem.
Server (please complete the following information):
- Snipe-IT Version 5.0.9
- OS: CentOS
- Web Server: Apache
- PHP Version: 7.3.11
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Error Messages Argument 3 passed to App\Events\CheckoutableCheckedOut::__construct() must be an instance of App\Models\User, null given, called in /var/www/snipeit/app/Models/Asset.php on line 312
Additional context
- Is this a fresh install or an upgrade? Fresh install
- What OS and web server you're running Snipe-IT on
- What method you used to install Snipe-IT (install.sh, manual installation, docker, etc)
- Include what you've done so far in the installation, and if you got any error messages along the way.
- Indicate whether or not you've manually edited any data directly in the database
Add any other context about the problem here.
Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.
👋 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.
Additional Comment: LDAP is not being used.
just upvoting...same issues here.
I do have operational data that I need to import, but am using your exemplar data to recreate the problem...
I've the same issue also on Version v5.0.11 It is a more or less fresh installation and we tried our first import.
I'm having the same issue here on an upgraded version. I'm getting this exception when I'm trying to import a CSV to update some assets and there's data on the Username column. My workaround here is to import the assets passing blank on the Username column and then manually update every asset manually on the web console.
I have the same issue when importing sample-assets.csv from the command line on Version v5.0.11. When I imported the sample-assets.csv from the importer on the WEB GUI, it was registered successfully.
I'm having the exact same issue with version 5.0.12. I get this error when I run either a command line import or an import via the Web GUI.
My instance is a manual installation (via git method). I was able to do a successful web import in December, so that must have been version 5.0.11 or earlier.
EDIT:
I want to add that I have tried @rogeriovazp's workaround of leaving the username fields blank, and that did not work. I have tried other common CSV debugging such as checking for empty rows/columns, checking that all the Headers match, checking for encoding issues, etc.
Update on my situation:
My CSV had a mixture of assets being assigned to users and assets being assigned to locations. I decided to try removing the location-assigned assets and re-importing--that worked!
I then tried importing just the location-assigned assets, but this resulted in the same error as before and reported elsewhere in this issue.
I should add that the locations I was assigning to had already been created, and I was importing using the local super admin account. It certainly feels like a permissions issue, but in my case that should not have been an issue.
Let me know if there's anything you'd like to see from me.
Thanks for the aditional details! Gonna check this out as soon as I can.
@mscotthouston @bradrsnipeit1 @uchida140964 @rogeriovazp @crazyaaron97 I'm trying the importer with the test file provided in the docs: https://snipeitapp.com/assets/downloads/sample-assets.csv
And I'm unable to reproduce this (GUI and CLI). I test it in the develop branch, that currently is 5.1.0 and in v5.0.9. I don't know if it's too much to ask for... but you think any of you can add a CSV file that makes the Importer fails as described here? I know that maybe you can't if you have sensitive data, but maybe you can create or tell me how to create a similar file as your wronging one. There's not a lot I can do if I can't reproduce this behaviour... Thanks in advance.
Ugh, this sucks. Actually the test file in the docs does fail in the CLI importer with the error reported in the original issue post. I assume by other comments it's where the error exists. Please ignore the previous message, I'm looking at this issue in my local instance now.
@inietov thank you for looking into this!
If you change your mind and need a CSV, I can prepare one for you--just let me know and I'll be happy to do that.