# Issue when using DSI::datashield.assign.resource

**URL:** <https://datashield.discourse.group/t/issue-when-using-dsi-datashield-assign-resource/1163>\
**Category:** Developer support\
**Created:** [17 December 2024 16:38 UTC](https://datashield.discourse.group/t/issue-when-using-dsi-datashield-assign-resource/1163 "2024-12-17T16:38:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![FrancescoAnzillotti](https://avatars.discourse-cdn.com/v4/letter/f/6de8d8/32.png) [@FrancescoAnzillotti](https://datashield.discourse.group/u/FrancescoAnzillotti)\
**Post date:** [17 December 2024 16:38 UTC](https://datashield.discourse.group/t/issue-when-using-dsi-datashield-assign-resource/1163/1 "2024-12-17T16:38:54Z")

</div>

Hi, I am trying to upload a rds file as resource into a DataSHIELD project in order to perform DGE analysis on it. (All of the following was run as system administrator). I tried using the airway pre-defined R object (RangedSummarizedExperiment). On dataSHIELD, I created a project named AIRWAY and then uploaded the file with:

```auto
saveRDS(airway, "airway.rds")
opal.file_upload(o, "./airway.rds", "/projects/AIRWAY")
opal.resource_create(o, "AIRWAY", "airway", url = "opal+https://127.0.0.1:443/ws/files/projects/AIRWAY/airway.rds")
opal.resource_perm_add(o, "AIRWAY", "airway", subject = “administrator”, type = "user", permission = "view")

```

However when trying to retrieve and use this object in R using

```auto
builder <- newDSLoginBuilder()
builder$append(server = "server1", url = "https://127.0.0.1:443",
               user = "administrator", password = “P@ssw0rd”, 
               driver = "OpalDriver", 
               options='list(ssl_verifyhost=0, ssl_verifypeer=0)')

logindata <- builder$build()
conns <- datashield.login(logins = logindata, assign = TRUE, symbol = "res")
datashield.resources(conns)
datashield.assign.resource(conns, "rse", "RSRC.prova")
datashield.assign.expr(conns, "res", quote(as.resource.object(rse, strict = TRUE)))

```

I get

```auto
datashield.errors()
✖ server1: Command 'org.obiba.opal.web.datashield.DataShieldSymbolResourceImpl$DataShieldROperation@79ab4556'
  failed on 'server1': Error while evaluating 'is.null(base::assign('rse',
  resourcer::newResourceClient(resourcer::newResource(name='airway.rds',
  url='opal+https://127.0.0.1:443/ws/files/projects/AIRWAY/airway.rds', identity=NULL, secret=NULL,
  format=NULL))))' -> Error in resolveResource(x) : No resolver could be found for resource:
  opal+https://127.0.0.1:443/ws/files/projects/AIRWAY/airway.rds

```

Is this the correct procedure to upload and use an rds file as resource into DataSHIELD? If not, can you please indicate the correct way of doing so?

Francesco

---

<div class="post-metadata">

**Author:** ![yannick](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/yannick/32/19_2.png) [@yannick](https://datashield.discourse.group/u/yannick)\
**Post date:** [18 December 2024 20:54 UTC](https://datashield.discourse.group/t/issue-when-using-dsi-datashield-assign-resource/1163/2 "2024-12-18T20:54:52Z")

</div>

Hi,

Your resource is a file to be downloaded from Opal. You did not specify a secret in your resource definition, which in the case of Opal is expected to be a [Personal Access Token](https://opaldoc.obiba.org/en/latest/web-user-guide/my-profile.html#personal-access-tokens) (PAT). Then Opal refuses that the R server downloads this file.

See opal.resource\_create documentation, there is an example:

> **[Create a resource reference in a project — opal.resource\_create](https://www.obiba.org/opalr/reference/opal.resource_create.html)**
>
> Create a resource reference in a project

Regards  
Yannick
