ejabberd.yml atoms/strings don't play nice with yaml generating tools

Created on 9 Dec 2017  路  4Comments  路  Source: processone/ejabberd

What version of ejabberd are you using?

16.01

What operating system (version) are you using?

Ubuntu 16.04

How did you install ejabberd (source, package, distribution)?

Package

What did not work as expected? Are there error messages in the log? What
was the unexpected behavior? What was the expected result?

Ejabberd doesn't treat double, single, or no-quoted strings equivalently. Going by #825 this is because its underlying tech distinguishes between two data types, "atom" and "string", that yaml has no concept for. This makes programmatically generating conf files difficult, because "normal" yaml tools (e.g. pyyaml, or in my case the yaml filter in Saltstack) emit them interchangably. You can see the effect by loading the default conf file in pyyaml and then writing it out again. The result is yaml-equivalent (according to diffyaml, at least), but crashes ejabberd.

It is unclear from #825 whether this has been, will, or won't be fixed. I certainly still have the problem in my version.

Is there a way to convince ejabberd to implicitly convert strings and atoms as needed? Failing that, is there an easy way to "sanitize" an ejabberd.yml config to enforce correct quoting? Failing that, is there a list somewhere of which options expect atoms, and which expect strings, so I can write such a script myself?

Most helpful comment

Fixed in a02cff0e780bb735531594c4ece81e8628f79782

All 4 comments

Just after a brief search it apparently requires to change around 1000 validating functions (maybe a bit less). Any volunteers? I knew that :)

Fixed in a02cff0e780bb735531594c4ece81e8628f79782

Wow. I didn't expect to see a fix, given the size of the task and the silence in this thread. You sir, are awesome.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

licaon-kter picture licaon-kter  路  4Comments

cromain picture cromain  路  3Comments

jjdp picture jjdp  路  3Comments

ForGuru picture ForGuru  路  4Comments

shazvan275 picture shazvan275  路  3Comments