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

Syntax Error on Erlang expressions inside yaml file #274

Closed
volga629 opened this issue Aug 12, 2014 · 15 comments
Closed

Syntax Error on Erlang expressions inside yaml file #274

volga629 opened this issue Aug 12, 2014 · 15 comments
Assignees

Comments

@volga629
Copy link

Hello Everyone,
I am getting sysntax error and does in matter what change it still complain the same line
Any help thank you.

22:39:11.180 [error] Cannot load /opt/ejabberd/conf/ejabberd.yml: Syntax error on line 674 at position 46: did not find expected key

    ldap_vcard_map:
        "NICKNAME": {"%u": []}
        "GIVEN": {"%s": ["givenName"]}
        "FAMILY": {"%s": ["sn"]}
        "FN": {"%s, %s": ["sn", "givenName"]},
        "EMAIL": {"%s": ["mail"]}
        "BDAY": {"%s": ["birthDay"]}]}
    ## Search form
    ldap_search_fields:
      "User": "%u"
      "Name": "givenName"
      "Family Name": "sn"
      "Email": "mail"
      "Birthday": "birthDay"
    ## vCard fields to be reported
    ## Note that JID is always returned with search results
    ldap_search_reported:
      "Full Name": "FN"
      "Nickname": "NICKNAME"
      "Birthday": "BDAY"

@volga629
Copy link
Author

version 14.07

@zinid
Copy link
Contributor

zinid commented Aug 12, 2014

Obviously you have syntax errors in two lines and parser is saying the exact line numbers.

@zinid zinid closed this as completed Aug 12, 2014
@volga629
Copy link
Author

@zinid
Copy link
Contributor

zinid commented Aug 12, 2014

Please read something about YAML.

@sandinak
Copy link

sandinak commented Jan 2, 2015

This response isn't useful The issue ihere is that ldap_vcard_map has triple entries in the configuration that the user noted above:
{modules,
..,
{mod_vcard_ldap,
[
{ldap_vcard_map,
[{"NICKNAME", "%u", []}, % just use user's part of JID as his nickname
{"FIRST", "%s", ["givenName"]},
{"LAST", "%s", ["sn"]},

I havn't found a good way to represent ... nor any single example that translates that to YAML
mod_vcard_map:
ldap_vcard_map:
"FIRST": "%s"
- givenName

Fails all day. It's the only module that was NOT re-represented in the documentation as YAML .. please fix.

@cromain
Copy link
Contributor

cromain commented Feb 11, 2015

we'll check the documentation for this particular case

@cromain cromain reopened this Feb 11, 2015
@cromain cromain self-assigned this Feb 11, 2015
@cromain
Copy link
Contributor

cromain commented Feb 11, 2015

recent commit 87d2eb by badlop will help for this this case. it allows to write erlang expressions as part of the YAML file. example:
ldap_vcard_map:
"NICKNAME": "> {"%u", []}."
this is to be tested against ldap module, i did not checked yet.

@mremond mremond changed the title Get Syntax Error Syntax Error on Erlang expressions inside yaml file Feb 11, 2015
@zinid
Copy link
Contributor

zinid commented Feb 11, 2015

@cromain there is no needs for such hacks, mod_vcard_ldap supports native yaml configuration, it's just not documented.

@sandinak
Copy link

zinid: I don't see that in the code... can you give an example?

@badlop
Copy link
Member

badlop commented Feb 17, 2015

Guide updated so mod_vcard_ldap config examples use YAML format.

@badlop badlop closed this as completed Feb 17, 2015
erszcz pushed a commit to erszcz/ejabberd that referenced this issue Nov 7, 2015
@HoneyShyam
Copy link

HoneyShyam commented Sep 20, 2016

Is that working anyway.
I have update the database from mnesia to mysql,

##
## MySQL server:
##
-
    sql_type: mysql
    sql_server: "localhost"
    sql_database: "mydb"
    sql_username: "root"
    sql_password: "mypassword"
##

Now I am geting the
Syntax error on line 333 at position 1: did not find expected key
Any help appreciated.

@badlop
Copy link
Member

badlop commented Sep 21, 2016

The error message you get is the same that on this ticket, but many months have passed, so the source of the problem may be different. Please open a new ticket with your setup, your config, and mention that this ticket may be related.

@rani27
Copy link

rani27 commented Aug 24, 2018

@HoneyShyam
Just remove space from starting of sql parameters,add like below

##
## MySQL server:
##

sql_type: mysql
sql_server: "localhost"
sql_database: "mydb"
sql_username: "root"
sql_password: "mypassword"
##

@lock
Copy link

lock bot commented Aug 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
@badlop @cromain @zinid @sandinak @HoneyShyam @rani27 and others