cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS via squid only works for small files

idwright
Star Collaborator
Star Collaborator
I'm trying to help out somebody who is sitting behind a squid proxy server.

Using, from Chemistry, the python cmislib but have also tried the java implmentation.


The problem is that only small files can be uploaded/updated - 125kb seems to be OK, 256kb not although I manage to upload some slightly larger files running everything locally.

It's fairly easy to test if you've got squid installed by setting the http(s)_proxy variables.

i.e.
export http_proxy=http://localhost:3128
export https_proxy=http://localhost:3128


I thought I'd ask as Squid is mentioned here:
http://docs.alfresco.com/4.2/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Fconcepts%2Fws-caching-...


The python error is:

  File "/usr/local/lib/python2.7/dist-packages/cmislib/model.py", line 1185, in createDocument
    result = self._cmisClient.post(postUrl.encode('utf-8'), xmlDoc.toxml(encoding='utf-8'), ATOM_XML_ENTRY_TYPE)
  File "/usr/local/lib/python2.7/dist-packages/cmislib/model.py", line 260, in post
    **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/cmislib/net.py", line 286, in post
    return opener.open(request)
  File "/usr/lib/python2.7/urllib2.py", line 400, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 418, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1207, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1177, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 32] Broken pipe>

The squid logs (edited) are as follows:

Success

1392803545.462     29 127.0.0.1 TCP_MISS/401 329 GET http://alfresco/alfresco/cmisatom - DIRECT/ip.ad.dr.ess -
1392803545.620    156 127.0.0.1 TCP_MISS/200 29202 GET http://alfresco/alfresco/cmisatom - DIRECT/ip.ad.dr.ess application/atomsvc+xml
1392803545.651     15 127.0.0.1 TCP_MISS/401 329 GET http://alfresco/alfresco/cmisatom/5ed06978-3f57-xxxx-a9de-0404443ddb6d/path? - DIRECT/ip.ad.dr.ess -
1392803545.809    157 127.0.0.1 TCP_MISS/200 7733 GET http://alfresco/alfresco/cmisatom/5ed06978-3f57-xxxx-a9de-0404443ddb6d/path? - DIRECT/ip.ad.dr.ess application/atom+xml
1392803545.906     29 127.0.0.1 TCP_MISS/401 329 POST http://alfresco/alfresco/cmisatom/5ed06978-3f57-xxxx-a9de-0404443ddb6d/children? - DIRECT/ip.ad.dr.ess -
1392803546.396    489 127.0.0.1 TCP_MISS/409 9280 POST http://alfresco/alfresco/cmisatom/5ed06978-3f57-xxxx-a9de-0404443ddb6d/children? - DIRECT/ip.ad.dr.ess text/html
1392803546.412     14 127.0.0.1 TCP_MISS/401 329 GET http://alfresco/alfresco/cmisatom/5ed06978-3f57-xxxx-a9de-0404443ddb6d/path? - DIRECT/ip.ad.dr.ess -
1392803546.586    172 127.0.0.1 TCP_MISS/200 11509 GET http://alfresco/alfresco/cmisatom/5ed06978-3f57-xxxx-a9de-0404443ddb6d/path? - DIRECT/ip.ad.dr.ess application/atom+xml
1392803546.611     15 127.0.0.1 TCP_MISS/401 378 PUT http://alfresco/alfresco/cmisatom/5ed06978-3f57-xxxx-a9de-0404443ddb6d/content/manual2.txt? - DIRECT/ip.ad.dr.ess text/plain
1392803547.127    514 127.0.0.1 TCP_MISS/201 759 PUT http://alfresco/alfresco/cmisatom/5ed06978-3f57-xxxx-a9de-0404443ddb6d/content/manual2.txt? - DIRECT/ip.ad.dr.ess text/plain





Failure

1392803561.654     34 127.0.0.1 TCP_MISS/401 329 GET http://alfresco/alfresco/cmisatom - DIRECT/ip.ad.dr.ess -
1392803561.808    152 127.0.0.1 TCP_MISS/200 29202 GET http://alfresco/alfresco/cmisatom - DIRECT/ip.ad.dr.ess application/atomsvc+xml
1392803561.838     15 127.0.0.1 TCP_MISS/401 329 GET http://alfresco/alfresco/cmisatom/5ed06978-3f57-xxxx-a9de-0404443ddb6d/path? - DIRECT/ip.ad.dr.ess -
1392803562.218    380 127.0.0.1 TCP_MISS/200 7733 GET http://alfresco/alfresco/cmisatom/5ed06978-3f57-xxxx-a9de-0404443ddb6d/path? - DIRECT/ip.ad.dr.ess application/atom+xml
1392803562.543     30 127.0.0.1 TCP_MISS/401 329 POST http://alfresco/alfresco/cmisatom/5ed06978-3f57-xxxx-a9de-0404443ddb6d/children? - DIRECT/ip.ad.dr.ess -
3 REPLIES 3

jpotts
World-Class Innovator
World-Class Innovator
Can you verify that this problem does not exist without squid?

Jeff

idwright
Star Collaborator
Star Collaborator
Yes - it works fine without squid.

It's not an option for my colleague but in my local tests exactly the same code/file works when the http(s)_proxy variables are not set to point to the squid instance.

Thanks,
Ian

idwright
Star Collaborator
Star Collaborator
I haven't had much time for this as we've come up with a work around but thought I'd post the following in case it's useful

If I attach strace to the squid process and log the output to the console then larger files will work - if the output of strace is sent to /dev/null then the original behaviour comes back.

So the interaction with squid is definitely the problem but it's not clear to me why - different clients exhibit the same symptoms so a possible next step would be to try a different CMIS server and see what happens