Problems with Rlabkey package

LabKey Support Forum (Inactive)
Problems with Rlabkey package michael_stover  2012-07-17 13:00
Status: Closed
 
We're having some trouble with the Rlabkey package. It works for some folks, but not for others. As far as we can tell, we have installed everything the same way. But, when we run a script exported from labkey on some people's machines, we get:


Error in labkey.selectRows(baseUrl = "http://blis.urmc.rochester.edu/labkey", :
  HTTP request was unsuccessful. Status code = 401, Error message = Moved Temporarily


We really have no idea what is different. Does this error message suggest anything to anyone?
 
 
Brian Connolly responded:  2012-07-17 13:11
Michael,

I am sorry about the confusion caused by this error message. This message means that the authentication to the server has failed most likely because Rlabkey has been incorrectly configured. On the machines where this is failing, can you verify that you the netrc files are configured properly (see https://www.labkey.org/wiki/home/Documentation/page.view?name=netrc)

-Brian
 
michael_stover responded:  2012-07-17 13:38
That is what I thought too, and we went over the contents of the _netrc file several times. This same _netrc file works with the SAS connector. Any other possibilities?
 
Brian Connolly responded:  2012-07-17 14:06
Michael,

Given that the status code is 401, this most likely an authentication problem or lack of permissions problem. It could be something else, but we should we rule out authentication or permissions first.

The first thing to check, is your labkey.log file. You will want to see if there are any login error messages in the file. All failed login attempts get logged here.

The second thing to check is Audit Log. All successful and failed logins get logged here. This log will tell you if the Rlabkey connection has successfully logged prior to attempting the selectRows. To access the AuditLog
- goto the Admin Console
- Click on the Audit Log link
- In the drop down at the top of the page, select User Events


The third thing to verify is that the user account actually has permissions to access the table in the selectRows statement, by logging into the LabKey Server as that user and using the schemaBrowser.
 
michael_stover responded:  2012-07-18 09:37
Thanks Brian. The problem was authentication, but not in the _netrc file, but rather in its location. We had it in the user's home directory, which is where it is for me and another user for whom it works. For this one user, it needed to be in her "Documents" directory (on windows), because for her, R is putting the libraries under \home\Documents\R\win-library rather than \home\R\win-library.

I'm not sure what causes this difference in R installation or why Rlabkey changes where it searches for _netrc depending on where it is located. Maybe it is making assumptions about where it is located by default and doing a relative path search?