Unable to accept assigned asset (Eula)
Expected Behavior (or desired behavior if a feature request)
Click on emailed link (EULA) and be able to accept assigned asset
Actual Behavior
After clicking the emailed link on EULA, Use logs in, dashboard shows message "Error: The asset you are trying to accept was not assigned to you"
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
Please provide answers to these questions before posting your bug report:
- Version of Snipe-IT you're running v3.5.1-2-gd7222ae
- What OS and web server you're running Snipe-IT on Win server 2012 r2, WAMP
- What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) Manual
- If you're getting an error in your browser, include that error No error observed
- What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error Dashboard
- If a stacktrace is provided in the error, include that too. No error observed
- Any errors that appear in your browser's error console. No error observed
- Confirm whether the error is reproduceable on the demo. Not observed in demo
- Include any additional information you can find in
app/storage/logsand your webserver's logs. Reviewing logs - Include what you've done so far in the installation, and if you got any error messages along the way.
Resinchronized LDAP users, Assigned to non LDAP users, Reinstalled composer and run
php composer.phar install --no-dev --prefer-source php composer.phar dump-autoload php artisan migrate php artisan config:clearAssigned asset to a newly created user - Indicate whether or not you've manually edited any data directly in the database No
We'd need to see data for us to make any sense of that. AFAIK, asset acceptance is working for others. The code there seems pretty straightforward:
$user = Auth::user();
if ($user->id != $findlog->checkedout_to) {
return redirect()->to('account/view-assets')->with('error', trans('admin/users/message.error.incorrect_user_accepted'));
}
What data do you need ?
Where is that log that the function $findlog is looking at? The asset is correctly checked out to the user and the Activity report has the right information.
I am also getting this, from the unaccepted assets report, I think it might be related.

Checking the DB I found that the asset is being assigned to the right user, The accepted field is set to "pending" User_id is 1
I hope this helps
I am eager to fix this go test the signature drawing
The picture with the error above was resolved, I found two orphan records in the DB, corrected it an the error went away. For some reason viewassetscontroller.php line 300 is still finding $user->Id != $findlog->checkedout_to
The action_log shows the following: Id: 2 User_id: 30 (my user Id) Acction_type: checkout Target_id : 30 Target_type: app\models\users Item_id : 301 (right asset, shows pending in the assets.accepted table)
Help! I don't know what else to try.
Same problem and error i got but version of snipe-it is v3.5.2-11-g5a835a5
Every time user tries to accept it error appers. In 'all assets' section i see assets assigned properly, but in report section in 'unaccepted assets' every asset i checkedout is there.
What code from debuger do you need to understand error we got in return :) I am not very good with it but i will try my best to do it.
I upgrade it to v3.5.1-2-gd7222ae with hope of fixin the issue, no joy so far
The user _id and target _id being the same looks wrong... I'll take a look
The conditional code that @snipe pointed out is different in develop... is anyone with this issue using develop? Or all on master/released versions?
I am only using the stable versions
same here using stable version.
I believe this is fixed on develop.