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

Transfer with xroot using POSC fails for token with storage.modify #7129

Closed
vokac opened this issue Apr 19, 2023 · 25 comments
Closed

Transfer with xroot using POSC fails for token with storage.modify #7129

vokac opened this issue Apr 19, 2023 · 25 comments

Comments

@vokac
Copy link

vokac commented Apr 19, 2023

With latest dCache 8.2.20 I'm getting same error as discussed in #6952 (xroot with POSC transfers using scope based authorization fails), e.g.

$ xrdfs roots://dcache.farm.particle.cz rm /wlcg/x
rm /wlcg/x : [SUCCESS] 
$ xrdcopy /etc/services roots://dcache.farm.particle.cz:1094//wlcg/x
[654.6kB/654.6kB][100%][==================================================][163.6kB/s]  
$ xrdfs roots://dcache.farm.particle.cz rm /wlcg/x
rm /wlcg/x : [SUCCESS] 
$ xrdcopy -P /etc/services roots://dcache.farm.particle.cz:1094//wlcg/x
[0B/0B][100%][==================================================][0B/s]  
Run: [ERROR] Server responded with an error: [3010] Restriction MultiTargetedRestriction[Authorisation{allowing [LIST, MANAGE, UPLOAD, DELETE, READ_METADATA, UPDATE_METADATA] on /wlcg}] denied activity UPLOAD on /upload/0/79d40e08-9643-45bf-bc9c-77885ba86fb1/x (destination)

for WLCG JWT token

{
  "wlcg.ver": "1.0",
  "sub": "58280cfd-ed7f-4954-90c7-cfde610cb963",
  "aud": "https://wlcg.cern.ch/jwt/v1/any",
  "nbf": 1681947649,
  "scope": "storage.modify:/",
  "iss": "https://wlcg.cloud.cnaf.infn.it/",
  "exp": 1681951249,
  "iat": 1681947649,
  "jti": "c1cd1fb7-7819-4c06-aaf3-8a3fb390d80d",
  "client_id": "a6d4bb06-a7ef-40c8-92de-bc5b5e140609"
}

Our dCache journal show following details

...
Apr 20 01:47:50 dcache.farm.particle.cz dcache@doorsDomain[18606]: 20 Apr 2023 01:47:50 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5uQ0/ceg] XrootdSessionHandler.getResponse: Request 3010
Apr 20 01:47:50 dcache.farm.particle.cz dcache@doorsDomain[18606]: 20 Apr 2023 01:47:50 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5uQ0/ceg] no token for /wlcg/x; strict? false.
Apr 20 01:47:50 dcache.farm.particle.cz dcache@doorsDomain[18606]: 20 Apr 2023 01:47:50 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5uQ0/ceg] [id: 0xc224013f, L:/2001:718:401:6025:1:0:1:80:1094 - R:/2001:718:401:6025:10:0:0:1:42506] READ COMPLETE
Apr 20 01:47:50 dcache.farm.particle.cz dcache@doorsDomain[18606]: 20 Apr 2023 01:47:50 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5uQ0/ceg] open[420,5224,/wlcg/x,oss.asize=670293] –– not a third-party request.
Apr 20 01:47:50 dcache.farm.particle.cz dcache@doorsDomain[18606]: 20 Apr 2023 01:47:50 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5uQ0/ceg] Opening /wlcg/x for write
Apr 20 01:47:50 dcache.farm.particle.cz dcache@doorsDomain[18606]: 20 Apr 2023 01:47:50 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5uQ0/ceg] open flags: options to apply for open path (raw=5224 ): kXR_async kXR_new kXR_open_updt kXR_retstat kXR_posc
Apr 20 01:47:50 dcache.farm.particle.cz dcache@doorsDomain[18606]: 20 Apr 2023 01:47:50 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5uQ0/ceg] mode to apply to open path: rw- r-- r--
Apr 20 01:47:50 dcache.farm.particle.cz dcache@doorsDomain[18606]: 20 Apr 2023 01:47:50 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5uQ0/ceg] OPAQUE : {oss.asize=670293}
...
Apr 20 01:47:50 dcache.farm.particle.cz dcache@doorsDomain[18606]: 20 Apr 2023 01:47:50 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5uQ0/ceg] Status: PnfsManager: Creating name space entry
Apr 20 01:47:50 dcache.farm.particle.cz dcache@centralDomain[18611]: 20 Apr 2023 01:47:50 (PnfsManager) [door:Xrootd-dcache@doorsDomain:AAX5uQ0/ceg Xrootd-dcache PnfsCreateEntry] Using thread [/upload/0/6d672870-391e-46b0-87c7-2844c167884b/x] 3
Apr 20 01:47:50 dcache.farm.particle.cz dcache@centralDomain[18611]: 20 Apr 2023 01:47:50 (PnfsManager) [] Creating new transaction with name [diskCacheV111.namespace.PnfsManagerV3.processMessageTransactionally]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
Apr 20 01:47:50 dcache.farm.particle.cz dcache@centralDomain[18611]: 20 Apr 2023 01:47:50 (PnfsManager) [] Acquired Connection [HikariProxyConnection@1994658308 wrapping org.postgresql.jdbc.PgConnection@12f3f7f4] for JDBC transaction
Apr 20 01:47:50 dcache.farm.particle.cz dcache@centralDomain[18611]: 20 Apr 2023 01:47:50 (PnfsManager) [] Switching JDBC Connection [HikariProxyConnection@1994658308 wrapping org.postgresql.jdbc.PgConnection@12f3f7f4] to manual commit
Apr 20 01:47:50 dcache.farm.particle.cz dcache@centralDomain[18611]: 20 Apr 2023 01:47:50 (PnfsManager) [] create file /upload/0/6d672870-391e-46b0-87c7-2844c167884b/x
Apr 20 01:47:50 dcache.farm.particle.cz dcache@centralDomain[18611]: 20 Apr 2023 01:47:50 (PnfsManager) [] Executing prepared SQL query
Apr 20 01:47:50 dcache.farm.particle.cz dcache@centralDomain[18611]: 20 Apr 2023 01:47:50 (PnfsManager) [] Executing prepared SQL statement [SELECT * FROM resolve_path(?, ?)]
Apr 20 01:47:50 dcache.farm.particle.cz dcache@centralDomain[18611]: 20 Apr 2023 01:47:50 (PnfsManager) [] invocation of public abstract java.lang.String org.dcache.chimera.FileSystemProvider.resolvePath(java.lang.String) throws org.dcache.chimera.ChimeraFsException took 4 ms
Apr 20 01:47:50 dcache.farm.particle.cz dcache@centralDomain[18611]: 20 Apr 2023 01:47:50 (PnfsManager) [] Initiating transaction commit
Apr 20 01:47:50 dcache.farm.particle.cz dcache@centralDomain[18611]: 20 Apr 2023 01:47:50 (PnfsManager) [] Committing JDBC transaction on Connection [HikariProxyConnection@1994658308 wrapping org.postgresql.jdbc.PgConnection@12f3f7f4]
Apr 20 01:47:50 dcache.farm.particle.cz dcache@centralDomain[18611]: 20 Apr 2023 01:47:50 (PnfsManager) [] Releasing JDBC Connection [HikariProxyConnection@1994658308 wrapping org.postgresql.jdbc.PgConnection@12f3f7f4] after transaction
Apr 20 01:47:50 dcache.farm.particle.cz dcache@centralDomain[18611]: 20 Apr 2023 01:47:50 (PnfsManager) [] class diskCacheV111.vehicles.PnfsCreateEntryMessage processed in 4 ms
Apr 20 01:47:50 dcache.farm.particle.cz dcache@doorsDomain[18606]: 20 Apr 2023 01:47:50 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5uQ0/ceg] Xrootd-Error-Response: [session E9E6D70101E523FD8E694B64D880E48E][connection [id: 0xc224013f, L:/2001:718:401:6025:1:0:1:80:1094 - R:/2001:718:401:6025:10:0:0:1:42506]][request 3010 kXR_open](error 3010, kXR_NotAuthorized, Restriction MultiTargetedRestriction[Authorisation{allowing [LIST, MANAGE, UPLOAD, DELETE, READ_METADATA, UPDATE_METADATA] on /wlcg}] denied activity UPLOAD on /upload/0/6d672870-391e-46b0-87c7-2844c167884b/x).
Apr 20 01:47:50 dcache.farm.particle.cz dcache@centralDomain[18611]: 20 Apr 2023 01:47:50 (l-AAX5uL4SWzA-<unknown>-AAX5uL6m1ug) [doorsDomain,8.2.20,SATELLITE] Message from [>Xrootd-dcache@doorsDomain:*@doorsDomain] could not be delivered because no route to BillingTopic@local is known; the sender will be notified.
Apr 20 01:47:50 dcache.farm.particle.cz dcache@doorsDomain[18606]: 20 Apr 2023 01:47:50 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5uQ0/ceg] [id: 0xc224013f, L:/2001:718:401:6025:1:0:1:80:1094 - R:/2001:718:401:6025:10:0:0:1:42506] WRITE: error[3010,Restriction MultiTargetedRestriction[Authorisation{allowing [LIST, MANAGE, UPLOAD, DELETE, READ_METADATA, UPDATE_METADATA] on /wlcg}] denied activity UPLOAD on /upload/0/6d672870-391e-46b0-87c7-2844c167884b/x]
...

Transfers using xroot with POSC works with group based authorization / wlcg.groups.

@alrossi
Copy link
Member

alrossi commented Apr 20, 2023

Petr, just so I understand:

After #6952 was resolved, you updated to 8.2.13 and this worked. Now you updated from 8.2.13 to 8.2.20 with no intervening updates, and this no longer works. Correct?

If so, then the only change I can see which was made that might be affecting this would be the resolve path (symlinks) change from 8.2.17 and 8.2.19.

You can see this is touched from the output:

Apr 20 01:47:50 dcache.farm.particle.cz dcache@centralDomain[18611]: 20 Apr 2023 01:47:50 (PnfsManager) [] Executing prepared SQL statement [SELECT * FROM resolve_path(?, ?)]

I don't, however, currently understand why that messes up the RESTRICTIONS.

How difficult would it be for you to try 8.2.16 and 8.2.17 and compare the results? If that is problematic for you, then I will try to see if I can set up my testbed to use tokens with your structure.

Al

@vokac
Copy link
Author

vokac commented Apr 20, 2023

I just downgraded my testbed dcache.farm.particle.cz to 8.2.13 and I see same response

Apr 20 09:20:33 dcache.farm.particle.cz dcache@doorsDomain[21914]: 20 Apr 2023 09:20:33 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5v2BJToA] Status: PnfsManager: Creating name space entry
Apr 20 09:20:33 dcache.farm.particle.cz dcache@centralDomain[21909]: 20 Apr 2023 09:20:33 (PnfsManager) [door:Xrootd-dcache@doorsDomain:AAX5v2BJToA Xrootd-dcache PnfsCreateEntry] Using thread [/upload/0/d0352eb5-35f9-4fbc-8502-24d2bfb6424a/x] 3
Apr 20 09:20:33 dcache.farm.particle.cz dcache@doorsDomain[21914]: 20 Apr 2023 09:20:33 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5v2BJToA] Xrootd-Error-Response: [session FC91AE9D23D04A1D9C52C7CC07F2EFF3][connection [id: 0xd1c41123, L:/2001:718:401:6025:1:0:1:80:1094 - R:/2001:718:401:6025:10:0:0:1:51892]][request 3010 kXR_open](error 3010, kXR_NotAuthorized, Restriction MultiTargetedRestriction[Authorisation{allowing [LIST, MANAGE, UPLOAD, DELETE, READ_METADATA, UPDATE_METADATA] on /wlcg}] denied activity UPLOAD on /upload/0/d0352eb5-35f9-4fbc-8502-24d2bfb6424a/x).
Apr 20 09:20:33 dcache.farm.particle.cz dcache@doorsDomain[21914]: 20 Apr 2023 09:20:33 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5v2BJToA] [id: 0xd1c41123, L:/2001:718:401:6025:1:0:1:80:1094 - R:/2001:718:401:6025:10:0:0:1:51892] WRITE: error[3010,Restriction MultiTargetedRestriction[Authorisation{allowing [LIST, MANAGE, UPLOAD, DELETE, READ_METADATA, UPDATE_METADATA] on /wlcg}] denied activity UPLOAD on /upload/0/d0352eb5-35f9-4fbc-8502-24d2bfb6424a/x]
Apr 20 09:20:33 dcache.farm.particle.cz dcache@doorsDomain[21914]: 20 Apr 2023 09:20:33 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5v2BJToA] [id: 0xd1c41123, L:/2001:718:401:6025:1:0:1:80:1094 - R:/2001:718:401:6025:10:0:0:1:51892] FLUSH
Apr 20 09:20:33 dcache.farm.particle.cz dcache@doorsDomain[21914]: 20 Apr 2023 09:20:33 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5v2BJToA] [id: 0xd1c41123, L:/2001:718:401:6025:1:0:1:80:1094 - R:/2001:718:401:6025:10:0:0:1:51892] USER_EVENT: SslCloseCompletionEvent(SUCCESS)
Apr 20 09:20:33 dcache.farm.particle.cz dcache@doorsDomain[21914]: 20 Apr 2023 09:20:33 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5v2BJToA] [id: 0xd1c41123, L:/2001:718:401:6025:1:0:1:80:1094 - R:/2001:718:401:6025:10:0:0:1:51892] READ COMPLETE
Apr 20 09:20:33 dcache.farm.particle.cz dcache@doorsDomain[21914]: 20 Apr 2023 09:20:33 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5v2BJToA] [id: 0xd1c41123, L:/2001:718:401:6025:1:0:1:80:1094 - R:/2001:718:401:6025:10:0:0:1:51892] READ COMPLETE
Apr 20 09:20:33 dcache.farm.particle.cz dcache@doorsDomain[21914]: 20 Apr 2023 09:20:33 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5v2BJToA] [id: 0xd1c41123, L:/2001:718:401:6025:1:0:1:80:1094 ! R:ui.farm.particle.cz/2001:718:401:6025:10:0:0:1:51892] INACTIVE
Apr 20 09:20:33 dcache.farm.particle.cz dcache@doorsDomain[21914]: 20 Apr 2023 09:20:33 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5v2BJToA] channel inactive event received on [id: 0xd1c41123, L:/2001:718:401:6025:1:0:1:80:1094 ! R:ui.farm.particle.cz/2001:718:401:6025:10:0:0:1:51892].
Apr 20 09:20:33 dcache.farm.particle.cz dcache@centralDomain[21909]: 20 Apr 2023 09:20:33 (l-AAX5vuYmANA-<unknown>-AAX5vujpbmA) [doorsDomain,8.2.13,SATELLITE] Message from [>Xrootd-dcache@doorsDomain:*@doorsDomain] could not be delivered because no route to BillingTopic@local is known; the sender will be notified.
Apr 20 09:20:33 dcache.farm.particle.cz dcache@doorsDomain[21914]: 20 Apr 2023 09:20:33 (Xrootd-dcache) [door:Xrootd-dcache@doorsDomain:AAX5v2BJToA] [id: 0xd1c41123, L:/2001:718:401:6025:1:0:1:80:1094 ! R:ui.farm.particle.cz/2001:718:401:6025:10:0:0:1:51892] UNREGISTERED

(I probably never tested "gfal-copy" upload with 8.2.13)

@alrossi
Copy link
Member

alrossi commented Apr 20, 2023

Ah, well that's progress, thanks.

Dumb question: you are sure that when you upgrade dCache that your gPlazma cell(s) are also running 8.2.13? That is where the change was made.

@vokac
Copy link
Author

vokac commented Apr 20, 2023

Yes, my testbed host all services on one node => one dCache version.

@alrossi
Copy link
Member

alrossi commented Apr 20, 2023

OK, just double-checking.

I will have to try to reproduce your setup on my testbed. Might you post your gPlazma token settings so I can try to mirror them?

Thanks again, Al

@vokac
Copy link
Author

vokac commented Apr 20, 2023

My layout file is following (minus unrelated protocol & pools)

[centralDomain]
dcache.broker.scheme = core
[centralDomain/zookeeper]
[centralDomain/pnfsmanager]
pnfsmanager.enable.inherit-file-ownership = true
[centralDomain/cleaner]
[centralDomain/poolmanager]
[centralDomain/spacemanager]
[centralDomain/pinmanager]
[centralDomain/gplazma]
gplazma.oidc.provider!wlcg = https://wlcg.cloud.cnaf.infn.it/ -profile=wlcg -prefix=/wlcg
gplazma.oidc.provider!altas = https://atlas-auth.web.cern.ch/ -profile=wlcg -prefix=/atlas -authz-id=username:atlas_oidc_test
gplazma.oidc.provider!cms = https://cms-auth.web.cern.ch/ -profile=wlcg -prefix=/cms
gplazma.oidc.provider!dune = https://cilogon.org/dune -profile=wlcg -prefix=/dune
gplazma.oidc.audience-targets = https://wlcg.cern.ch/jwt/v1/any https://dcache.farm.particle.cz https://dcache.farm.particle.cz:2880 roots://dcache.farm.particle.cz roots://dcache.farm.particle.cz:1094
gplazma.argus.endpoint = https://argus1.farm.particle.cz:8154/authz



[adminDoorDomain]
[adminDoorDomain/admin]

[informationDomain]
[informationDomain/httpd]
[informationDomain/topo]
[informationDomain/info]
[informationDomain/statistics]

[informationDomain/frontend]
frontend.authn.basic=true
frontend.authn.protocol=http
frontend.authz.anonymous-operations=READONLY
frontend.srr.shares=default:/atlas

[informationDomain/telemetry]
telemetry.cell.enable=true
telemetry.instance.site-name=praguelcg2 dCache testbed
telemetry.instance.location.latitude=50.1243308
telemetry.instance.location.longitude=14.4686006

[doorsDomain]
[doorsDomain/webdav]
webdav.authn.protocol = https
webdav.net.port = 443

[doorsDomain/nfs]
nfs.version = 4.1

[doorsDomain/xrootd]

@alrossi
Copy link
Member

alrossi commented Apr 20, 2023

Great, thanks again Petr

@alrossi
Copy link
Member

alrossi commented Apr 20, 2023

Petr, I think I'm going to need to see your gplazma.conf and also your authorization conf relevant to VO wlcg as well ... sorry.

@alrossi
Copy link
Member

alrossi commented Apr 20, 2023

If you want to move this to RT to protect private data, please do.

@vokac
Copy link
Author

vokac commented Apr 20, 2023

My current dCache testbed configuration

@alrossi
Copy link
Member

alrossi commented Apr 20, 2023 via email

@alrossi
Copy link
Member

alrossi commented Apr 20, 2023

OK. Mirroring minimally your configuration.

token (NB: no wlcg.groups, just different issuer):

[arossi@fndcatemp1 ~]$ httokendecode -H
{
  "wlcg.ver": "1.0",
  "sub": "58280cfd-ed7f-4954-90c7-cfde610cb963",
  "aud": "https://wlcg.cern.ch/jwt/v1/any",
  "nbf": "Thu Apr 20 13:45:32 CDT 2023",
  "scope": "storage.modify:/",
  "iss": "https://demo.scitokens.org",
  "exp": "Sat May 13 17:28:42 CDT 2023",
  "iat": "Thu Apr 20 13:45:32 CDT 2023",
  "jti": "c1cd1fb7-7819-4c06-aaf3-8a3fb390d80d",
  "client_id": "a6d4bb06-a7ef-40c8-92de-bc5b5e140609",
  "ver": "scitoken:2.0"
}

namespace:

[arossi@fndcatemp1 ~]$ ls -l /mnt/
total 3
drwxrwxrwx 3 arossi ods  512 Jun 28  2022 data
drwx------ 2 root   root 512 Apr 28  2022 lost+found
drwxr-xr-x 4 root   root 512 Feb 24 21:13 pnfs
drwx--x--x 7 root   root 512 Jan 13 14:37 upload
drwxr-xr-x 4   1014 1014 512 Apr 20 14:02 wlcg

dcache.conf:

gplazma.oidc.provider!wlcg=https://demo.scitokens.org -profile=wlcg -prefix=/wlcg
gplazma.oidc.audience-targets=https://wlcg.cern.ch/jwt/v1/any https://demo.scitokens.org

dcache.upload-directory=/upload

gplazma.conf:

auth    sufficient oidc
map     sufficient multimap gplazma.multimap.file=/etc/dcache/multimap.conf
map     optional   authzdb
session sufficient authzdb

multimap.conf:

op:wlcg username:wlcg uid:1014 gid:1014,true

storage-authzdb:

authorize  wlcg     read-write  1014 1014 / /wlcg /

Now, without POSC:

[arossi@fndcatemp1 ~]$ xrdcp5x /etc/fstab roots://fndcatemp2.fnal.gov:1094//wlcg/x-`suffix`
[1.023kB/1.023kB][100%][==================================================][1.023kB/s]  

and with POSC

[arossi@fndcatemp1 ~]$ xrdcp5x -P /etc/fstab roots://fndcatemp2.fnal.gov:1094//wlcg/x-`suffix`
[1.023kB/1.023kB][100%][==================================================][1.023kB/s]  

result:

[arossi@fndcatemp1 ~]$ ls -l /mnt/wlcg/
total 3
-rw-r--r-- 1 1014 1014 1048 Apr 20 14:02 x-2023042014021682017342302771853
-rw-r--r-- 1 1014 1014 1048 Apr 20 14:02 x-2023042014021682017350495464449

So @vokac Petr, what have I not caught that is particular to your setup? Do you see any glaring differences?

Thanks, Al

@vokac
Copy link
Author

vokac commented Apr 27, 2023

Good news - with your configuration everything works for me, but when I return to my more fancy configuration it stops working with xrdcopy -P ... while copy without -P still works. It'll take me a bit more time to fully understand which dCache configuration option breaks -P transfers.

@alrossi
Copy link
Member

alrossi commented Apr 27, 2023

Thanks. The investigation will be very useful one way or the other.

@vokac
Copy link
Author

vokac commented Apr 30, 2023

Finally I found that by using

storage-authzdb:

authorize  wlcg     read-write  1014 1014 / / /

in your configuration transfers with POSC starts to fail. Why setting different root of namespace leads to different behavior for xroots transfers with / without POSC?

@alrossi
Copy link
Member

alrossi commented May 1, 2023

Petr, I can't seem to reproduce this error.

Changing to:

[root@fndcatemp2 dcache]# cat /etc/grid-security/storage-authzdb
authorize  wlcg     read-write  1014 1014 / / /

Doing -P:

[arossi@fndcatemp1 ~]$ xrdcp5x -P /etc/fstab root://fndcatemp2.fnal.gov:1094//wlcg/x-`suffix`
[1.023kB/1.023kB][100%][==================================================][95B/s]  

You can see by the timestamp that the upload dir was created, the file written there, and then moved:

[root@fndcatemp1 arossi]# ls -l /mnt/upload/
total 1
drwx--x--x 2 root root 512 May  1 08:16 11

[root@fndcatemp1 arossi]# ls -l /mnt/upload/11
total 0

[root@fndcatemp1 arossi]# ls -l /mnt/wlcg
total 2
drwxr-xr-x 3 1014 1014  512 Apr 20 14:17 0
-rw-r--r-- 1 1014 1014 1048 May  1 08:16 x-2023050108151682946950808999800

Without -P also works:

[arossi@fndcatemp1 ~]$ xrdcp5x /etc/fstab root://fndcatemp2.fnal.gov:1094//wlcg/x-`suffix`
[1.023kB/1.023kB][100%][==================================================][1.023kB/s]  

Looks like it is something else ... ?

@vokac
Copy link
Author

vokac commented May 2, 2023

I don't understand what's wrong with my configuration:

$ rpm -qa dcache
dcache-8.2.21.ceb2175-1.noarch

$ cat /etc/dcache/dcache.conf  | grep -v ^# | grep -v '^ *$'
dcache.java.memory.heap = 2048m
dcache.java.memory.direct = 2048m
dcache.layout = mylayout-tokens
dcache.default-retention-policy=REPLICA
dcache.default-access-latency=ONLINE
dcache.authn.crl-mode = IF_VALID
pool.wait-for-files = ${path}/data
pool.tags = hostname=${host.fqdn}
dcache.upload-directory=/upload

$ cat /etc/dcache/layouts/mylayout-tokens.conf  | grep -v ^# | grep -v '^ *$'
[centralDomain]
dcache.broker.scheme = core
[centralDomain/zookeeper]
[centralDomain/pnfsmanager]
[centralDomain/cleaner]
[centralDomain/poolmanager]
[centralDomain/spacemanager]
[centralDomain/pinmanager]
[centralDomain/billing]
[centralDomain/admin]
[centralDomain/gplazma]
gplazma.configuration.file=/etc/dcache/gplazma-tokens.conf
gplazma.oidc.provider!demo=https://demo.scitokens.org -profile=wlcg -prefix=/demo
gplazma.oidc.provider!wlcg=https://wlcg.cloud.cnaf.infn.it/ -profile=wlcg -prefix=/wlcg
gplazma.oidc.provider!atlas=https://atlas-auth.web.cern.ch/ -profile=wlcg -prefix=/atlas
gplazma.oidc.audience-targets=https://wlcg.cern.ch/jwt/v1/any https://dcache.farm.particle.cz roots://dcache.farm.particle.cz:1094 https://demo.scitokens.org
gplazma.authzdb.file=/etc/dcache/storage-authzdb
[doorsDomain]
[doorsDomain/webdav]
webdav.authn.protocol = https
webdav.net.port = 443
[doorsDomain/xrootd]
xrootd.authz.write-paths = /
[poolsDomain1]
[poolsDomain1/pool]
pool.name=pool1
pool.path=/srv/dcache/pool-1
pool.size=50G
pool.wait-for-files=${pool.path}/data
[poolsDomain2]
[poolsDomain2/pool]
pool.name=pool2
pool.path=/srv/dcache/pool-2
pool.size=50G
pool.wait-for-files=${pool.path}/data
[poolsDomain3]
[poolsDomain3/pool]
pool.name=pool3
pool.path=/srv/dcache/pool-3
pool.size=50G
pool.wait-for-files=${pool.path}/data

$ cat /etc/dcache/gplazma-tokens.conf  | grep -v ^# | grep -v '^ *$'
auth    sufficient oidc
map     sufficient multimap gplazma.multimap.file=/etc/dcache/multimap.conf
map     optional   authzdb
session sufficient authzdb

$ cat /etc/dcache/storage-authzdb  | grep -v ^# | grep -v '^ *$'
version 2.1
authorize  wlcg     read-write  1199 1199 / / /
authorize  demo     read-write  1199 1199 / / /
authorize  atlas    read-write  2199 2199 / / /

$ cat /etc/dcache/multimap.conf  | grep -v ^# | grep -v '^ *$'
op:demo username:demo uid:1199 gid:1199,true
op:wlcg username:wlcg uid:1199 gid:1199,true
op:atlas username:atlas uid:2199 gid:2199,true

because transfer with this slightly weird token (WLCG and SCITOKEN version in one token):

{
  "wlcg.ver": "1.0",
  "sub": "58280cfd-ed7f-4954-90c7-cfde610cb963",
  "aud": "https://wlcg.cern.ch/jwt/v1/any",
  "scope": "storage.modify:/",
  "iss": "https://demo.scitokens.org",
  "exp": 1683030837,
  "iat": 1683030237,
  "nbf": 1683030237,
  "jti": "1a65b297-c950-4053-8315-866af498f565",
  "client_id": "a6d4bb06-a7ef-40c8-92de-bc5b5e140609",
  "ver": "scitoken:2.0"
}

still fails with -P and succeeds without this parameter:

$ xrdcopy -P /etc/services roots://dcache.farm.particle.cz:1094//demo/x
[0B/0B][100%][==================================================][0B/s]  
Run: [ERROR] Server responded with an error: [3010] Restriction MultiTargetedRestriction[Authorisation{allowing [LIST, MANAGE, UPLOAD, DELETE, READ_METADATA, UPDATE_METADATA] on /demo}] denied activity UPLOAD on /upload/1/57e02248-6257-4739-b514-0775ca0a7ca6/x (destination)

$ xrdcopy /etc/services roots://dcache.farm.particle.cz:1094//demo/x
[654.6kB/654.6kB][100%][==================================================][654.6kB/s]  

$ xrdfs roots://dcache.farm.particle.cz rm /demo/x
rm /demo/x : [SUCCESS] 

Same results also with normal WLCG JWT ATLAS tokens

@alrossi
Copy link
Member

alrossi commented May 2, 2023

Wow. OK, let me start from scratch here, use a single domain and exactly the same branch. Maybe there is a bug in 8.2.21 that is not in other branches. I'll report back.

@alrossi
Copy link
Member

alrossi commented May 2, 2023

Indeed. Using 8.2.21, 9.0.4 and master, with your layout and conf, I get your error:

[arossi@fndcatemp1 ~]$ xrdcp5x /etc/fstab roots://fndcatemp2.fnal.gov//wlcg/x-`suffix`
[1.023kB/1.023kB][100%][==================================================][524B/s]  ]  
[arossi@fndcatemp1 ~]$ xrdcp5x -P /etc/fstab roots://fndcatemp2.fnal.gov//wlcg/x-`suffix`
[0B/0B][100%][==================================================][0B/s]  
Run: [ERROR] Server responded with an error: [3010] Restriction MultiTargetedRestriction[Authorisation{allowing [LIST, MANAGE, UPLOAD, DELETE, READ_METADATA, UPDATE_METADATA] on /wlcg}] denied activity UPLOAD on /upload/0/e3ce7f35-d4e7-4b0d-8cb7-11af8227d554/x-2023050208481683035307300978066 (destination)

Really scratching my head on this one. Will continue to investigate ...

@vokac
Copy link
Author

vokac commented May 2, 2023

I'm happy that you are able to reproduce this behavior (I just hope that it is not just some simple typo in my config file, because in the past such mistakes already caused me quite a lot of headache)

@alrossi
Copy link
Member

alrossi commented May 2, 2023

Actually, there was a bug in the code and for some reason my original testing did not uncover it.

posting a fix.

(It looks like it was your original observation concerning the user home/root).

Would you be willing to try out an 8.2 version of the patch?

@vokac
Copy link
Author

vokac commented May 2, 2023

sure

@alrossi
Copy link
Member

alrossi commented May 3, 2023

@vokac
Copy link
Author

vokac commented May 3, 2023

I can confirm that copy with -P with this dcache-8.2.22.a22ad57-1.noarch works with ATLAS WLCG JWT token.

Now finally also gfal-copy succeeds, so far everything OK for roots:// protocol

$ gfal-copy /etc/services roots://dcache.farm.particle.cz:1094//atlas/atlasscratchdisk/SAM/x
Copying file:///etc/services   [DONE]  after 0s                                                                                                                                                                                                                                 

$ gfal-rm roots://dcache.farm.particle.cz:1094//atlas/atlasscratchdisk/SAM/x
roots://dcache.farm.particle.cz:1094//atlas/atlasscratchdisk/SAM/x	DELETED

$ xrdcopy -P /etc/services roots://dcache.farm.particle.cz:1094//atlas/atlasscratchdisk/SAM/x
[654.6kB/654.6kB][100%][==================================================][654.6kB/s]  

$ xrdfs roots://dcache.farm.particle.cz rm /atlas/atlasscratchdisk/SAM/x
rm /atlas/atlasscratchdisk/SAM/x : [SUCCESS] 

$ xrdcopy /etc/services roots://dcache.farm.particle.cz:1094//atlas/atlasscratchdisk/SAM/x
[654.6kB/654.6kB][100%][==================================================][654.6kB/s]  

$ xrdfs roots://dcache.farm.particle.cz rm /atlas/atlasscratchdisk/SAM/x
rm /atlas/atlasscratchdisk/SAM/x : [SUCCESS] 

ATLAS token

{
  "wlcg.ver": "1.0",
  "sub": "b41bd224-951e-47b9-8f86-c234e491d8b4",
  "aud": "https://wlcg.cern.ch/jwt/v1/any",
  "nbf": 1683120158,
  "scope": "storage.modify:/atlasscratchdisk/SAM/ storage.read:/atlasscratchdisk/SAM/",
  "iss": "https://atlas-auth.web.cern.ch/",
  "exp": 1683123758,
  "iat": 1683120158,
  "jti": "b809d0b0-1216-4037-b7f8-0c3e2d1aea7c",
  "client_id": "aa69c0b7-c8ea-41be-a8bb-614f3fc82541"
}

@alrossi
Copy link
Member

alrossi commented May 3, 2023

Great, thanks again Petr.

alrossi added a commit to alrossi/dcache-server that referenced this issue May 3, 2023
https://rb.dcache.org/r/13855/
master@40dc86223b1f664f6dad5eff4ec222fae5631d3e

was intended to allow upload (for xrootd, POSC)
when there are Multitargeted Restrictions from
tokens.  However, as

dCache#7129 (comment)
`Transfer with xroot using POSC fails for token with storage.modify`

indicates, there is a bug which is erroneously
excluding user roots equivalent to '/'.

Modification:

Remove the conditional excluding '/'.

Result:

POSC works with tokens when user root is '/'.

Target: master
Request: 9.0
Request: 8.2
Request: 8.1
Request: 8.0
Request: 7.2
Closes: dCache#7129
Requires-notes: yes
Patch: https://rb.dcache.org/r/13973/
Acked-by: Dmitry
alrossi added a commit to alrossi/dcache-server that referenced this issue May 3, 2023
https://rb.dcache.org/r/13855/
master@40dc86223b1f664f6dad5eff4ec222fae5631d3e

was intended to allow upload (for xrootd, POSC)
when there are Multitargeted Restrictions from
tokens.  However, as

dCache#7129 (comment)
`Transfer with xroot using POSC fails for token with storage.modify`

indicates, there is a bug which is erroneously
excluding user roots equivalent to '/'.

Modification:

Remove the conditional excluding '/'.

Result:

POSC works with tokens when user root is '/'.

Target: master
Request: 9.0
Request: 8.2
Request: 8.1
Request: 8.0
Request: 7.2
Closes: dCache#7129
Requires-notes: yes
Patch: https://rb.dcache.org/r/13973/
Acked-by: Dmitry
alrossi added a commit to alrossi/dcache-server that referenced this issue May 3, 2023
https://rb.dcache.org/r/13855/
master@40dc86223b1f664f6dad5eff4ec222fae5631d3e

was intended to allow upload (for xrootd, POSC)
when there are Multitargeted Restrictions from
tokens.  However, as

dCache#7129 (comment)
`Transfer with xroot using POSC fails for token with storage.modify`

indicates, there is a bug which is erroneously
excluding user roots equivalent to '/'.

Modification:

Remove the conditional excluding '/'.

Result:

POSC works with tokens when user root is '/'.

Target: master
Request: 9.0
Request: 8.2
Request: 8.1
Request: 8.0
Request: 7.2
Closes: dCache#7129
Requires-notes: yes
Patch: https://rb.dcache.org/r/13973/
Acked-by: Dmitry
alrossi added a commit to alrossi/dcache-server that referenced this issue May 3, 2023
https://rb.dcache.org/r/13855/
master@40dc86223b1f664f6dad5eff4ec222fae5631d3e

was intended to allow upload (for xrootd, POSC)
when there are Multitargeted Restrictions from
tokens.  However, as

dCache#7129 (comment)
`Transfer with xroot using POSC fails for token with storage.modify`

indicates, there is a bug which is erroneously
excluding user roots equivalent to '/'.

Modification:

Remove the conditional excluding '/'.

Result:

POSC works with tokens when user root is '/'.

Target: master
Request: 9.0
Request: 8.2
Request: 8.1
Request: 8.0
Request: 7.2
Closes: dCache#7129
Requires-notes: yes
Patch: https://rb.dcache.org/r/13973/
Acked-by: Dmitry
@alrossi alrossi mentioned this issue May 3, 2023
alrossi added a commit to alrossi/dcache-server that referenced this issue May 3, 2023
https://rb.dcache.org/r/13855/
master@40dc86223b1f664f6dad5eff4ec222fae5631d3e

was intended to allow upload (for xrootd, POSC)
when there are Multitargeted Restrictions from
tokens.  However, as

dCache#7129 (comment)
`Transfer with xroot using POSC fails for token with storage.modify`

indicates, there is a bug which is erroneously
excluding user roots equivalent to '/'.

Modification:

Remove the conditional excluding '/'.

Result:

POSC works with tokens when user root is '/'.

Target: master
Request: 9.0
Request: 8.2
Request: 8.1
Request: 8.0
Request: 7.2
Closes: dCache#7129
Requires-notes: yes
Patch: https://rb.dcache.org/r/13973/
Acked-by: Dmitry
This was referenced May 3, 2023
@alrossi alrossi closed this as completed in 1484e3f May 3, 2023
lemora pushed a commit that referenced this issue May 12, 2023
https://rb.dcache.org/r/13855/
master@40dc86223b1f664f6dad5eff4ec222fae5631d3e

was intended to allow upload (for xrootd, POSC)
when there are Multitargeted Restrictions from
tokens.  However, as

#7129 (comment)
`Transfer with xroot using POSC fails for token with storage.modify`

indicates, there is a bug which is erroneously
excluding user roots equivalent to '/'.

Modification:

Remove the conditional excluding '/'.

Result:

POSC works with tokens when user root is '/'.

Target: master
Request: 9.0
Request: 8.2
Request: 8.1
Request: 8.0
Request: 7.2
Closes: #7129
Requires-notes: yes
Patch: https://rb.dcache.org/r/13973/
Acked-by: Dmitry
lemora pushed a commit that referenced this issue May 12, 2023
https://rb.dcache.org/r/13855/
master@40dc86223b1f664f6dad5eff4ec222fae5631d3e

was intended to allow upload (for xrootd, POSC)
when there are Multitargeted Restrictions from
tokens.  However, as

#7129 (comment)
`Transfer with xroot using POSC fails for token with storage.modify`

indicates, there is a bug which is erroneously
excluding user roots equivalent to '/'.

Modification:

Remove the conditional excluding '/'.

Result:

POSC works with tokens when user root is '/'.

Target: master
Request: 9.0
Request: 8.2
Request: 8.1
Request: 8.0
Request: 7.2
Closes: #7129
Requires-notes: yes
Patch: https://rb.dcache.org/r/13973/
Acked-by: Dmitry
lemora pushed a commit that referenced this issue May 12, 2023
https://rb.dcache.org/r/13855/
master@40dc86223b1f664f6dad5eff4ec222fae5631d3e

was intended to allow upload (for xrootd, POSC)
when there are Multitargeted Restrictions from
tokens.  However, as

#7129 (comment)
`Transfer with xroot using POSC fails for token with storage.modify`

indicates, there is a bug which is erroneously
excluding user roots equivalent to '/'.

Modification:

Remove the conditional excluding '/'.

Result:

POSC works with tokens when user root is '/'.

Target: master
Request: 9.0
Request: 8.2
Request: 8.1
Request: 8.0
Request: 7.2
Closes: #7129
Requires-notes: yes
Patch: https://rb.dcache.org/r/13973/
Acked-by: Dmitry
lemora pushed a commit that referenced this issue May 12, 2023
https://rb.dcache.org/r/13855/
master@40dc86223b1f664f6dad5eff4ec222fae5631d3e

was intended to allow upload (for xrootd, POSC)
when there are Multitargeted Restrictions from
tokens.  However, as

#7129 (comment)
`Transfer with xroot using POSC fails for token with storage.modify`

indicates, there is a bug which is erroneously
excluding user roots equivalent to '/'.

Modification:

Remove the conditional excluding '/'.

Result:

POSC works with tokens when user root is '/'.

Target: master
Request: 9.0
Request: 8.2
Request: 8.1
Request: 8.0
Request: 7.2
Closes: #7129
Requires-notes: yes
Patch: https://rb.dcache.org/r/13973/
Acked-by: Dmitry
lemora pushed a commit that referenced this issue May 12, 2023
https://rb.dcache.org/r/13855/
master@40dc86223b1f664f6dad5eff4ec222fae5631d3e

was intended to allow upload (for xrootd, POSC)
when there are Multitargeted Restrictions from
tokens.  However, as

#7129 (comment)
`Transfer with xroot using POSC fails for token with storage.modify`

indicates, there is a bug which is erroneously
excluding user roots equivalent to '/'.

Modification:

Remove the conditional excluding '/'.

Result:

POSC works with tokens when user root is '/'.

Target: master
Request: 9.0
Request: 8.2
Request: 8.1
Request: 8.0
Request: 7.2
Closes: #7129
Requires-notes: yes
Patch: https://rb.dcache.org/r/13973/
Acked-by: Dmitry
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