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

clone_package() error from when add_access_to=NULL #220

Open
laurenwalker opened this issue Feb 7, 2022 · 1 comment
Open

clone_package() error from when add_access_to=NULL #220

laurenwalker opened this issue Feb 7, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@laurenwalker
Copy link
Member

I'm trying to perform a simple script that clones a package from one STAGING member node to another. When I call clone_package(), I get an error that seems to stem from arcticdatautils. This seems confusing since I was under the assumption that arcticdatautils augments/uses the datamgmt library.

I found that the error is stemming from the add_access_to parameter, when it is set to NULL. However the vignette for clone_package() says that NULL is a valid value.

My script

# Copy a data package to another member node!

rMapPid="resource_map_urn:uuid:e9b505ba-086b-4bde-b5a3-e185a25a5004"
from_d1Env="STAGING" 
from_d1Node="mnTestKNB" 
to_d1Env="STAGING"
to_d1Node="mnTestARCTIC"

library(datamgmt)
library(dataone)

options(dataone_test_token = "...")

from=D1Client(from_d1Env, paste("urn:node:",from_d1Node,sep=""))
to=D1Client(to_d1Env, paste("urn:node:",to_d1Node,sep=""))

clone_package(rMapPid, from, to, add_access_to=NULL, change_auth_node=TRUE, public=TRUE, clone_children=TRUE)

Output

Cloning metadata: urn:uuid:a84ac5d1-a424-4884-a820-d9e04ce3b2a5
Output: urn:uuid:453af07c-a4e8-46bf-b738-d4fd7bc17557

Cloning data object: urn:uuid:54f70742-bb58-4d69-a1df-5e5e2e244a26
Output: urn:uuid:a473dfaf-afc4-4e90-9378-6db4c1abe30f

Creating a resource map

Error in arcticdatautils::set_access(to@mn, pids = new_resource_map_pid,  : 
  Argument 'subjects' must be character class with non-zero number of characters.

Work-around

When I add at least one subject to the add_access_to parameter, the clone_package() function works:

clone_package(rMapPid, from, to, add_access_to="public", change_auth_node=TRUE, public=TRUE, clone_children=TRUE)
Cloning metadata: urn:uuid:a84ac5d1-a424-4884-a820-d9e04ce3b2a5
Output: urn:uuid:e1558bcc-4602-4cfd-8272-166e004d5fb7

Cloning data object: urn:uuid:54f70742-bb58-4d69-a1df-5e5e2e244a26
Output: urn:uuid:4577dee9-a84d-4810-9b7f-60d673b4cbd5

Creating a resource map

Updating System Metadata for resource_map_urn:uuid:b5b0e3af-7f38-454a-a7e7-a21499168a0d.
$metadata
[1] "urn:uuid:e1558bcc-4602-4cfd-8272-166e004d5fb7"

$data
[1] "urn:uuid:4577dee9-a84d-4810-9b7f-60d673b4cbd5"
@laurenwalker laurenwalker added the bug Something isn't working label Feb 7, 2022
@jeanetteclark
Copy link
Contributor

Thanks for the report @laurenwalker - seems like a documentation error more than anything. I think we decided a while back to require adding access to someone though maybe that should be reconsidered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants