OPNsense Forum

Archive => 20.1 Legacy Series => Topic started by: tomaz on April 03, 2020, 09:57:00 pm

Title: Where can I get diag_logs_template.inc
Post by: tomaz on April 03, 2020, 09:57:00 pm
Where can I get file diag_logs_template.inc

it seems it is still needed by HAProxy plugin.

When I click on "Log File" I got:

Warning: require_once(diag_logs_template.inc): failed to open stream: No such file or directory in /usr/local/www/diag_logs_haproxy.php on line 6 Fatal error: require_once(): Failed opening required 'diag_logs_template.inc' (include_path='/usr/local/etc/inc:/usr/local/www:/usr/local/opnsense/mvc:/usr/local/opnsense/contrib:/usr/local/share/pear:/usr/local/share') in /usr/local/www/diag_logs_haproxy.php on line 6

I have version 20.1.3
In 20.1.2 release is line: system: drop unused services.inc and diag_logs_template.inc

T.
Title: Re: Where can I get diag_logs_template.inc
Post by: fabian on April 04, 2020, 08:45:03 am
Don't try to get that. If your HAProxy is up to date, please create a bug ticket in the plugins repository as that would mean that the log viewer in that plugin needs an update.

If you really need it you need to check out a previous version of core in git and then copy it to /usr/local/www.
Title: Re: Where can I get diag_logs_template.inc
Post by: tomaz on April 04, 2020, 08:13:20 pm
Thanks fabian, I have found file and also reported bug.
Title: Re: Where can I get diag_logs_template.inc
Post by: franco on April 05, 2020, 12:15:54 pm
It's unlikely this was overlooked, the plugin code must be out of sync for one reason or another (19.7 plugin code on 20.1)

And please help us to keep track of discussions by adding the bug references here...

https://github.com/opnsense/plugins/issues/1764


Cheers,
Franco
Title: Re: Where can I get diag_logs_template.inc
Post by: tomaz on April 05, 2020, 07:47:36 pm
On dashboard I see it is 2.20:

os-haproxy (installed)   2.20      459KiB


If I press update: There are no updates available on the selected mirror.
Title: Re: Where can I get diag_logs_template.inc
Post by: franco on April 06, 2020, 12:06:57 pm
Can you show a screenshot please and also do a firmware health check. The file referencing the include doesn't exist on 2.20 and shouldn't be in the menu.

The link that *must* work is https://your.firewall/ui/diagnostics/log/core/haproxy


Cheers,
Franco
Title: Re: Where can I get diag_logs_template.inc
Post by: tomaz on April 08, 2020, 12:44:01 am
I don't know which screenshot you requested?

Health check reported this:

***GOT REQUEST TO AUDIT HEALTH***
>>> Check installed kernel version
Version 20.1.2 is correct.
>>> Check for missing or altered kernel files
No problems detected.
>>> Check installed base version
Version 20.1.2 is correct.
>>> Check for missing or altered base files
No problems detected.
>>> Check for and install missing package dependencies
Checking all packages: .......... done
>>> Check for missing or altered package files
Checking all packages:
acme.sh-2.8.5_2: missing file /var/db/acme/.acme.sh/account.conf.sample
acme.sh-2.8.5_2: missing file /var/db/acme/.acme.sh/deploy
acme.sh-2.8.5_2: missing file /var/db/acme/.acme.sh/dnsapi
acme.sh-2.8.5_2: missing file /var/db/acme/.acme.sh/notify
Checking all packages............. done
>>> Check for core packages consistency
Checking core packages: ..................................................................... done
***DONE***

As I wrote here, for now I have found solution how to show haproxy log: https://github.com/opnsense/plugins/issues/1764#issuecomment-610065243
Just for test I have temporary renamed diag_logs_template.inc (which I dll manually from github from version 19.7) so when I go to Services->HAProxy->Log File I get error:
Warning: require_once(diag_logs_template.inc): failed to open stream ...

but if I use your URL (/ui/diagnostics/log/core/haproxy) the log shows normally even if I don't have diag_logs_template.inc :)

T.
Title: Re: Where can I get diag_logs_template.inc
Post by: franco on April 08, 2020, 01:59:44 pm
What happens when you run this from the console?

# opnsense-revert opnsense

