Problem upgrading old 2.0.7 to latest 2.1.15

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Post Reply
dsglv
Posts: 3
Joined: Mon Jun 05, 2023 2:40 am

Problem upgrading old 2.0.7 to latest 2.1.15

Post by dsglv »

Hi,

I'm no expert on nagios and I'm trying to upgrade (and at the same time migrate) an old 2.0.7 to 2.1.15.

I have new hardware where I have installed 2.1.5, with config snapshots and backups from 2.0.7. The recover script works and shows no errors, but when trying to login on the webui, the user is not accepted. Neither using the "change nagiosadmin password" script does any effect. I can't login to the webpage in any way.

I've tried another approach though: deployed a fresh 2.0.7 install and when it works as expected, upgrade it to 2.1.15. I had no luck with that either.
Similar process as before, recover works as expected, in this case login works so I have access to the webui,but I'm shown two instances at the instances menu (one has the name of the localhost and the second has the name from my backup recovered system).

At this point I would expect to have only the instance from my recovered backup, don't know why the localhost one is still there.

The localhost instance is shown as green while my recovered instance is shown as red, with a garbage bin at the right side and doesn't work (worth mention my license is for 1 instance only). Mounting the snapshot folder and recover it doesn't seem to take any effect as the instance I'm suppose to recover is not the active one.

Has someone faced a problem like this before? Is there maybe a way I can delete the "default" localhost instance and just use the recovered one?
User avatar
swolf
Developer
Posts: 294
Joined: Tue Jun 06, 2017 9:48 am

Re: Problem upgrading old 2.0.7 to latest 2.1.15

Post by swolf »

Hi @dsglv, thanks for reaching out.

EDIT 2: I spoke again with the support team, and would recommend ignoring the rest of this post. You should be able to resolve your issues by restoring to 2.1.15 and running this command in your terminal:

Code: Select all

php /var/www/html/nagioslogserver/www/index.php install/update_usernames
Please let me know whether that works for you, and feel free to ask if you have any further questions or concerns.

------------------------------------------------------------------------------

Unfortunately, upgrading from much older versions of Log Server gets pretty tricky - several of the 2.1.x releases were updating old dependencies and repositories that would be assumed to work in older versions, so if you're updating from something much earlier, Log Server sometimes tries to use those older sources first and then faceplants. I would expect an attempted backup and restore to be more successful.

On your "failed restore to 2.1.15" server, I would run the following query:

Code: Select all

curl 'localhost:9200/nagioslogserver/user/_search?pretty'
If you don't get a hit for nagiosadmin, it just means the account is missing, and you would need to add the record manually. If you do get a hit, but the password doesn't look like a SHA-256 hash, it means there's an issue with the reset_nagiosadmin_password script and we would need to get some information about your environment to reproduce the issue.

If you do get a normal-looking nagiosadmin record, I would be looking in the apache error logs to see if there are other problems that prevent authorization from working.

Hopefully this helps. Let me know how that works, and feel free to ask about any further questions or concerns.

-Sebastian Wolf

EDIT: I spoke with the Support team, and they're saying that direct upgrades from 2.0.7 to 2.1.15 typically don't have issues. I assumed from your post that your process was like:

1. Back up old 2.0.7, no errors.
2. Restore to new 2.0.7, no errors. Logging in works, application continues to work.
3. Upgrade to 2.1.15.
4. Try to log in, fail to do so

Is that accurate, or are you actually seeing an error on step 2?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy
Post Reply