problems in starting the ecap- getting ICAP protocol error

Asked by Sandeep Kuttal

Hi All,

I am new to ecap and squid. I am stuck with starting the squid. I installed ecap gzip and adapters code configured, make and installed them.
squid 3.1.1
OS ubuntu
ecap_adapter_sample-0.0.2
squid-ecap-gzip-1.2.0
But when I just run the squid with gzip loadable module squid is running. But for my research I need to make changes to the passthru file. So when I changed my config file (i.e. squid.conf) as below

ecap_enable on
ecap_service gzip_service respmod_precache 0 ecap://www.vigos.com/ecap_gzip
loadable_modules /usr/local/lib/ecap_adapter_gzip.so
acl GZIP_HTTP_STATUS http_status 200
adaptation_access gzip_service allow GZIP_HTTP_STATUS

ecap_service eReqmod reqmod_precache 0 ecap://e-cap.org/ecap/services/sample/passthru
ecap_service eRespmod respmod_precache 0 ecap://e-cap.org/ecap/services/sample/passthru
loadable_modules /usr/local/lib/ecap_adapter_passthru.so
adaptation_service_set reqFilter eReqmod
adaptation_service_set respFilter eRespmod

adaptation_access respFilter allow all
adaptation_access reqFilter allow all

I am not able to run the icap since I am getting the error "icap protocol error" that icap is not working. Kindly suggest me how to get through it.
the cache.log is as here:

2010/07/13 12:00:48| Starting Squid Cache version 3.1.1 for i686-pc-linux-gnu...
2010/07/13 12:00:48| Process ID 1934
2010/07/13 12:00:48| With 1024 file descriptors available
2010/07/13 12:00:48| Initializing IP Cache...
2010/07/13 12:00:48| DNS Socket created at [::], FD 7
2010/07/13 12:00:48| Adding domain unl.edu from /etc/resolv.conf
2010/07/13 12:00:48| Adding domain unl.edu from /etc/resolv.conf
2010/07/13 12:00:48| Adding nameserver 129.93.1.180 from /etc/resolv.conf
2010/07/13 12:00:48| Adding nameserver 129.93.6.189 from /etc/resolv.conf
2010/07/13 12:00:49| Unlinkd pipe opened on FD 12
2010/07/13 12:00:49| Swap maxSize 102400 + 262144 KB, estimated 28041 objects
2010/07/13 12:00:49| Target number of buckets: 1402
2010/07/13 12:00:49| Using 8192 Store buckets
2010/07/13 12:00:49| Max Mem size: 262144 KB
2010/07/13 12:00:49| Max Swap size: 102400 KB
2010/07/13 12:00:49| Version 1 of swap file with LFS support detected...
2010/07/13 12:00:49| Rebuilding storage in /home/skuttal/libecap-0.0.2/squid-ecap-gzip/squid-3.1.1/var/cache (DIRTY)
2010/07/13 12:00:49| Using Least Load store dir selection
2010/07/13 12:00:49| Set Current Directory to /home/skuttal/libecap-0.0.2/squid-ecap-gzip/squid-3.1.1/var/cache
2010/07/13 12:00:49| Loaded Icons.
2010/07/13 12:00:49| Adaptation support is on
2010/07/13 12:00:49| Warning: configured ecap_service was not loaded: ecap://e-cap.org/ecap/services/sample/passthru
2010/07/13 12:00:49| Warning: configured ecap_service was not loaded: ecap://e-cap.org/ecap/services/sample/passthru
2010/07/13 12:00:49| Ready to serve requests.
2010/07/13 12:00:49| Done reading /home/skuttal/libecap-0.0.2/squid-ecap-gzip/squid-3.1.1/var/cache swaplog (2253 entries)
2010/07/13 12:00:49| Finished rebuilding storage from disk.
2010/07/13 12:00:49| 2163 Entries scanned
2010/07/13 12:00:49| 0 Invalid entries.
2010/07/13 12:00:49| 0 With invalid flags.
2010/07/13 12:00:49| 2073 Objects loaded.
2010/07/13 12:00:49| 0 Objects expired.
2010/07/13 12:00:49| 90 Objects cancelled.
2010/07/13 12:00:49| 0 Duplicate URLs purged.
2010/07/13 12:00:49| 0 Swapfile clashes avoided.
2010/07/13 12:00:49| Took 0.24 seconds (8704.34 objects/sec).
2010/07/13 12:00:49| Beginning Validation Procedure
2010/07/13 12:00:49| Completed Validation Procedure
2010/07/13 12:00:49| Validated 4169 Entries
2010/07/13 12:00:49| store_swap_size = 19172
2010/07/13 12:00:50| storeLateRelease: released 0 objects

It seems like ecap_service is not loaded: ecap://e-cap.org/ecap/services/sample/passthru. how to get over this. Or is there something else I am missing. Kindly suggest. another thing I haven't loaded any patches.
Thanks in advance for helping me out.

Thanks
Sandeep

Question information

Language:
English Edit question
Status:
Solved
For:
eCAP Edit question
Assignee:
No assignee Edit question
Solved by:
Sandeep Kuttal
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Alex Rousskov (rousskov) said :
#1

Please enable full debugging (debug_options ALL,9) in squid.conf, start Squid, and post the compressed cache.log here.

Revision history for this message
Sandeep Kuttal (skuttal) said :
#2

The link to the compressed cache.log is here
http://cse.unl.edu/~skuttal/cache.log.gz

Revision history for this message
Alex Rousskov (rousskov) said :
#3

I cannot see the problem in the detailed logs you provided. However, I noticed that your Squid version is old. There were several eCAP related fixes and improvements since v3.1.1, including changes related to eCAP initialization.

Please use v3.1.4 or later. If the newer version has the same problem and lacks more informative messages, please repost a fresh detailed cache.log.

Revision history for this message
Sandeep Kuttal (skuttal) said :
#4

i have installed squid 3.1.4 and again no use the cache logs for that are here
http://cse.unl.edu/~skuttal/cache.log.gz

Thanks for sparing out you time for my problem

Revision history for this message
Sandeep Kuttal (skuttal) said :
#5

Hi Alex sorry actually i forgot to remove comment from the squid.conf where the cache is formed. Now i have again uncommented and ran the squid but icap error is still there. I don't know what is going wrong.. Kindly see the squid.conf above do u thing that i have defies the things correctly. How should I proceed ? I am stuck with this basic thing.

The cache.log has the same contents which i specified in above message.

Warning: configured ecap_service was not loaded: ecap://e-cap.org/ecap/services/sample/passthru
 Warning: configured ecap_service was not loaded: ecap://e-cap.org/ecap/services/sample/passthru

Thanks
Sandeep

Revision history for this message
Sandeep Kuttal (skuttal) said :
#6

I have loaded the fresh copy of cache In the end you can find it is same sort of messages I wrote before with squid 3.1.4

http://cse.unl.edu/~skuttal/cache.log.gz

Revision history for this message
Sandeep Kuttal (skuttal) said :
#7

I have loaded the fresh copy of cache In the end you can find it is same sort of messages I wrote before with squid 3.1.4

http://cse.unl.edu/~skuttal/cache.log.gz

Revision history for this message
Sandeep Kuttal (skuttal) said :
#8

the file serviceRep.cc has this warning defined under function Adaptation::Ecap::ServiceRep::finalize()
I am trying to figure out what is going wrong... Kindly someone suggest how to get over this.

Thanks

Revision history for this message
Alex Rousskov (rousskov) said :
#9

wget http://cse.unl.edu/~skuttal/cache.log.gz
--2010-07-13 16:18:30-- http://cse.unl.edu/~skuttal/cache.log.gz
Resolving cse.unl.edu... 129.93.165.2
Connecting to cse.unl.edu|129.93.165.2|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2010-07-13 16:18:30 ERROR 403: Forbidden.

Revision history for this message
Sandeep Kuttal (skuttal) said :
#10

Hi Thanks for looking at my problem. I am not sure but i checked and I am able to access the file. Kindly check again if you find problem kindly do let me know..
Thanks

Revision history for this message
Alex Rousskov (rousskov) said :
#11

The access problem is gone, I was able to download the log. However, the log does not contain debugging info. Please use debug_options ALL,9 to enable full debugging.

Revision history for this message
Sandeep Kuttal (skuttal) said :
#12

Hi Alex,

I have upgraded the latest cache file. Kindly help me in figuring out the problem.
http://cse.unl.edu/~skuttal/cache.log.gz
Thanks a lot

Revision history for this message
Alex Rousskov (rousskov) said :
#13

One of the following three things is happening:

1. There is a Squid service registration bug.
2. The ecap_adapter_gzip.so module is registering its ecap://www.vigos.com/ecap_gzip service twice
3. The ecap_adapter_passthru.so module is registering foreign ecap://www.vigos.com/ecap_gzip service.

If you have not customized ecap_adapter_passthru.so, then please adjust your configuration to load just ecap_adapter_passthru.so and use only ecap://e-cap.org/ecap/services/sample/passthru service. Post new cache.log with full debugging enabled after those adjustments.

If you have customized ecap_adapter_passthru.so, then fix your adapter and rename it to avoid confusion with an official sample.

Revision history for this message
Sandeep Kuttal (skuttal) said :
#14

Hi Alex,

I have again uploaded the cache.log at sftp://<email address hidden>/home/grad/skuttal/cache.log.gz
this contains the instructions you gave me.

Regarding the 3 things that can happen
1) i am not sure if its a bug
2
) I don't think this is happening since when i checked cache I didn't showed this.
3)i don't think this is happening

Kindly help in getting through this hurdle.
Thanks a lot for you time and patience

Thanks

Revision history for this message
Sandeep Kuttal (skuttal) said :
#15

I also giving my squid.conf file since I feel may be that is having problem. I have tried all ways
loading ecap_gzip SQUID WORKED and ecap also worked
loading just adapter SQUID DIDNT WORKED
loading adapter and ecap_gzip SQUID RAN but gave icap error on browser
my config file can be found at
http://cse.unl.edu/~skuttal/squid.conf

Kinldy help me in getting out of this. Thanks a lot Alex for taking out your precious time to look at the problems.

Thanks a lot

Revision history for this message
Alex Rousskov (rousskov) said :
#16

I see that loading just the sample adapter works, but Squid quits shortly after. The logs do not contain the reason for quitting:

2010/07/13 23:58:54.074| registered eCAP module service: ecap://e-cap.org/ecap/services/sample/passthru
2010/07/13 23:58:54.074| Adaptation support is on
2010/07/13 23:58:54.074| ServiceRep.cc(35) finalize: starting eCAP service: ecap://e-cap.org/ecap/services/sample/passthru
2010/07/13 23:58:54.075| ACL::~ACL: '
2010/07/13 23:58:54.075| ACL::~ACL: '

Do you get some error message on the console or in one of the system logs? If not, try starting Squid from gdb.

Once this is resolved, we can come back to the problem of registering two adapters.

Revision history for this message
Sandeep Kuttal (skuttal) said :
#17

In the logs of ubuntu I found this some processes start and then exit by themself seems like some squid problem. I will try to run with gdb

Jul 14 09:32:09 skuttal-laptop wpa_supplicant[1062]: CTRL-EVENT-SCAN-RESULTS
Jul 14 09:32:26 skuttal-laptop squid[1966]: Squid Parent: child process 1968 started
Jul 14 09:32:26 skuttal-laptop squid[1966]: Squid Parent: child process 1968 exited due to signal 6 with status 0
Jul 14 09:32:29 skuttal-laptop squid[1966]: Squid Parent: child process 1971 started
Jul 14 09:32:30 skuttal-laptop squid[1966]: Squid Parent: child process 1971 exited due to signal 6 with status 0
Jul 14 09:32:33 skuttal-laptop squid[1966]: Squid Parent: child process 1976 started
Jul 14 09:32:33 skuttal-laptop squid[1966]: Squid Parent: child process 1976 exited due to signal 6 with status 0
Jul 14 09:32:36 skuttal-laptop squid[1966]: Squid Parent: child process 1979 started
Jul 14 09:32:37 skuttal-laptop squid[1966]: Squid Parent: child process 1979 exited due to signal 6 with status 0
Jul 14 09:32:40 skuttal-laptop squid[1966]: Squid Parent: child process 1982 started
Jul 14 09:32:40 skuttal-laptop squid[1966]: Squid Parent: child process 1982 exited due to signal 6 with status 0
Jul 14 09:32:40 skuttal-laptop squid[1966]: Exiting due to repeated, frequent failures
Jul 14 09:33:09 skuttal-laptop wpa_supplicant[1062]: CTRL-EVENT-SCAN-RESULTS
Jul 14 09:34:29 skuttal-laptop wpa_supplicant[1062]: CTRL-EVENT-SCAN-RESULTS
Jul 14 09:36:09 skuttal-laptop wpa_supplicant[1062]: CTRL-EVENT-SCAN-RESULTS
Jul 14 09:38:09 skuttal-laptop wpa_supplicant[1062]: CTRL-EVENT-SCAN-RESULTS
Jul 14 09:40:09 skuttal-laptop wpa_supplicant[1062]: CTRL-EVENT-SCAN-RESULTS
Jul 14 09:42:09 skuttal-laptop wpa_supplicant[1062]: CTRL-EVENT-SCAN-RESULTS
Jul 14 09:44:09 skuttal-laptop wpa_supplicant[1062]: CTRL-EVENT-SCAN-RESULTS
Jul 14 09:45:10 skuttal-laptop kernel: [ 904.583045] ath5k phy0: unsupported jumbo
Jul 14 09:46:09 skuttal-laptop wpa_supplicant[1062]: CTRL-EVENT-SCAN-RESULTS
Jul 14 09:48:09 skuttal-laptop wpa_supplicant[1062]: CTRL-EVENT-SCAN-RESULTS
Jul 14 09:50:09 skuttal-laptop wpa_supplicant[1062]: CTRL-EVENT-SCAN-RESULTS
Jul 14 09:52:09 skuttal-laptop wpa_supplicant[1062]: CTRL-EVENT-SCAN-RESULTS
Jul 14 09:54:09 skuttal-laptop wpa_supplicant[1062]: CTRL-EVENT-SCAN-RESULTS
Jul 14 09:56:09 skuttal-laptop wpa_supplicant[1062]: CTRL-EVENT-SCAN-RESULTS

