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

Connection reset by peer on respmod_copy.py #31

Open
scardine opened this issue Mar 12, 2018 · 7 comments
Open

Connection reset by peer on respmod_copy.py #31

scardine opened this issue Mar 12, 2018 · 7 comments

Comments

@scardine
Copy link

I'm trying respmod_copy.py and getting this:

127.0.0.1 - - [12/Mar/2018 17:47:42] "RESPMOD icap://127.0.0.1:13440/example ICAP/1.0" 200 -
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 52708)
Traceback (most recent call last):
  File "/usr/lib64/python2.7/SocketServer.py", line 593, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib64/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib64/python2.7/SocketServer.py", line 649, in __init__
    self.handle()
  File "/usr/lib/python2.7/site-packages/pyicap.py", line 442, in handle
    self.handle_one_request()
  File "/usr/lib/python2.7/site-packages/pyicap.py", line 476, in handle_one_request
    self.raw_requestline = self.rfile.readline(65537)
  File "/usr/lib64/python2.7/socket.py", line 476, in readline
    data = self._sock.recv(self._rbufsize)
error: [Errno 104] Connection reset by peer
----------------------------------------
127.0.0.1 - - [12/Mar/2018 17:47:54] "RESPMOD icap://127.0.0.1:13440/example ICAP/1.0" 200 -

Environment information:

$ python --version
Python 2.7.5

$ squid -v
Squid Cache: Version 3.5.20
Service Name: squid
configure options:  '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-strict-error-checking' '--exec_prefix=/usr' '--libexecdir=/usr/lib64/squid' '--localstatedir=/var' '--datadir=/usr/share/squid' '--sysconfdir=/etc/squid' '--with-logdir=$(localstatedir)/log/squid' '--with-pidfile=$(localstatedir)/run/squid.pid' '--disable-dependency-tracking' '--enable-eui' '--enable-follow-x-forwarded-for' '--enable-auth' '--enable-auth-basic=DB,LDAP,MSNT-multi-domain,NCSA,NIS,PAM,POP3,RADIUS,SASL,SMB,SMB_LM,getpwnam' '--enable-auth-ntlm=smb_lm,fake' '--enable-auth-digest=file,LDAP,eDirectory' '--enable-auth-negotiate=kerberos' '--enable-external-acl-helpers=file_userip,LDAP_group,time_quota,session,unix_group,wbinfo_group' '--enable-cache-digests' '--enable-cachemgr-hostname=localhost' '--enable-delay-pools' '--enable-epoll' '--enable-ident-lookups' '--enable-linux-netfilter' '--enable-removal-policies=heap,lru' '--enable-snmp' '--enable-ssl-crtd' '--enable-storeio=aufs,diskd,rock,ufs' '--enable-wccpv2' '--enable-esi' '--enable-ecap' '--with-aio' '--with-default-user=squid' '--with-dl' '--with-openssl' '--with-pthreads' '--disable-arch-native' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -fpie' 'LDFLAGS=-Wl,-z,relro  -pie -Wl,-z,relro -Wl,-z,now' 'CXXFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -fpie' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

$ lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.4.1708 (Core)
Release:        7.4.1708
Codename:       Core

Configuration:

icap_enable on

icap_service service_resp respmod_precache bypass=0 icap://127.0.0.1:13440/example
adaptation_access service_resp allow SSL_ports

My goal is to change resource URLs from http to https in the response body.

@LeonardoNve
Copy link

I have the same problem.

My squid version is 4.4

Config:
icap_enable on
icap_service my_service respmod_precache icap://127.0.0.1:13440/example
adaptation_access my_service allow all

@hazelement
Copy link
Contributor

I'm having the same issue...

@LeonardoNve
Copy link

Same issue

@davegermiquet
Copy link

davegermiquet commented Mar 2, 2020

This should be a good example, with squid configuration:

https://github.com/davegermiquet/icap_server_v2

Most web sites are working however I'm having problems with 2 factor on www.fastmail.com

@davegermiquet
Copy link

I have the same problem.

My squid version is 4.4

Config:
icap_enable on
icap_service my_service respmod_precache icap://127.0.0.1:13440/example
adaptation_access my_service allow all

I believe its a problem in the handle_one_request function and you might need to modify the parse_request option. See my repository for the overridden functions.

@stavrakis
Copy link

Is this fixed? I'm having the same problem.

@aes3219563
Copy link

the same issue. Any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants