404 Not Found on Virtual Host

Nothing out of the ordinary:
"GET /librenms/ HTTP/1.1" 404 2567 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_16_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0 .4147.105 Safari/537.36 Edg/84.0.522.52"
I haven’t changed the .htaccess or the Virtual Host setup since it was working. The only thing that has changed is I’ve updated LibreNMS to the version using Laravel 7

So I have had the exact same issue with 404 errors after login when running librenms in a sub directory using a apache virtualhost. Was resolved with your suggested:

cd /opt/librenms
sudo -u librenms php artisan route:clear

However, my customoid pages for for devices still throw 404 errors. Very odd, any ideas why these are handled differently?

Also is it worth including php artisan route:clear in the update script so that others don’t have this issue?

Thanks

I can also confirm that version 1.66-41-g73b7636c9 on a brand new Ubuntu 20.04 build is broken with a subdirectory/uri enabled.

I am also able to get around the bug with,

cd /opt/librenms
sudo -u librenms php artisan route:clear

Any updates on this, is it even being addressed?

With the above command I am able to get the majority of UI to work but things like editing a device do not.

Thanks in advance for any help or info

It looks like a lot - but not all - of the links coming from the AJAX-based template system LibreNMS uses are not using the base URL specified in the configs. Additionally, requests for the dashboard itself are going to the wrong Laravel controller.

I started going down the rabbit hole of why this was, but I don’t work for LibreNMS and ran out of time. I might dig in to this some more this week and see if I can’t figure out why URLs aren’t being generated properly at least.

For the dashboard, like I mentioned above the requests are incorrectly going to LegacyController. LegacyController is completely broken anyway as I mention in that comment, so I may try to just remove all mention of it from the routes to see if that fixes the route cache at least.

1 Like

I’d be interested on updates to this, this broke my setup too. Is there a github issue? I couldn’t find one.

1 Like

Was going to create it but noticed someone already beat me to it.