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

[ERROR] Failed to synchronize with ldap java.lang.NullPointerException #690

Closed
gitblit opened this issue Aug 12, 2015 · 5 comments
Closed

[ERROR] Failed to synchronize with ldap java.lang.NullPointerException #690

gitblit opened this issue Aug 12, 2015 · 5 comments

Comments

@gitblit
Copy link
Owner

@gitblit gitblit commented Aug 12, 2015

Originally reported on Google Code with ID 394

What steps will reproduce the problem?
1. Setup LDAP Auth
2. Enable the new realm.ldap.synchronize LDAP Synch option.
3.

What is the expected output? What do you see instead?

Not really sure, but expected that the user accounts would be synched and cleaned up

See java.lang.NullPointerException in logs.

# Defines whether to synchronize all LDAP users and teams into the user service
#
# Valid values: true, false
# If left blank, false is assumed
#
# SINCE 1.4.0
realm.ldap.synchronize = true


2014-03-20 12:34:38 [ERROR] Failed to synchronize with ldap
java.lang.NullPointerException
    at com.gitblit.auth.LdapAuthProvider.sync(LdapAuthProvider.java:123)
    at com.gitblit.service.LdapSyncService.run(LdapSyncService.java:55)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
2014-03-20 12:34:38 [INFO ] Finished user and group sync with ldap service
What version of the product are you using? On what operating system?
Gitblit 1.4.1 / Centos 6.5

Please provide any additional information below.


Reported by kaosagnt on 2014-03-20 02:00:50

@gitblit
Copy link
Owner Author

@gitblit gitblit commented Aug 12, 2015

This is one of those places where improved logging would be useful.  :)

There is no "uid" attribute on the returned user search result.

final String username = loggingInUser.getAttribute(uidAttribute).getValue();
logger.debug("LDAP synchronizing: " + username);

# Attribute on the USER record that indicate their username to be used in gitblit
# when synchronizing users from LDAP
# if blank, Gitblit will use uid
# For MS Active Directory this may be sAMAccountName
# 
# SINCE 1.0.0
realm.ldap.uid = uid

Reported by James.Moger on 2014-03-20 13:09:41

@gitblit
Copy link
Owner Author

@gitblit gitblit commented Aug 12, 2015

I've improved the logging for this situation.

Reported by James.Moger on 2014-04-08 04:23:29

  • Status changed: Queued
  • Labels added: Milestone-1.5.0

@gitblit
Copy link
Owner Author

@gitblit gitblit commented Aug 12, 2015

Thanks for that.

Reported by kaosagnt on 2014-04-08 06:31:17

@gitblit
Copy link
Owner Author

@gitblit gitblit commented Aug 12, 2015

Fix/change released in 1.5.0.

Reported by James.Moger on 2014-04-18 13:27:24

@gitblit
Copy link
Owner Author

@gitblit gitblit commented Aug 12, 2015

Reported by James.Moger on 2014-04-18 13:27:49

  • Status changed: Done

@gitblit gitblit closed this as completed Aug 12, 2015
@flaix flaix added this to the 1.5.0 milestone Dec 13, 2016
@flaix flaix added this to the 1.5.0 milestone Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants