-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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"
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working