Need help upgrading from old apt-get version in Ubuntu 16.04 LTS

I'm attempting to upgrade ejabberd installed via apt-get in Ubuntu 16.04 LTS to the latest version, but I'm not having any luck. I've already screwed up two VM instances and had to revert to backups.

As people probably know, the default Ubuntu repositories do not have the latest version of ejabberd; it currently has 16.01. However, the latest ejabberd version is 17.04.

What is the proper way to perform the upgrade to 17.04?

I tried using the binary installer originally but could never get it to work, so I went with the apt-get installation. I've also tried upgrading using the repositories from jabber.at, but that just results in a corrupted installation. I can go into more details about the errors, but I think it's better to just follow a recommended upgrade process, whatever that may be.

p.s., I have very limited experience with linux (decades of Windows usage/admin/development, but hardly any linux experience), so my troubleshooting capabilities are limited.

Thanks.

> I tried using the binary

> I tried using the binary installer originally but could never get it to work

Those installers include most of the requirements, and Ubuntu 16 is recent enough, how can be it didn't work?

I'm not saying the installers

I'm not saying the installers don't work; I'm saying that I couldn't get ejabberd to work after using them. I was able to get the apt-get installed version working by looking at instructions provided by people online, but did not have success with the binary installed version.

Anyway, can the apt-get installed version be upgraded using the binary installer? If so, what is the correct process? For example, apt-get remove, run binary installer, and then "migrate" settings from apt-get installation to binary installation? Or create a new clean vm and run binary installer, then "migrate" settings from apt-get installed VM to binary installed VM? Or ???

Thanks.

Whatever ejabberd version you

Whatever ejabberd version you have, or how you installed, it can be upgraded by:
1. Copy your config files, and the mnesia spool dir.
2. Uninstall the old deployment
3. Install the new version, whatever new way it has
4. Check it starts correctly with default configuration and empty database
5. Stop ejabberd
6. Copy the configuration files and mnesia spool dir from old installation
7. Try to start ejabberd again.
8. Check the log files for warnings or errors

Thanks. 1. OK 2. OK 3. Using

Thanks.

1. OK
2. OK
3. Using repositories from jabber.at
sudo apt-get install ejabberd

Fails:

Job for ejabberd.service failed because the control process exited with error code. See "systemctl status ejabberd.service" and "journalctl -xe" for details.
invoke-rc.d: initscript ejabberd, action "restart" failed.
? ejabberd.service - A distributed, fault-tolerant Jabber/XMPP server
   Loaded: loaded (/lib/systemd/system/ejabberd.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Fri 2017-06-02 18:05:31 UTC; 6ms ago
  Process: 3017 ExecStart=/bin/sh -c /usr/sbin/ejabberdctl start && /usr/sbin/ejabberdctl started (code=exited, status=1/FAILURE)
Main PID: 1244 (code=killed, signal=TERM)

Jun 02 18:05:31 xmpp1 systemd[1]: ejabberd.service: Control process exited,...=1
Jun 02 18:05:31 xmpp1 systemd[1]: Failed to start A distributed, fault-tole...r.
Jun 02 18:05:31 xmpp1 systemd[1]: ejabberd.service: Unit entered failed state.
Jun 02 18:05:31 xmpp1 systemd[1]: ejabberd.service: Failed with result 'exi...'.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package ejabberd (--configure):
subprocess installed post-installation script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)

Crash dump shows:

=erl_crash_dump:0.3
Fri Jun  2 18:05:29 2017
Slogan: init terminating in do_boot ()
System version: Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false]

So I ran: apt-get remove ejabberd

3. Trying again using .deb file from downloads page (https://www.process-one.net/en/ejabberd/downloads/)
sudo gdebi ejabberd_17.04-0_amd64.deb

Fails:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading state information... Done
This package is uninstallable
Breaks existing package 'erlang-p1-iconv' conflict: ejabberd (< 1:16.02)

3. Trying again using .run file from downloads page (https://www.process-one.net/en/ejabberd/downloads/)
OK

4. OK
5. OK
6. OK, I think...
7. won't start when using shortcut on desktop
error.html page loads
8. Nothing was written to the logs

Trying to use bin/start script from a terminal instead just keeps repeating the error:
bash: /home/ubuntu/ejabberd-17.04/lib/linux-x86_64/libtinfo.so.5: no version information available (required by bash)

I set loglevel: 5 and tried the shortcut again. I got a crash dump this time:

=erl_crash_dump:0.3
Fri Jun  2 19:43:57 2017
Slogan: Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{k
System version: Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

I don't know where the problem is, so I don't really know what to do now... Any insight would be extremely helpful.

Thanks.

What a troubled installation,

What a troubled installation, I had bet that a least one way would have worked!

Regardless of what method you try, ensure no other ejabberd is running (kill any process called beam, or epmd), and check also a previous version isn't installed (it seems you already take care of this). You can try to install one of those versions in another machine (in your desktop, or development machine) just to see how it should work.

I didn't know what to do, so

I didn't know what to do, so I ran the uninstall for ejabberd 17.04 and then deleted the database and conf files.

I ran the install for ejabberd 17.04 again and checked that it was running in the default configuration.

I then went through all the ejabberd.yml changes and testing them one at a time to make sure the service would still start (modify, save, ejabberdctl restart, repeat...).

Then I stopped ejabberd and made a backup of the database directory.
I deleted all the files in database/ejabberd@localhost and copied the database files from my initial installation.

It started this time and users were able to login successfully.

I'm not sure why it failed before.

However, now the ejabberd admin page (localhost:5280/admin/) won't load anymore...

In lieu of that, I tried to setup ejabberd to run as a service but that won't work either...

I copied over the ejabberd.init to /etc/init.d/ejabberd
I created the ejabberd system user
I gave it write access to database and logs (didn't work so I gave it rwx to everything in the ejabberd-17.04 folder)

sudo /etc/init.d/ejabberd start
Starting ejabberd...
This command can only be run by root or the user ubuntu

I just ran it as root using sudo... I tried sudo -i first and really ran it as "root", but it said the same thing.

fyi, ubuntu is the name of the main user account on the VM which was used to install ejabberd

USER=ejabberd in the script, so I don't know why it's asking for the user ubuntu and I don't know why it won't start for root either.

So I can't administer ejabberd and it won't run when the VM starts up, but it's got 17.04 installed now... I don't know that I can call that a success...

Syndicate content