Revision history for this message
Alex Rousskov (rousskov) said :
#18

When starting Squid for tests (from gdb or on its own), use -NC command line options. When in gdb, once SEGV is caught, type "where" to get a stack trace. Ideally, you should build your Squid with --disable-optimizations while you are trying things -- it will make gdb output more informative.

Revision history for this message
Sandeep Kuttal (skuttal) said :
#19

This is what I got after doing gdb
[Thread debugging using libthread_db enabled]
2010/07/14 11:46:33| WARNING cache_mem is larger than total disk cache space!
squid: adapter.cc:17: virtual void libecap::adapter::Service::start(): Assertion `false' failed.

Program received signal SIGABRT, Aborted.
0x0012d422 in __kernel_vsyscall ()
(gdb) where
#0 0x0012d422 in __kernel_vsyscall ()
#1 0x003064d1 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0x00309932 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0x002ff648 in __assert_fail () from /lib/tls/i686/cmov/libc.so.6
#4 0x0018760c in libecap::adapter::Service::start (this=0x85eea30)
    at adapter.cc:17
#5 0x004425ed in Adapter::Service::start (this=0x85eea30)
    at adapter_passthru.cc:101
#6 0x08217dfd in Adaptation::Ecap::ServiceRep::finalize (this=0x85eeac8)
    at ServiceRep.cc:36
#7 0x0820cb66 in FinalizeEach<Vector<RefCount<Adaptation::Service> > > (
    collection=..., label=0x8266935 "message adaptation services")
    at Config.cc:120
#8 0x0820c3b0 in Adaptation::Config::Finalize (enabled=true) at Config.cc:131
#9 0x0816247f in mainInitialize () at main.cc:1104
#10 0x081629e9 in SquidMain (argc=2, argv=0xbffff744) at main.cc:1364
#11 0x0816261e in SquidMainSafe (argc=2, argv=0xbffff744) at main.cc:1159
#12 0x08162602 in main (argc=2, argv=0xbffff744) at main.cc:1151
(gdb)

Is my config file correct? Kindly let me know what you think

Thanks a Lot

Revision history for this message
Sandeep Kuttal (skuttal) said :
#20

should i comment in squid: adapter.cc:17: virtual void libecap::adapter::Service::start() Assertion

Revision history for this message
Sandeep Kuttal (skuttal) said :
#21

I tried commenting assert(false) in adapter.cc function start() and then ran squid.... but the browser showed loading sign only but never loaded anything

Revision history for this message
Alex Rousskov (rousskov) said :
#22

Commenting the assertion was the right thing to do (see bug #408091 on lp).

As for "never loaded anything", it may be due to libecap bugs. They all have fixes or workarounds posted in the bugs section of this project, IIRC.

Revision history for this message
Sandeep Kuttal (skuttal) said :
#23

Yes at last the proxy is working
but i am not sure weather properly or not I just removed assert

Revision history for this message
Sandeep Kuttal (skuttal) said :
#24

Thanks Alex for your help now this was just my first step i was looking to change the adapter code to store me messages on disk. So will now start with that

Thanks a lot for all your help

Revision history for this message
Sandeep Kuttal (skuttal) said :
#25

Alex, Thanks a Lot for solving my problem

Revision history for this message
Sandeep Kuttal (skuttal) said :
#26

Alex, Thanks a Lot for solving my problem

Revision history for this message
Sandeep Kuttal (skuttal) said :
#27

Thanks