IOCage UniFi 7 HTTP Status 404 – Not Found

ThreeDee

Guru
Joined
Jun 13, 2013
Messages
700
TrueNAS Core v.13.0-U4
Jails are 13.1-RELEASE-p7
I run Plex in one jail (no issues) and UniFi 7 Controller in another separate jail
UniFi controller was running just fine until this very last update I did 2 days ago via "pkg update && pkg upgrade" command in the Unifi 7's jail's shell .. now I get the "HTTP Status 404-Not found" error when trying to access the login page

I've restarted the jail many times and I've even rebooted my server as that has "fixed" issues after updates in the past
I'm not savvy at the command line but can follow directions ok, lol

I did find a thread to force reinstall packages via
pkg upgrade -Ffy
pkg upgrade -fy

..but, didn't help.
Any help appreciated, thanks!

unifi7-7.3.83_2 is current version installed
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I saw the same trying the _2 upgrade... I just rolled back my jail to before the update and was fine again.

I suspect the upgrade of Mongodb was the cause behind the problem and tried locking the v3 okg, but that didn't help.
 
Last edited:
Joined
May 12, 2017
Messages
6
I had the same issue with the _2 upgrade. I noticed the following message at the END of my upgrade. I needed this BEFORE my upgrade, so I restored a snapshot, followed the directions and I now have 7.3.83_2 working.

Code:
Message from unifi7-7.3.83_2:

--
ATTENTION: The mongodb dependency has been changed from 36 to 44, as MongoDB
3.6 is long out out support and end of life.

One of implications is that the instance MUST be restored from backup.

The upgrade path can be as following:

- Take a backup from within the unifi7 application PRIOR to
  updating!

- Stop the unifi7 service (if running)

- Copy the "backup" directory from /usr/local/share/java/unifi/data
  to a safe location. Also copy keystore and system.properties if
  you have made any modifications to those files

- Remove files and directories under /usr/local/share/java/unifi/data

- Upgrade the package

- Copy the "backup" directory from a safe location back to
  /usr/local/share/java/unifi/data

- Start the service

- Restore the configuration from backup

- Review system.properties and keystore to merge any manual
  modifications you have made (this has to be done with
  the application stopped)
root@unifi:~ #
 

ThreeDee

Guru
Joined
Jun 13, 2013
Messages
700
Welp .. I ended up destroying the jail and creating a new one with a fresh install of Unifi 7 and then importing a UniFi back up and now I'm back up and running

I tried restoring from snapshots to no avail :frown:
 

glauco

Guru
Joined
Jan 30, 2017
Messages
526
I had the same issue with the _2 upgrade. I noticed the following message at the END of my upgrade. I needed this BEFORE my upgrade, so I restored a snapshot, followed the directions and I now have 7.3.83_2 working.

Code:
Message from unifi7-7.3.83_2:

--
ATTENTION: The mongodb dependency has been changed from 36 to 44, as MongoDB
3.6 is long out out support and end of life.

One of implications is that the instance MUST be restored from backup.

The upgrade path can be as following:

- Take a backup from within the unifi7 application PRIOR to
  updating!

- Stop the unifi7 service (if running)

- Copy the "backup" directory from /usr/local/share/java/unifi/data
  to a safe location. Also copy keystore and system.properties if
  you have made any modifications to those files

- Remove files and directories under /usr/local/share/java/unifi/data

- Upgrade the package

- Copy the "backup" directory from a safe location back to
  /usr/local/share/java/unifi/data

- Start the service

- Restore the configuration from backup

- Review system.properties and keystore to merge any manual
  modifications you have made (this has to be done with
  the application stopped)
root@unifi:~ #
Hi!
I followed these instructions but I got the 404 Page not found error nonetheless.
This is exactly what I did:
Unifi Controller web UI > Settings > System > Backups Show More > Download > No limit > Download > Save
Code:
iocage stop unifi
iocage snapshot --name just_in_case unifi
iocage console -f unifi
service unifi stop
cd /usr/local/share/java/unifi/data
cp -a backup ../backup
rm -rf *
pkg upgrade -y
cp -a ../backup/ backup/
service unifi start
service unifi status

The service is up but the Unifi Controller web UI is unreachable (error 404).
So I exited back to TrueNAS and:
Code:
iocage stop unifi
iocage rollback --name just_in_case unifi
iocage start unifi

Can you please tell me what you did differently?
Thanks.

EDIT: Actually, it did work!
It just took so long for the 404 error to go away and the web UI to come back up that I assumed the upgrade went wrong!
So, do yourself a favor and be patient. Even if you get that 404 error, try reloading the page after 5 or even 10 minutes (depending on your hardware).
A page will appear that lets you pick one of the backups in the backup directory you have previously copied somewhere safe.
I picked the latest and clicked Restore.
Then the following screen appeared. Again, it took like forever...
1680377493158.png

At some point I ran service unifi status and realized that unifi was not running, so I started it (service unifi start).
After a normal length of time, the usual login page of web UI came back up and everything was back to normal.
 
Last edited:

Amsoil_Jim

Contributor
Joined
Feb 22, 2016
Messages
175
Welp .. I ended up destroying the jail and creating a new one with a fresh install of Unifi 7 and then importing a UniFi back up and now I'm back up and running

I tried restoring from snapshots to no avail :frown:
I tried making a new jail and a fresh install but I'm still getting a HTTP Status 404 error, did you have this problem on the fresh install?
 

Amsoil_Jim

Contributor
Joined
Feb 22, 2016
Messages
175
Ya, that’s what I was asking, I tried making a new jail with a fresh install and I was still getting the 404 error. I had pkg set to latest.
When I tried to access the login page it would give me the unsecure warning and then when I clicked through I would get the 404 page.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Give it some time to come up, I got that right after installation as well.
 
Top