Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    [squid] Template not found

    Scheduled Pinned Locked Moved Cache/Proxy
    12 Posts 2 Posters 3.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Stewart
      last edited by

      I have a new install here,

      2.2.5-RELEASE (amd64)
      built on Wed Nov 04 15:49:37 CST 2015
      FreeBSD 10.1-RELEASE-p24

      squid3 Services 0.4.3 High performance web proxy cache (3.4 branch). It combines Squid as a proxy server with its capabilities of acting as a HTTP / HTTPS reverse proxy.  It includes an Exchange-Web-Access (OWA) Assistant, SSL filtering and antivirus integration via C-ICAP.  WARNING! This package bundles ClamAV that conflicts with 'Dansguardian', 'Mailscanner' and 'HAVP antivirus' packages! Installing these will result in a broken state.
      squidGuard Network Management 1.9.17 High performance web proxy URL filter.  Works with both Squid (2.7 legacy branch) and Squid3 (3.4 branch) packages.

      Things appear to be working normally but I'd like resolve these messages in the log.  It keeps saying that it can't generate the files, that it's missing the Template.  Those files exist so I'm assuming that's why it's running fine.  What can I do about them?

      Nov 17 09:55:05 	php-fpm[8551]: /rc.start_packages: [squid] Template not found; could not generate '/usr/pbi/squid-amd64/local/etc/c-icap/squidclamav.conf' file!
      Nov 17 09:55:05 	php-fpm[8551]: /rc.start_packages: [squid] Template not found; could not generate '/usr/pbi/squid-amd64/local/etc/c-icap/c-icap.conf' file!
      Nov 17 09:55:05 	php-fpm[8551]: /rc.start_packages: [squid] Template not found; could not save '/usr/pbi/squid-amd64/local/etc/c-icap/c-icap.magic' file!
      Nov 17 09:55:05 	php-fpm[8551]: /rc.start_packages: [squid] Template not found; could not generate '/usr/pbi/squid-amd64/local/etc/freshclam.conf' file!
      Nov 17 09:55:05 	php-fpm[8551]: /rc.start_packages: [squid] Template not found; could not generate '/usr/pbi/squid-amd64/local/etc/clamd.conf' file!
      Nov 17 09:55:05 	php-fpm[8551]: /rc.start_packages: [squid] Adding freshclam cronjob.
      Nov 17 09:55:05 	php-fpm[8551]: /rc.start_packages: Checked cron job for /usr/pbi/squid-amd64/bin/freshclam --config-file=/usr/pbi/squid-amd64/etc/freshclam.conf, no change needed
      
      1 Reply Last reply Reply Quote 0
      • D
        doktornotor Banned
        last edited by

        Your Squid install is broken. Remove, retry.

        1 Reply Last reply Reply Quote 0
        • S
          Stewart
          last edited by

          @doktornotor:

          Your Squid install is broken. Remove, retry.

          Really?  Squid appears to be working fine.  The errors only seem to indicate a Template file is missing.  Would you, by chance, know what file that is?  I'd like to try and replace it rather than reinstall if at all possible.

          1 Reply Last reply Reply Quote 0
          • D
            doktornotor Banned
            last edited by

            Your install did not work properly. Won't explain, read the code.

            https://github.com/pfsense/pfsense-packages/blob/master/config/squid3/34/squid_antivirus.inc#L442 - the install part
            https://github.com/pfsense/pfsense-packages/blob/master/config/squid3/34/squid_antivirus.inc#L329 - the configuration part done when you save AV settings.

            @Stewart:

            Would you, by chance, know what file that is?

            Not really sure what you mean. You clearly have logged what files those are. You can run this from Diagnostics - Command prompt - PHP Execute

            
            require("/usr/local/pkg/squid.inc");
            squid_antivirus_install_config_files();
            
            

            and see if it helps.

            1 Reply Last reply Reply Quote 0
            • S
              Stewart
              last edited by

              The file I'm referring to is the Template.  It is saying it can't generate the .conf files because the Template is missing.  That's OK because the conf files were created at some point and exist where they belong.  What seems to be missing, from what I can gather from the errors, is the template file(s).

              1 Reply Last reply Reply Quote 0
              • D
                doktornotor Banned
                last edited by

                I have already explained how to fix this. You do NOT fix this crap manually. And no, that's not OK, it means the install did not run completely (most likely you did click away from the package installer before it completed or it simply died for some reason) and the template files have NEVER been created. The conf files shipped with the PBI are NOT usable, that's the whole point of those hundreds of lines of code in there.

                And - all of this is explained in the code: https://github.com/pfsense/pfsense-packages/blob/master/config/squid3/34/squid_antivirus.inc#L241 - so, pardon me but don't expect me to rewrite the things here.

                1 Reply Last reply Reply Quote 0
                • S
                  Stewart
                  last edited by

                  I'm not sure why you seem so angry.  I'm not trying to upset you, I was just asking if I could replace the Template files rather than reinstall the whole thing.  I read your links and all I can tell is that it's looking for the name.conf.pfsense file.  I can see where it is called and checked and I can see where the files are created.  I'll reinstall, but I really am sorry if my asking questions upsets you so much.  If I still have problems after a reinstall I'll post back in here.  I hope that doesn't offend you.

                  Are the .conf files there by default?  My .conf files have a timestamp of yesterday, but the .sample and .default files have timestamps of Feb 9 (except for the squidclamav.conf.sample file which is last July 31).

                  1 Reply Last reply Reply Quote 0
                  • D
                    doktornotor Banned
                    last edited by

                    No, you could NOT replace those manually. THEY ARE GENERATED ON INSTALL BY THE PACKAGE.

                    Read the links above. The files used are these:

                    
                    $ ls -la /usr/pbi/squid-*/local/etc/*.pfsense
                    -rw-r--r--  1 root  wheel  18787 Nov 15 09:51 /usr/pbi/squid-amd64/local/etc/clamd.conf.pfsense
                    -rw-r--r--  1 root  wheel   8542 Nov 15 09:51 /usr/pbi/squid-amd64/local/etc/freshclam.conf.pfsense
                    $ ls -la /usr/pbi/squid-*/local/etc/c-icap/*.pfsense
                    -rw-r--r--  1 root  wheel  19773 Nov 15 09:51 /usr/pbi/squid-amd64/local/etc/c-icap/c-icap.conf.pfsense
                    -rw-r--r--  1 root  wheel   3289 Nov  7 02:02 /usr/pbi/squid-amd64/local/etc/c-icap/c-icap.magic.pfsense
                    -rw-r--r--  1 root  wheel   2652 Nov 15 09:51 /usr/pbi/squid-amd64/local/etc/c-icap/squidclamav.conf.pfsense
                    
                    

                    Again:  THEY ARE GENERATED ON INSTALL BY THE PACKAGE. Without them, AV cannot be configured.

                    Beyond that, you got no less that TWO easy ways to fix it. What are you trying to invent here?! FFS really

                    1 Reply Last reply Reply Quote 0
                    • S
                      Stewart
                      last edited by

                      You really seem all over the place here with your anger and it's really confusing me.  I said I was going to uninstall/reinstall and let you know how it worked out.  I then wondered when files got created and explained that my .conf files have dates from yesterday.  According to the links you sent me, those are the files that the AV works off of so something created and is updating the files.  If they are there by default then something is updating them.

                      My questions were to ascertain whether it was a bad install (in which case I would imagine it never would have worked) or if something damaged it and removed those files.  If it's the former, I would think it never would have worked.  If it's the later, I would try to track it down.

                      I appreciate how you showed me the names of the files and where they would be if they existed on my system.  That's very helpful.

                      And, not to set you off here, but you said you have shown me 2 ways to fix the problem.  I did an uninstall and reinstall and the .pfsense files aren't there.  What was the second option?

                      
                      require("/usr/local/pkg/squid.inc");
                      squid_antivirus_install_config_files();
                      
                      ```just gives me a blank box.  No results are shown.
                      
                      

                      [2.2.5-RELEASE][root@GateKeeper.localdomain]/usr/pbi/squid-amd64/local/etc: ls -lah
                      total 192
                      drwxr-xr-x  10 root  wheel  512B Nov 17 15:50 .
                      drwxr-xr-x  12 root  wheel  512B Feb  9  2015 ..
                      drwxr-xr-x  2 root  wheel  512B Feb  9  2015 bash_completion.d
                      drwxr-xr-x  2 root  wheel  1.0K Nov 17 15:50 c-icap
                      -rw-r--r--  1 root  wheel    18K Nov 17 15:50 clamd.conf
                      -rw-r--r--  1 root  wheel    18K Nov 17 15:50 clamd.conf.default
                      -rw-r--r--  1 root  wheel    18K Feb  9  2015 clamd.conf.sample
                      -rw-r--r--  1 root  wheel  8.4K Nov 17 15:50 freshclam.conf
                      -rw-r--r--  1 root  wheel  8.4K Nov 17 15:50 freshclam.conf.default
                      -rw-r--r--  1 root  wheel  8.4K Feb  9  2015 freshclam.conf.sample
                      drwxr-xr-x  2 root  wheel  512B Feb  9  2015 man.d
                      drwxr-xr-x  2 root  wheel  512B Feb  9  2015 openldap
                      drwxr-xr-x  5 root  wheel  512B Feb  9  2015 periodic
                      -rw-r--r--  1 root  wheel    96B Feb  9  2015 perl5_version
                      -rw-r--r--  1 root  wheel  1.8K Feb  9  2015 pkg.conf.sample
                      drwxr-xr-x  2 root  wheel  512B Feb  9  2015 rc.d
                      -rw-r-----  1 60    mail    16K Feb  9  2015 sasldb2.db
                      drwxr-xr-x  4 proxy  proxy  512B Feb  9  2015 squid
                      drwxr-xr-x  2 root  wheel  512B Feb  9  2015 ssl

                      and
                      

                      [2.2.5-RELEASE][root@GateKeeper.localdomain]/usr/pbi/squid-amd64/local/etc/c-icap: ls -lah
                      total 164
                      drwxr-xr-x  2 root  wheel  1.0K Nov 17 15:50 .
                      drwxr-xr-x  10 root  wheel  512B Nov 17 15:50 ..
                      -rwxr-xr-x  1 root  wheel    19K Nov 17 15:50 c-icap.conf
                      -rw-r--r--  1 root  wheel    19K Nov 17 15:50 c-icap.conf.default
                      -rwxr-xr-x  1 root  wheel    19K Feb  9  2015 c-icap.conf.sample
                      -rwxr-xr-x  1 root  wheel  3.2K Nov 17 15:50 c-icap.magic
                      -rw-r--r--  1 root  wheel  3.2K Nov 17 15:50 c-icap.magic.default
                      -rwxr-xr-x  1 root  wheel  3.2K Feb  9  2015 c-icap.magic.sample
                      -rwxr-xr-x  1 root  wheel  4.0K Feb  9  2015 clamav_mod.conf
                      -rwxr-xr-x  1 root  wheel  4.0K Feb  9  2015 clamav_mod.conf.default
                      -rwxr-xr-x  1 root  wheel  1.4K Feb  9  2015 clamd_mod.conf
                      -rwxr-xr-x  1 root  wheel  1.4K Feb  9  2015 clamd_mod.conf.default
                      -rw-r--r--  1 root  wheel  2.6K Nov 17 15:50 squidclamav.conf
                      -rw-r--r--  1 root  wheel  2.6K Feb  9  2015 squidclamav.conf.default
                      -rwxr-xr-x  1 root  wheel  5.2K Feb  9  2015 srv_url_check.conf
                      -rwxr-xr-x  1 root  wheel  5.2K Feb  9  2015 srv_url_check.conf.default
                      -rwxr-xr-x  1 root  wheel  7.1K Feb  9  2015 virus_scan.conf
                      -rwxr-xr-x  1 root  wheel  7.1K Feb  9  2015 virus_scan.conf.default

                      
                      And I stayed on the Package Install page the entire time.  Here was the output:
                      

                      Beginning package installation for squid3 .
                      Downloading package configuration file... done.
                      Saving updated package information... done.
                      Downloading squid3 and its dependencies...
                      Checking for package installation...
                      Downloading https://files.pfsense.org/packages/10/All/squid-3.4.10_2-amd64.pbi ...  (extracting)
                      Loading package configuration... done.
                      Configuring package components...
                      Loading package configuration... done.
                      Additional files... done.
                      Loading package instructions...
                      Custom commands...
                      Executing custom_php_install_command()...done.
                      Executing custom_php_resync_config_command()...done.
                      Menu items... done.
                      Integrated Tab items... done.
                      Services... done.
                      Writing configuration... done.

                      Installation completed.
                      squid3 setup instructions:
                      Please visit Services - Squid Proxy Server menu to configure the package and enable the proxy.

                      1 Reply Last reply Reply Quote 0
                      • D
                        doktornotor Banned
                        last edited by

                        @Stewart:

                        If they are there by default then something is updating them.

                        Read this:

                        https://github.com/pfsense/pfsense-packages/blob/master/config/squid3/34/squid_antivirus.inc#L241

                        No, I won't copy and paste it here for you because it's explained there is no less that 3 paragraphs of text. I won't read if for you either. And I won't link it for the third time either.

                        Enough time wasted here. Remove and reinstall the package. End of story.

                        1 Reply Last reply Reply Quote 0
                        • S
                          Stewart
                          last edited by

                          Your link says:

                          <file>.conf is always (re)generated from the <file>.conf.pfsense on package resync</file></file>

                          so the .pfsense files must have existed at some point to generate the files.  It also infers that the files are updated by the .pfsense files, but that can't be because it says they don't exist.

                          Enough time wasted here. Remove and reinstall the package. End of story.

                          Hmmm…. Maybe I wasn't clear enough when I said

                          I did an uninstall and reinstall and the .pfsense files aren't there.

                          If that isn't clear enough, I'm saying that I did remove/reinstall the package.  In fact I did it today just before I made my last post.  You can see the timestamp of the files at Nov 17 15:50.

                          I don't understand why you are being so condescending to me.  First you're angry because I'm trying to understand the process.  Then you're upset because I didn't just shut up and do what you said.  Now I don't even know.  It's like you ignored my last post about actually removing and reinstalling the package and all of my supporting entries to show what happened.  Are you suggesting I just keep removing/reinstalling until it works?  If it didn't work right the first time or second time, do I need to do it a third time?  A fourth?  How many times?

                          Enough time wasted here.

                          Well, I'm sorry you feel like you've wasted your time.  If you can't at least treat me with a smidgen of respect then you should just move along.  Me?  I'll still be here because I'm trying to get it working.

                          1 Reply Last reply Reply Quote 0
                          • D
                            doktornotor Banned
                            last edited by

                            You have the code and process linked in this post, yet you go again and again and again, instead of reading it.

                            Other than that - it works for everyone else. Perhaps call ghostbusters. (The install of course gets logged to the same place where you grabbed the "template not found" stuff.)

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post
                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.