Rlabkey calls from Transformation script result in 401 - User does not have permission to perform this operation

LabKey Support Forum
Rlabkey calls from Transformation script result in 401 - User does not have permission to perform this operation Will Holtz  2018-06-27 16:42
Status: Closed
 

I want to share a workaround to a problem I had. I'm not expecting anyone to follow up on this as I don't know how to reproduce the issue.

I have several file-based modules that contain assays with transformation scripts written in R. These transformation scripts use Rlabkey to read and write data from the Labkey instance. Today, these modules started hanging during the transformation scripts. It appears the Rlabkey calls back to the Labkey instance were failing with a 401 error and the error message ' User does not have permission to perform this operation.' This would even happen when performing the upload as a Labkey admin user. I created a test module that contained a minimal transformation script:

library('Rlabkey')
${rLabkeySessionId}
print(labkey.selectRows(
    baseUrl = '${baseServerURL}',
    folderPath = '/',
    schemaName = 'core',
    queryName = 'users',
))

On my development instance on my laptop, this transformation script worked fine, but on my production server it gave the 401 error. After a few hours of trying to figure out what was going on, I restarted my tomcat instance and everything started working again. Reloading the application within tomcat did not help -- only a full tomcat stop and start worked. So, if you are in a similar situation, try a tomcat restart.

I'm running Labkey v18.1, Tomcat v8.5.30, R v3.4.4, Rlabkey v2.2.1, R package httr v1.3.1 and R package rjson v0.2.19 on Ubuntu v18.04.

-Will

 
 
Jon (LabKey DevOps) responded:  2018-06-29 13:47
Thanks for bringing this to our attention Will.

We will be putting out the 18.2 Release of LabKey sometime mid-July along with a revised Rlabkey package on CRAN (v2.2.2)

Please let us know after your upgrade if you do re-run into this issue again.

Regards,

Jon