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

LDAP Sync changes location but doesn't save #12031

Open
2 tasks done
CrypNZ opened this issue Oct 25, 2022 · 3 comments
Open
2 tasks done

LDAP Sync changes location but doesn't save #12031

CrypNZ opened this issue Oct 25, 2022 · 3 comments
Assignees

Comments

@CrypNZ
Copy link

CrypNZ commented Oct 25, 2022

Debug mode

Describe the bug

If a user changes OU (with OU Location Sync being set up), after doing an LDAP sync, the user will still appear to be in the old OU.
If you go into SnipeIT and click "edit" on their profile, the new locations will be set.
If you cancel and go back to searching the locations, they will still be under the old location.

If you go back to editing their profile, without changing anything and click "save", they will now be in the correct location

Reproduction steps

  1. Set up locations with OU syncing.
  2. Go to Active Directory and change a users OU
  3. Go to SnipeIT and do an LDAP sync
  4. Check the user in question and their location
  5. The location and department (both set from LDAP sync) is still set to the old locations
  6. If I click edit, then save without making any changes, the expected changes are now made.

Expected behavior

After step 4 in the reproduction steps, I'd expect to see them in the new OU without any further steps.

Screenshots

No response

Snipe-IT Version

v6.0.4 build 8050

Operating System

Ubuntu

Web Server

Nginx

PHP Version

7.4.3

Operating System

Ubuntu 2204

Browser

Google Chrome

Version

106

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

@H4usi
Copy link

H4usi commented Feb 2, 2023

yea, we have the same issue. I Posted it a while ago here on Github #10106
The user gets updated, but the assets are staying at the old location. But your solution to edit the user and save it, is WAY smarter than what we did. We checked in and out, every asset to the user.

So i can't help you sadly, but thanks for the help :)

@CrypNZ
Copy link
Author

CrypNZ commented Feb 3, 2023

@Godmartinz Have you managed to figure out the cause for this ticket and #10106 ?

@CrypNZ
Copy link
Author

CrypNZ commented Jun 14, 2023

@H4usi , I've noticed you can fix this with a daily cron job (if you are using linux) by running the following command in your project root: php artisan snipeit:sync-asset-locations --output=all

Keep in mind a few things that I found;

  1. Any asset checked in with a location & without a default location will have their location wiped as a result of the command. I suggest doing a backup, testing the command and looking at the affects with your dataset to fully assess this.
  2. Any asset checked in with a location & default location that is different, the default location will take precedence.
  3. To add to point 2, the default location does not get set upon checking in an asset as per issue Default location not being set/updated upon check-in #13167

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

No branches or pull requests

3 participants