Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQUID 3 to SQUID 4 migration #3584

Closed
AndyX90 opened this issue Jul 18, 2019 · 5 comments
Closed

SQUID 3 to SQUID 4 migration #3584

AndyX90 opened this issue Jul 18, 2019 · 5 comments

Comments

@AndyX90
Copy link
Contributor

AndyX90 commented Jul 18, 2019

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

[x] I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md

[x] I have searched the existing issues and I'm convinced that mine is new.

Describe the bug
After updating from 19.1.10 to 19.7, the Squid service would not automatically start.
The Cache-Clear Button was not enough.
I noticed the following in Access log:

FATAL: certgen -s /var/squid/ssl_crtd -M 8MB helpers are crashing too rapidly, need help!

After that i had to manually do "/usr/local/libexec/squid/security_file_certgen -c -s /var/squid/ssl_crtd -M 8MB".

Initialization SSL db...
Done

Now it works.
To Reproduce
Steps to reproduce the behavior:

  1. Upgrade from 19.1.10 to 19.7 with enabled Webproxy
  2. press the Clear-Cache Button on the Webproxy Support Tab
  3. Notice that Squid will not run.

Expected behavior
After pressing the Clear-Cache Button on the Webproxy Page, it should initialize the db by itself and start properly.

Environment
OPNsense 19.7 (amd64, OpenSSL).
Intel® Xeon™ E3-1225V5 3.3Ghz Quad Core
Network Intel® I210-AT
(DEC-4630)

@AdSchellevis
Copy link
Member

What happens if you remove /var/squid/ssl_crtd now and restart?
The odd thing is, when it's not there the usual startup should create it

# create ssl certificate store, in case sslbump is enabled we need this
if [ ! -d /var/squid/ssl_crtd ]; then
/usr/local/libexec/squid/ssl_crtd -c -s /var/squid/ssl_crtd > /dev/null 2>&1
chown -R squid:squid /var/squid/ssl_crtd
chmod -R 750 /var/squid/ssl_crtd
if [ -f /usr/local/etc/squid/ca.pem.id ]; then
cat /usr/local/etc/squid/ca.pem.id > /var/squid/ssl_crtd.id
fi
fi

Our reset just flushes all, and expects the setup to re-create it, which in some cases doesn't seem to work.

[reset]
command:
/usr/bin/killall -9 squid;
rm /var/run/squid/squid.pid;
rm -rf /var/squid/*;
/usr/local/opnsense/scripts/proxy/setup.sh;
/usr/local/sbin/pluginctl webproxy start;
/usr/local/etc/rc.d/squid start
parameters:
type:script
message:reset and restart proxy

If the original setup.sh has an issue in your setup, that might explain something, otherwise it seems very difficult to reproduce this consistently.

@AndyX90
Copy link
Contributor Author

AndyX90 commented Jul 18, 2019

Okay,iIf I remove the Directory and restart Squid:

Jul 18 13:34:53 | (squid-1): FATAL: Received Segment Violation...dying.
Jul 18 13:34:53 | (squid-1): FATAL: The /usr/local/libexec/squid/security_file_certgen -s /var/squid/ssl_crtd -M 8MB helpers are crashing too rapidly, need help!

After pressing the Reset-Button in Webproxy:

Cache-Log:

(security_file_certgen): Uninitialized | SSL certificate database directory: /var/squid/ssl_crtd. To initialize, run "security_file_certgen -c -s /var/squid/ssl_crtd".

Access-Log:

Jul 18 13:37:42 | (squid-1): FATAL: Failed to verify one of the swap directories, Check cache.log for details. Run 'squid -z' to create swap directories if needed, or if running Squid for the first time.
Jul 18 13:37:40 | (squid-1): FATAL: Failed to verify one of the swap directories, Check cache.log for details. Run 'squid -z' to create swap directories if needed, or if running Squid for the first time.
Jul 18 13:37:39 | (squid-1): FATAL: Failed to verify one of the swap directories, Check cache.log for details. Run 'squid -z' to create swap directories if needed, or if running Squid for the first time.
Jul 18 13:37:38 | (squid-1): FATAL: Failed to verify one of the swap directories, Check cache.log for details. Run 'squid -z' to create swap directories if needed, or if running Squid for the first time.
Jul 18 13:37:36 | (squid-1): FATAL: Failed to verify one of the swap directories, Check cache.log for details. Run 'squid -z' to create swap directories if needed, or if running Squid for the first time.

@AdSchellevis
Copy link
Member

it looks like we missed a rename here 981a718

ssl_crtd vs security_file_certgen

fichtner pushed a commit that referenced this issue Jul 18, 2019
@AndyX90
Copy link
Contributor Author

AndyX90 commented Jul 18, 2019

It works, thanks!

@AndyX90 AndyX90 closed this as completed Jul 18, 2019
@AdSchellevis
Copy link
Member

@AndyX90 thanks for testing and letting us know!

EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
EugenMayer pushed a commit to KontextWork/opnsense_core that referenced this issue Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants