How To Reset a Broken jabberd/Messages/iChat Service on OS X Server

I've had trouble with my jabberd/Messages/iChat service after recents updates of the OS X Server.app, problems I see several posts on here. After getting some help from Apple Enterprise support and my own experiments, here's a summary of a working solution.


I'm still having some difficulty with virtual domain authentication when trying to authenticate from outside the server. Any pointers to a fix for this would be appreciated. But at this point I suspect a jabberd configuration bug in OS X Server.


Reset the jabberd service:


sudo serveradmin stop jabber

sudo rm /private/var/run/jabberd/*.pid /Library/Preferences/com.apple.messageserver.plist

sudo rm -rf /Library/Server/Messages/*

sudo /Applications/Server.app/Contents/ServerRoot/usr/libexec/copy_message_server_co nfig_files.sh

sudo launchctl load -w /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/org.j abber.jabberd.plist

sudo serveradmin start jabber


Reset your Messages app, including your keychain entries:


rm ~/Library/Preferences/com.apple.iChat.*

Keychain Access>Search for and delete all jabber accounts.


Finally, it's highly preferable to use the domain name, not the FQDN, in email-name-based services like jabber. These steps allow you to authenticate to the jabber service using names like user@domainname.com, rather than user@host.domainname.com. Unfortunately, as noted above and elsewhere, this only works for clients on the LAN. Intenet clients must authenticate using the FQDN, or get the error:


host.domainname.com jabberd/c2s[60453]: Authentication failed, mech: DIGEST-MD5 client IP: ::ffff:36.413.165.258 client port: 49694 username: ?


Please post if anyone knows how to fix this problem and authenticate to an OS X Server jabber service from the internet using a virtual domain name.


Configuring jabber for virtual hosts:


sudo serveradmin stop jabber

sudo serveradmin settings jabber:hostsCommaDelimitedString = "hostname.domainname.com,domainname.com"

sudo serveradmin start jabber


These steps should allow you to fix the jabber/Messages/iChat service and create a Messages jabber account like user@domainname.com that successfully authenticates.

Mac mini Server (Mid 2010), OS X Mountain Lion (10.8.2), Lion Server, EyeTV HD, Turbo.264 HD

Posted on Sep 22, 2013 6:03 PM

Reply
13 replies

Nov 26, 2013 8:00 PM in response to essandess

I solved this virtual domain authentication problem. In the directory /Library/Server/Messages/Config/jabberd/ , the files sm.xml, sm_domainname.com.xml, and sm_hostname_domainname.com.xml all contain the entry:



<local><!--comment-->

<id>hostname.domainname.com</id>

</local>


With multiple virtual domains, they all should contain the entry:


<local><!--comment-->

<id>domainname.com</id>

<id>hostname.domainname.com</id>

</local>


Stopping jabber, correcting these files, and restarting jabber allows internet clients to authenticate to jabber using either the TLD username@domainname.com or the FQDN username@hostname.domainname.com.


This is definitely a bug in OS X Server's jabber configuration settings when jabber:hostsCommaDelimitedString is modified; I've filed a bug report with the solution. See https://discussions.apple.com/thread/4596314?answerId=20567203022#20567203022 for background.

Dec 2, 2013 6:49 PM in response to essandess

I followed all of this on Mavericks Server, but it's not working, even on a fresh install.


I have it like this:


alpha.domain.com

mail.domain.com (alias of alpha)


I can connect OK from lan or web with user@alpha.domain.com, but not with user@mail.domain.com or just the TLD user@domain.com. Even after following all the directions from both posts.


One thing I did see from Mountain Lion is that the string jabber:hosts:_array_index:0 also contains more entries like this:

jabber:hosts:_array_index:0 = "alpha.domain.com"

jabber:hosts:_array_index:1 = "mail.domain.com"


But in Mavericks I only have one string:

jabber:hosts:_array_index:0 = "alpha.domain.com"


and I can't do anything to change or add the other domain.


Maybe this is broken in Mavericks and have to wait to 10.9.1 or try some other workaround or I'm missing something (hopefully!).


Thanks.

Dec 4, 2013 12:56 AM in response to gpco gsx

OK, after a lot of research, here's the solution to my previous answer:


If you want to have multiple domains working on Mavericks Messages Server, follow every step from essandess and then to add more than just one domain for authentication follow this (using Terminal):


1.- Stop the service with:

sudo serveradmin stop jabber


2.- Use this command:

cat - | sudo serveradmin settings


3.- Input the following line(s) and after each one, hit return (in this example I added 1 TLD and 2 FQDN):

jabber:hosts:_array_index:0 = "domain.com"

jabber:hosts:_array_index:1 = "hostname1.domain.com"

jabber:hosts:_array_index:2 = "hostname2.domain.com"


4.- When you're done with your domains, hit Control D to "write" the changes and go back to the prompt


5.- Reboot your server

sudo reboot


6.- After your server restarts, check your settings and they should be now right and with the multiple domains configured:

sudo serveradmin settings jabber

jabber:hostsCommaDelimitedString = "domain.com,hostname1.domain.com,hostname2.domain.com"

jabber:hosts:_array_index:0 = "domain.com"

jabber:hosts:_array_index:1 = "hostname1.domain.com"

jabber:hosts:_array_index:2 = "hostname2.domain.com"


7.- Start Messages Server (doesn't matter if you do it from the GUI or Terminal)


Following this steps, I'm now able to login like this: user@hostname1.domain.com / user@domain.com / user@hostname2.domain.com


This was done using Mavericks 10.9 and Server.app 3.0.1


Thanks for reading!

Dec 5, 2013 6:51 PM in response to gpco gsx

The single serveradmin command


$ sudo serveradmin settings jabber:hostsCommaDelimitedString = "hostname.domainname.com,domainname.com"


should auto-populate jabber:hosts with the correct array information, as well as creating the correct files in the jabberd directory. I'd suggest stopping and starting jabber and issuing this serveradmin setting a few times until the correct jabber:hosts array and jabberd config files are seen.

Dec 28, 2013 11:46 AM in response to essandess

Hi,


I recently installed OSX 10.9 Server on anew Mac mini and configured users successfully. Howwver, I was unable to log into to Messages from the client on my MacbookPro as it keeps asking for my password repeatedly even though the MEssage service was configured and running in the Server app.


I followed the setps in this thread to reset the Jabber service but now I can't start Jabber service either from Terminal or from the Server.app.


Kindly assist.


Thanks.

Dec 28, 2013 7:26 PM in response to koksieboy

koksieboy,


The following fixes the constant request for password, but not the server not starting.


I recently had help from Apple on the same problem. There is a current bug in Server.app where if you have changed the FQDN of the server your Jabber server will not get the updates properly. I was told that they know about it and are working on a fix. A very helpful guy at Apple, all credit to Reece, fixed me with the following (his summary of what we did:


First, we stopped and started the Messages server and looked in the system.log to see what the messages service ( jabberd) thought it realm was. Jabberd believed its realm was server2.local and this was not the fqdn of the server.


The Messages Service was stopped before we started editing files.


We used grep –r server2.local /library/Server/Messages/Config to identify files in the Config directory that contained the wrong hostname (server2.local).


We searched searched each file returned by the grep command to locate instances of “server2.local" and replaced this text with the fqdn of your server.

We made changes to the following files:

/library/Server/Messages/Config/com.apple.messageserver.plist

/library/Server/Messages/Config/jabberd/c2s.xml

/library/Server/Messages/Config/jabberdc2s/xml.bak

/library/Server/Messages/Config/jabberd/router.xml

/library/Server/Messages/Config/jabberd/router.xml.bak


We then removed all the /library/Server/Messages/Config/jabberd.previous.11-20-2013.* files.


The Messages service was then started and you were able to configure a client to use the messages service without being repeatedly asked for a password.


You can move the jabberd.previous files we left on the desktop to the trash. They will be recreated with the correct hostname in them as required. I would also suggest that if you find need to repeat this procedure that you make a back up copy of the /library/Server/Messages/Config before you start editing the config files.

Dec 29, 2013 3:09 AM in response to Erich Wetzel

Hi Erich,


Thanks for your kind response. I recently transitioned to Mac platform from Windows and know little Unix cmds, however I found this error in the log:


"hostname.domain.private" servermgrd[1825]: servermgr_jabber[W]: configuration file not found: "/Library/Server/Messages/Config/jabberd/jabberd.cfg"


and also all I could see in Finder is this:


Library/Server/Messages/Data/sqlite


Is there anyway to recreate the configuration file?


Thanks again.

Jan 10, 2014 6:50 PM in response to koksieboy

Something changed after the last update and this setup no longer works -- authentication to domain.com yields the failure "SASL callback for non-existing host". This causes the behavior of Messages constantly querying you for your account password. jabber is really fragile on OS X Server!


These steps got my server working again, at least for authentication to user@domain.com. Virtual domains do not appear to work, but as we only use the domain and not host.domain.com, this isn't an issue.


First, I performed a factory reset as described above; however, in hindsight this probably isn't necessary, and it wipes out everyone's buddy lists.


Second:


sudo serveradmin settings jabber:hostsCommaDelimitedString = "domain.com"


Third: ensure that these files only have the <id>domain.com</id>


/Library/Server/Messages/Config/jabberd/sm.xml

/Library/Server/Messages/Config/jabberd/c2s.xml # see this thread

# c2s file looks like ... .chain.pem">domain.com</id>


Finally, there should be no files like:


/Library/Server/Messages/Config/jabberd/sm_domain.com.xml # or

/Library/Server/Messages/Config/jabberd/sm_host_domain.com.xml


Messages and other jabber clients should be able to authenticate to user@domain.com.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How To Reset a Broken jabberd/Messages/iChat Service on OS X Server

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.