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

Error: Try squid with icapeg #61

Open
MahmoudRabee opened this issue Jun 28, 2022 · 1 comment
Open

Error: Try squid with icapeg #61

MahmoudRabee opened this issue Jun 28, 2022 · 1 comment

Comments

@MahmoudRabee
Copy link
Contributor

I tried to connect squid with icapeg
icapeg running in docker container
squid is running in docker container
icapeg from restructure branch with original config.toml
squid version 5
in squid :

  • I Added these lines to squid.conf file

icap_enable on
adaptation_send_username on
adaptation_send_client_ip on
icap_service srv_resp respmod_precache 0 icap://127.0.0.1:1344/echo
#icap_service srv_req reqmod_precache 0 icap://localhost:1344/echo
adaptation_access srv_resp allow all
#adaptation_access srv_req allow all
icap_service_failure_limit -1
icap_preview_enable off

I tested the proxy with curl command

curl -I --proxy "http://localhost:5002" http://www.example.com
result from squid :
HTTP/1.1 500 Internal Server Error
Server: squid/5.4.1
Mime-Version: 1.0
Date: Tue, 28 Jun 2022 14:25:43 GMT
Content-Type: text/html;charset=utf-8
Content-Length: 3141
X-Squid-Error: ERR_ICAP_FAILURE 0
Vary: Accept-Language
Content-Language: en
X-Cache: MISS from 193a33666dbf
Via: 1.1 193a33666dbf (squid/5.4.1)
Connection: keep-alive

result of icapeg logs :

