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

throw new Error(Invalid arguments: ${error.message}); #12

Open
xx2new opened this issue Jul 13, 2020 · 2 comments
Open

throw new Error(Invalid arguments: ${error.message}); #12

xx2new opened this issue Jul 13, 2020 · 2 comments

Comments

@xx2new
Copy link

xx2new commented Jul 13, 2020

Hey i get this error when i will start ldap-server ...

$ node node_modules/ldap-server-mock/server.js --conf=/tmp/ldap-server-mock-conf.json --database=/tmp/users.json

/tmp/ldap/node_modules/ldap-server-mock/server.js:26
throw new Error(Invalid arguments: ${error.message});
^

Error: Invalid arguments: /tmp/users.json: Unexpected token [ in JSON at position 119
at Object. (/tmp/ldap/node_modules/ldap-server-mock/server.js:26:9)
at Module._compile (module.js:577:32)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:387:7)
at startup (bootstrap_node.js:153:9)
at bootstrap_node.js:500:3

Do you have any idea why i get this error ?

Thank you

@maxime-beguin
Copy link
Contributor

Hi!

@xx2new : As the error says your users.json file doesn't seem to be a valid JSON file (Error: Invalid arguments: /tmp/users.json: Unexpected token [ in JSON at position 119)

@benoit-romito
Copy link

Hi @maxime-beguin, I had the same error in my server.conf. I solved it by putting the server config into an array :

[
  {
  "port": 3004,
  "userLoginAttribute": "cn",
  "searchBase": "dc=test",
  "searchFilter": "(&(objectclass=person)(cn={{username}}))"
  }
]

It seems to do the trick :

LDAP server listening on port 3004

but I'm not sure if it's the good fix.

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