IMO the menu should point to the /ui link, not to the .php file (which no longer exists).


Cheers,
Franco
Title: Re: Where can I get diag_logs_template.inc
Post by: tomaz on April 08, 2020, 04:58:02 pm
root@firewall:~ # opnsense-revert opnsense
Updating OPNsense repository catalogue...
OPNsense repository is up to date.
All repositories are up to date.
The following packages will be fetched:

New packages to be FETCHED:
        opnsense-20.1.3 (4 MiB: 100.00% of the 4 MiB to download)

Number of packages to be fetched: 1

The process will require 4 MiB more space.
4 MiB to be downloaded.
Fetching opnsense-20.1.3.txz: 100%    4 MiB   4.0MB/s    00:01
opnsense-20.1.3: already unlocked
Updating OPNsense repository catalogue...
OPNsense repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
        opnsense-20.1.3

Number of packages to be reinstalled: 1
[1/1] Reinstalling opnsense-20.1.3...
[1/1] Extracting opnsense-20.1.3: 100%
Stopping configd...done
Resetting root shell
Updating /etc/shells
Unhooking from /etc/rc
Unhooking from /etc/rc.shutdown
Updating /etc/shells
Registering root shell
Hooking into /etc/rc
Hooking into /etc/rc.shutdown
Starting configd.
Keep version OPNsense\CaptivePortal\CaptivePortal (1.0.0)
Keep version OPNsense\Cron\Cron (1.0.1)
*** OPNsense\Diagnostics\Netflow Migration failed, check log for details
Keep version OPNsense\IDS\IDS (1.0.3)
Keep version OPNsense\Proxy\Proxy (1.0.3)
Keep version OPNsense\TrafficShaper\TrafficShaper (1.0.3)
Keep version OPNsense\HAProxy\HAProxy (2.8.0)
Keep version OPNsense\ClamAV\Url (0.0.1)
Keep version OPNsense\ClamAV\General (1.0.0)
Keep version OPNsense\CICAP\General (1.0.1)
Keep version OPNsense\CICAP\Antivirus (1.0.0)
Migrated OPNsense\Routes\Route from  <unversioned>  to 1.0.0
Keep version OPNsense\Backup\NextcloudSettings (1.0.0)
Keep version OPNsense\Firewall\Alias (1.0.0)
Keep version OPNsense\Monit\Monit (1.0.8)
Keep version OPNsense\AcmeClient\AcmeClient (1.6.0)
Keep version OPNsense\FtpProxy\FtpProxy (1.0.0)
Keep version OPNsense\OpenVPN\Export (0.0.1)
Keep version OPNsense\Syslog\Syslog (1.0.0)
Keep version OPNsense\IPsec\IPsec (0.0.0)
Migrated OPNsense\Interfaces\VxLan from 0.0.0 to 1.0.1
Migrated OPNsense\Interfaces\Loopback from 0.0.0 to 1.0.0
Writing firmware setting...done.
Writing trust files...done.
Configuring login behaviour...done.
Configuring system logging...done.
=====
Message from opnsense-20.1.3:

--
Chirp, chirp

and when I go: Services->HAProxy->Log still receive error (url goes to /diag_logs_haproxy.php):
Warning: require_once(diag_logs_template.inc): failed to open stream: No such file or directory in /usr/local/www/diag_logs_haproxy.php on line 6 Fatal error: require_once(): Failed opening required 'diag_logs_template.inc' (include_path='/usr/local/etc/inc:/usr/local/www:/usr/local/opnsense/mvc:/usr/local/opnsense/contrib:/usr/local/share/pear:/usr/local/share') in /usr/local/www/diag_logs_haproxy.php on line 6


Title: Re: Where can I get diag_logs_template.inc
Post by: fabian on April 08, 2020, 08:41:03 pm
@Franco: Maybe a faulty Block device (R/O flash memory)?
Title: Re: Where can I get diag_logs_template.inc
Post by: tomaz on April 08, 2020, 10:27:43 pm
It is virtual machine on ESXi, so I don't know.

But now we can finish/close this problem.
I have just upgraded to 20.1.4 and now HAporoxy(v2.21)-Logs are working. Link is to /ui/diagnostics/log/core/haproxy.

Thanks.
Regards.