problem accesing db with seemingly valid cookie
Since today, I cannot get a DB connection via km3db.
I follow the instructions here https://wiki.km3net.de/index.php/Database to make and test a cookie.
This was working until at least a few days ago with km3db and using the same cookie with wget, before km3db deletes* it, seems to work fine.
But km3db says:
ERROR ++ km3db: Access forbidden, your session has expired. Deleting the cookie (/pbs/home/h/heijboer/.km3netdb_cookie) and retrying once.
See below for the full story.
Thanks in advance for any help.
/pbs/home/h/heijboer(0)> wget --no-check-certificate -q "https://km3netdbweb.in2p3.fr/home.htm?usr=aheijboer&pwd=**********&persist=y" -O $HOME/.km3netdb_cookie && sed -i -- "s/sid=/.in2p3.fr\\tTRUE\\t\/\\tTRUE\\t0\\tsid\\t/g" $HOME/.km3netdb_cookie
/pbs/home/h/heijboer(0)>cat .km3netdb_cookie
.in2p3.fr TRUE / TRUE 0 sid _aheijboer_134.158.240.244_cb3269c1c579420bbc18516a32ac2802
/pbs/home/h/heijboer(0)>
/pbs/home/h/heijboer(0)> wget --load-cookies=$HOME/.km3netdb_cookie --secure-protocol=TLSv1_2 --no-check-certificate "https://km3netdbweb.in2p3.fr/streamds/runs.txt?detid=D_ARCA003"
--2022-11-24 15:31:33-- https://km3netdbweb.in2p3.fr/streamds/runs.txt?detid=D_ARCA003
Resolving km3netdbweb.in2p3.fr (km3netdbweb.in2p3.fr)... 134.158.236.8
Connecting to km3netdbweb.in2p3.fr (km3netdbweb.in2p3.fr)|134.158.236.8|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: 'runs.txt?detid=D_ARCA003'
[ <=> ] 432,466 --.-K/s in 0.04s
2022-11-24 15:31:34 (10.1 MB/s) - 'runs.txt?detid=D_ARCA003' saved [432466]
/pbs/home/h/heijboer(0)>head runs.txt?detid=D_ARCA003
RUN UNIXSTARTTIME STARTTIME_DEFINED RUNSETUPID RUNSETUPNAME T0_CALIBSETID POS_CALIBSETID ROT_CALIBSETID RUNJOBID JOBTARGET JOBPRIORITY UNIXJOBSTART UNIXJOBEND
1 1547648603903 Y A01436504 NO-HV
2763 1462750728240 N A01319446 HV-TUNEDSEA-TM-HRV1000-MHIT
2764 1462750657794 Y A01319446 HV-TUNEDSEA-TM-HRV1000-MHIT @0M4RN8SO On 0 1460218500000 1462750669109
2765 1462750703656 Y A01436504 NO-HV @0NJ0WAN0 On 0 1462750703218 1462802194085
2766 1462751074663 Y A01436509 HV-VENDOR-TM-HRV1000-MHIT-L0 @0NJ15UG1 Run 1 1462751074535 1462751434535
...
/pbs/home/h/heijboer(0)>
/pbs/home/h/heijboer(0)># so far so good
/pbs/home/h/heijboer(0)>
/pbs/home/h/heijboer(0)>python
Python 3.7.5 (default, Nov 1 2019, 21:18:20)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import km3db
>>> km3db.__file__
'/pbs/throng/km3net/software/python/3.7.5/lib/python3.7/site-packages/km3db/__init__.py'
>>> db = km3db.StreamDS(container="nt")
2022-11-24 15:32:10 ERROR ++ km3db: Access forbidden, your session has expired. Deleting the cookie (/pbs/home/h/heijboer/.km3netdb_cookie) and retrying once.
2022-11-24 15:32:11 ERROR ++ km3db: Access forbidden, your session has expired. Deleting the cookie (/pbs/home/h/heijboer/.km3netdb_cookie) and retrying once.
2022-11-24 15:32:12 ERROR ++ km3db: Access forbidden, your session has expired. Deleting the cookie (/pbs/home/h/heijboer/.km3netdb_cookie) and retrying once.
2022-11-24 15:32:13 ERROR ++ km3db: Access forbidden, your session has expired. Deleting the cookie (/pbs/home/h/heijboer/.km3netdb_cookie) and retrying once.
2022-11-24 15:32:14 ERROR ++ km3db: Access forbidden, your session has expired. Deleting the cookie (/pbs/home/h/heijboer/.km3netdb_cookie) and retrying once.
2022-11-24 15:32:15 ERROR ++ km3db: Access forbidden, your session has expired. Deleting the cookie (/pbs/home/h/heijboer/.km3netdb_cookie) and retrying once.
2022-11-24 15:32:16 ERROR ++ km3db: Access forbidden, your session has expired. Deleting the cookie (/pbs/home/h/heijboer/.km3netdb_cookie) and retrying once.
2022-11-24 15:32:17 ERROR ++ km3db: Access forbidden, your session has expired. Deleting the cookie (/pbs/home/h/heijboer/.km3netdb_cookie) and retrying once.
2022-11-24 15:32:18 ERROR ++ km3db: Access forbidden, your session has expired. Deleting the cookie (/pbs/home/h/heijboer/.km3netdb_cookie) and retrying once.
2022-11-24 15:32:19 ERROR ++ km3db: Access forbidden, your session has expired. Deleting the cookie (/pbs/home/h/heijboer/.km3netdb_cookie) and retrying once.
2022-11-24 15:32:20 CRITICAL ++ km3db: Access forbidden. Giving up...
Traceback (most recent call last):
doing instead ctrl-C givves the following, which may provide a hint
2022-11-24 15:46:04 ERROR ++ km3db: Access forbidden, your session has expired. Deleting the cookie (/pbs/home/h/heijboer/.km3netdb_cookie) and retrying once.
^CTraceback (most recent call last):
File "/pbs/throng/km3net/software/python/3.7.5/lib/python3.7/site-packages/km3db/core.py", line 51, in get
f = self.opener.open(target_url)
File "/pbs/throng/km3net/software/python/3.7.5/lib/python3.7/urllib/request.py", line 531, in open
response = meth(req, response)
File "/pbs/throng/km3net/software/python/3.7.5/lib/python3.7/urllib/request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "/pbs/throng/km3net/software/python/3.7.5/lib/python3.7/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/pbs/throng/km3net/software/python/3.7.5/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/pbs/throng/km3net/software/python/3.7.5/lib/python3.7/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
Edited by Tamas Gal