2022/06/28 14:15:41 icap: panic serving 172.18.0.4:37520: runtime error: invalid memory address or nil pointer dereference
goroutine 10 [running]:
runtime/debug.Stack()
/usr/local/go/src/runtime/debug/stack.go:24 +0x65
icapeg/icap.(*conn).serve.func1()
/home/icapeg/icap/server.go:106 +0xdd
panic({0x804be0, 0xb73ec0})
/usr/local/go/src/runtime/panic.go:838 +0x207
compress/gzip.(*Reader).Read(0x0?, {0xc000149400?, 0x0?, 0x0?})
/usr/local/go/src/compress/gzip/gunzip.go:247 +0x2e
io.ReadAll({0x914100, 0x0})
/usr/local/go/src/io/io.go:645 +0xfe
io/ioutil.ReadAll(...)
/usr/local/go/src/io/ioutil/ioutil.go:27
icapeg/service/services-utilities/general-functions.(*GeneralFunc).DecompressGzipBody(0x9142e0?, 0xc00010abd0?)
/home/icapeg/service/services-utilities/general-functions/general-functions.go:125 +0x35
icapeg/service/services/echo.(*Echo).Processing(0xc0002540c0, 0xc5?)
/home/icapeg/service/services/echo/echo.go:67 +0x6a5
icapeg/api.(*ICAPRequest).RespAndReqMods(0xc0000648a0, 0x1e?)
/home/icapeg/api/icap-request.go:146 +0x2b9
icapeg/api.(*ICAPRequest).RequestProcessing(0xc0000648a0)
/home/icapeg/api/icap-request.go:110 +0xbe
icapeg/api.ToICAPEGServe({0x9172a8?, 0xc0002522d0?}, 0xc00049efc0?)
/home/icapeg/api/icap.go:20 +0x48
icapeg/icap.HandlerFunc.ServeICAP(0xc000193ed8?, {0x9172a8?, 0xc0002522d0?}, 0xc00010abea?)
/home/icapeg/icap/server.go:39 +0x2f
icapeg/icap.(*ServeMux).ServeICAP(0xc000010058, {0x9172a8, 0xc0002522d0}, 0xc000100120)
/home/icapeg/icap/mux.go:94 +0x448
icapeg/icap.(*conn).serve(0xc000067400, 0x0?)
/home/icapeg/icap/server.go:127 +0x7f
created by icapeg/icap.(*Server).Serve
/home/icapeg/icap/server.go:207 +0x205
2022/06/28 14:15:59 icap: panic serving 172.18.0.4:37522: runtime error: invalid memory address or nil pointer dereference
goroutine 52 [running]:
runtime/debug.Stack()
/usr/local/go/src/runtime/debug/stack.go:24 +0x65
icapeg/icap.(*conn).serve.func1()
/home/icapeg/icap/server.go:106 +0xdd
panic({0x804be0, 0xb73ec0})
/usr/local/go/src/runtime/panic.go:838 +0x207
compress/gzip.(*Reader).Read(0x0?, {0xc00009a200?, 0x0?, 0x0?})
/usr/local/go/src/compress/gzip/gunzip.go:247 +0x2e
io.ReadAll({0x914100, 0x0})
/usr/local/go/src/io/io.go:645 +0xfe
io/ioutil.ReadAll(...)
/usr/local/go/src/io/ioutil/ioutil.go:27
icapeg/service/services-utilities/general-functions.(*GeneralFunc).DecompressGzipBody(0x9142e0?, 0xc00010a240?)
/home/icapeg/service/services-utilities/general-functions/general-functions.go:125 +0x35
icapeg/service/services/echo.(*Echo).Processing(0xc0002540c0, 0xc5?)
/home/icapeg/service/services/echo/echo.go:67 +0x6a5
icapeg/api.(*ICAPRequest).RespAndReqMods(0xc0000686c0, 0x1e?)
/home/icapeg/api/icap-request.go:146 +0x2b9
icapeg/api.(*ICAPRequest).RequestProcessing(0xc0000686c0)
/home/icapeg/api/icap-request.go:110 +0xbe
icapeg/api.ToICAPEGServe({0x9172a8?, 0xc0004821b0?}, 0xc00049efc0?)
/home/icapeg/api/icap.go:20 +0x48
icapeg/icap.HandlerFunc.ServeICAP(0xc00004eed8?, {0x9172a8?, 0xc0004821b0?}, 0xc00010a25a?)
/home/icapeg/icap/server.go:39 +0x2f
icapeg/icap.(*ServeMux).ServeICAP(0xc000010058, {0x9172a8, 0xc0004821b0}, 0xc00016e120)
/home/icapeg/icap/mux.go:94 +0x448
icapeg/icap.(*conn).serve(0xc000066000, 0x0?)
/home/icapeg/icap/server.go:127 +0x7f
created by icapeg/icap.(*Server).Serve
/home/icapeg/icap/server.go:207 +0x205
2022/06/28 14:17:14 ICAP server gracefully shut down
2022/06/28 14:17:29 starting the ICAP server
2022/06/28 14:17:29 ICAP server is running on localhost: 1344
2022/06/28 14:21:43 icap: panic serving 172.18.0.4:37528: runtime error: invalid memory address or nil pointer dereference
goroutine 11 [running]:
runtime/debug.Stack()
/usr/local/go/src/runtime/debug/stack.go:24 +0x65
icapeg/icap.(*conn).serve.func1()
/home/icapeg/icap/server.go:106 +0xdd
panic({0x804be0, 0xb73ec0})
/usr/local/go/src/runtime/panic.go:838 +0x207
compress/gzip.(*Reader).Read(0x0?, {0xc000234200?, 0x0?, 0x0?})
/usr/local/go/src/compress/gzip/gunzip.go:247 +0x2e
io.ReadAll({0x914100, 0x0})
/usr/local/go/src/io/io.go:645 +0xfe
io/ioutil.ReadAll(...)
/usr/local/go/src/io/ioutil/ioutil.go:27
icapeg/service/services-utilities/general-functions.(*GeneralFunc).DecompressGzipBody(0x9142e0?, 0xc00010a270?)
/home/icapeg/service/services-utilities/general-functions/general-functions.go:125 +0x35
icapeg/service/services/echo.(*Echo).Processing(0xc00021c0c0, 0xc5?)
/home/icapeg/service/services/echo/echo.go:67 +0x6a5
icapeg/api.(*ICAPRequest).RespAndReqMods(0xc0005861e0, 0x1e?)
/home/icapeg/api/icap-request.go:146 +0x2b9
icapeg/api.(*ICAPRequest).RequestProcessing(0xc0005861e0)
/home/icapeg/api/icap-request.go:110 +0xbe
icapeg/api.ToICAPEGServe({0x9172a8?, 0xc0003dc330?}, 0xc0004b8fc0?)
/home/icapeg/api/icap.go:20 +0x48
icapeg/icap.HandlerFunc.ServeICAP(0xc00004ded8?, {0x9172a8?, 0xc0003dc330?}, 0xc00010a28a?)
/home/icapeg/icap/server.go:39 +0x2f
icapeg/icap.(*ServeMux).ServeICAP(0xc000010058, {0x9172a8, 0xc0003dc330}, 0xc00016e240)
/home/icapeg/icap/mux.go:94 +0x448
icapeg/icap.(*conn).serve(0xc000066000, 0x0?)
/home/icapeg/icap/server.go:127 +0x7f
created by icapeg/icap.(*Server).Serve
/home/icapeg/icap/server.go:207 +0x205

@mahnouman
Copy link
Contributor

Seems code is broken since: 9f04dc8

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

2 participants