[Dachs-support] UWS and user access control

Ivan Zolotukhin ivan.zolotukhin at gmail.com
Tue May 3 18:28:58 CEST 2016


Hi Markus,

On Tue, May 3, 2016 at 11:41 AM, Markus Demleitner
<msdemlei at ari.uni-heidelberg.de> wrote:
> Hi Ivan,
>
> On Mon, May 02, 2016 at 09:20:28PM +0200, Ivan Zolotukhin wrote:
>> On Mon, May 2, 2016 at 8:34 PM, Markus Demleitner
>> <msdemlei at ari.uni-heidelberg.de> wrote:
>> For queries to incorrect job URL:
>>
>> 2016-05-02 21:08:12+0200 [-] >>>>>>>>>>>>>>> _RIJl3
>> 2016-05-02 21:08:12+0200 [-] *X*X* 'Service' object has no attribute
>> 'uws' (see info for traceback)
>> 2016-05-02 21:08:12+0200 [-] "10.10.135.118" - - [02/May/2016:19:08:11
>> +0000] "HEAD /res/service1/r/uws.xml/_RIJl3 HTTP/1.1" 400 - "-"
>> "curl/7.29.0"
>
> Jup -- that's a classic why unit tests shouldn't share resources: my
> tests didn't catch the underlying bug because they used "warm"
> objects.
>
> The other bug, the bad redirect, similarly was caused by the HTTP
> interface which the unit tests weren't exercising.
>
> Sorry for abusing you as a tester -- I simply don't have any current
> application for this kind of thing.

Happy to help, I hope I don't bother you too much.

> Fixes are in at svn rev. 5027.

Tested, all works as expected now, except a new bug was discovered
when accessing a job xml created with HTTP auth headers:

In gavo serve debug:

2016-05-03 18:14:46+0200 [-] *X*X* Can only pass-through bytes on
Python 2 (see info for traceback)
2016-05-03 18:14:46+0200 [-] "10.120.0.14" - - [03/May/2016:16:14:46
+0000] "GET /stop/lvg/r/uws.xml/7dmR7W HTTP/1.1" 500 530 "-" "-"

... and then nothing happens until HTTP timeout is reached.

In dcInfos:

2016-05-03 18:14:46,888 [INFO 8809] Traceback of failure just logged:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/twisted/internet/defer.py",
line 501, in _startRunCallbacks
    self._runCallbacks()
  File "/usr/lib64/python2.7/site-packages/twisted/internet/defer.py",
line 588, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python2.7/site-packages/nevow/appserver.py", line
188, in _cbFinishRender
    return self.gotPageContext(pageContext)
  File "/usr/lib/python2.7/site-packages/nevow/appserver.py", line
163, in gotPageContext
    pageContext.tag.renderHTTP, pageContext
--- <exception caught here> ---
  File "/usr/lib64/python2.7/site-packages/twisted/internet/defer.py",
line 150, in maybeDeferred
    result = f(*args, **kw)
  File "/usr/lib/python2.7/site-packages/gavodachs-0.9.6-py2.7.egg/gavo/web/asyncrender.py",
line 58, in renderHTTP
    req.write("Go here: %s\n"%self.location)
  File "/usr/lib64/python2.7/site-packages/twisted/web/server.py",
line 217, in write
    http.Request.write(self, data)
  File "/usr/lib64/python2.7/site-packages/twisted/web/http.py", line
998, in write
    value = networkString('%s' % (value,))
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py",
line 446, in networkString
    raise TypeError("Can only pass-through bytes on Python 2")
exceptions.TypeError: Can only pass-through bytes on Python 2

My setup is python 2.7.5, twisted 15.2.1, nevow 0.11.1.

--
With best regards,
 Ivan

>>
>> For queries to correct job URL:
>>
>> 2016-05-02 21:09:52+0200 [-] >>>>>>>>>>>>>>> _RIJl3
>> 2016-05-02 21:09:52+0200 [-] *X*X* This resource cannot respond to the
>> HTTP 'HEAD' method (see info for traceback)
>> 2016-05-02 21:09:52+0200 [-] "10.120.0.14" - - [02/May/2016:19:09:51
>> +0000] "HEAD /res/service2/r/uws.xml/_RIJl3 HTTP/1.1" 400 - "-"
>> "curl/7.29.0"
>
> That's a bit different: Don't use the HTTP HEAD method on DaCHS in
> general (which will definitely not do the right thing) and in
> particular not on the UWS part -- UWS keeps apart the HTTP methods
> (POST, GET, HEAD, DELETE, etc) fairly strictly, and so DaCHS refuses
> to accept requests with methods it doesn't understand.  This includes
> HEAD.
>
> So, just use GET and things are fine.
>
> Cheers,
>
>            Markus
> _______________________________________________
> Dachs-support mailing list
> Dachs-support at g-vo.org
> http://lists.g-vo.org/cgi-bin/mailman/listinfo/dachs-support



More information about the Dachs-support mailing list