LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 04-28-2009, 11:09 PM   #1
donanap
Member
 
Registered: Sep 2008
Location: Perth, Australia
Distribution: RedHat, Solaris
Posts: 38

Rep: Reputation: 15
Unhappy ldap_add:Invalid Syntax Error (23)


Hi,

I am sorry if this is in the wrong forum, wasnt sure where to put it. Can someone PLEASE help!? I have searched google and had no luck.

I have RHEL 4.5, I am running openLDAP.
I have managed to get the server up and running, slapd is started. I have created my groups and I have run into problems trying to add my first user..
People ldif entry:
Code:
dn: ou=people,dc=example,dc=aus,dc=edu,dc=net,dc=com
objectClass: top
objectClass: organizationalUnit
ou: people

dn: ou=group,dc=example,dc=aus,dc=edu,dc=net,dc=com
objectClass: top
objectClass: organizationalUnit
ou: group
Group ldif entry:
Code:
dn: cn=dcs,ou=group,dc=example,dc=aus,dc=edu,dc=net,dc=com
objectClass: posixGroup
objectClass: top
cn: dcs
gidNumber: 9000
memberuid: testusr
User ldif entry:
Code:
dn: cn=testusr,ou=people,dc=example,dc=aus,dc=edu,dc=net,dc=com
objectClass: top
objectClass: posixAccount
objectClass: account
objectClass: shadowAccount
cn: testusr
sn: usr
uid: testusr
uidNumber: 600
gidNumber: 9000
homeDirectory: /userdirs/testusr
userPassword: change123
loginShell: /bin/csh
shadowMax: 60
Then when i type:

Code:
ldapadd -x -D "cn=Administrator,dc=example,dc=aus,dc=edu,dc=net,dc=com" -W -f testusr.ldif
Enter LDAP Password:
adding new entry "cn=testusr,ou=people,dc=example,dc=aus,dc=edu,dc=net,dc=com"
ldap_add: Invalid syntax (23)
        additional info: gidNumber: value #0 invalid per syntax
I have no idea what I am doing wrong. When I try and add the user without adding into a group i get:
Code:
ldap_add: Invalid syntax (21)
        additional info: uidNumber: value #0 invalid per syntax
Any help would be greatly appreciated!! I am borderline newbie on this so apologies if this is a simple error I am making?!?
 
Old 04-29-2009, 01:23 AM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

I honestly don't see anything wrong with what you've shown...
... but I'm virtually certain it's some simple spelling or punctuation error somewhere. Here's an example:

http://archives.devshed.com/forums/n...d-2397459.html
Quote:
EXAMPLE ERROR:
dapadd -x -D "cn=Manager,dc=mdah,dc=state,dc=ms,dc=us" -W -f main.ldif
Enter LDAP Password:
adding new entry "dc=mdah,dc=state,dc=ms,dc=us"

adding new entry "cn=Manager,dc=mdah,dc=state,dc=ms,dc=us"
ldapadd: Invalid syntax (21)
additional info: objectclass: value #0 invalid per syntax
Quote:
ROOT CAUSE:
dn: cn=Manager,dc=mdah,dc=state,dc=ms,dc=us
objectclass: organzationalRole
cn: Manager
<= "organizationalRole" was mis-spelled
'Hope that helps .. PSM
 
Old 04-29-2009, 11:30 PM   #3
donanap
Member
 
Registered: Sep 2008
Location: Perth, Australia
Distribution: RedHat, Solaris
Posts: 38

Original Poster
Rep: Reputation: 15
Thumbs up

Hi Paulsm4,

thanks for your suggestion. I have fixed the problem, however unfortunately I cannot be certain as to what the solution was. Sorry all those people who read this for help!!

However, here are my suggestions or rather the things I did change just before it miraculously worked!!

I modified the group entry to include attribute memberuid: as below.

Code:
#Groups
dn: cn=dcs,ou=group,dc=apgsis88,dc=perth,dc=oilfield,dc=slb,dc=com
objectClass: posixGroup
objectClass: top
cn: dcs
gidNumber: 9000
memberuid: testusr
I also restarted slapd server.

Code:
[root@testsrv88 ldap]# service ldap restart
I'm sure it was something simple that I did above but unfortunately dont know which of these things was the key!

Thanks for your suggestions paulsm4.
 
Old 09-07-2011, 09:33 AM   #4
straylight
LQ Newbie
 
Registered: Sep 2011
Posts: 1

Rep: Reputation: Disabled
Invisible typo

I had exactly the same error, it turned out in my ldif file I had:

Code:
loginShell: /bin/bash
uidNumber: 9015 
gidNumber: 20
for clarity:
Code:
"uidNumber: 9015 "
and not as it should have been:
Code:
"uidNumber: 9015"

There was a space at the end of the numeric uidNumber value. I'd copied the value out of another file and didn't see the space, but it was enough to waste an hour of my life.
 
  


Reply

Tags
invalid, syntax


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LDAP Problem Invalid DN Syntax (34) steve007 Linux - Newbie 3 08-24-2009 07:53 AM
Virtual Machine Manager - Invalid Syntax rajeshux Red Hat 5 11-20-2008 10:35 AM
[Python] Invalid Syntax - If statement LinuxCrayon Programming 4 12-07-2007 09:11 AM
LDAP Problem Invalid DN syntax (34) steve007 Linux - Newbie 3 10-18-2005 05:03 AM
URGENT: ldap_add(): Add: Object class violation error 65 sierraaltae Linux - Security 1 08-05-2005 10:41 AM


All times are GMT -5. The time now is 07:15 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration