Problem accessing data with RLabkey package

LabKey Support Forum
Problem accessing data with RLabkey package laurapas  2015-01-13 15:34
Status: Closed
 
Hi,
This is similar to the issue submitted by michael_stover@urmc.rochester.edu    on 2012-07-17 13:00. I am getting the following Error when using labkey.selectRows(). Could someone help me understand what this means?

Error in labkey.selectRows(baseUrl = "https://labkey-test.roche.com:8443/labkey", :
  HTTP request was unsuccessful. Status code = 401, Error message = Found
 
 
Jon (LabKey DevOps) responded:  2015-01-13 16:19
Laura,

I found the issue that Michael submitted back in 2012 here: https://www.labkey.org/announcements/home/Developer/Forum/thread.view?entityId=1dba004f-b262-102f-ac60-987439a648f8&_docid=thread%3A1dba004f-b262-102f-ac60-987439a648f8

According to the information from back then, it looks like there is a problem with authentication since it's a 401 error message.

Can you verify if your netrc file is configured correctly? (See documentation: https://www.labkey.org/wiki/home/Documentation/page.view?name=netrc)

Also, the specific problem that Michael brought up was isolated to where the netrc file was located in, so I would recommend verifying whether the file has to live on \home\Documents\R\win-library vs \home\R\win-library on your Windows machine.

Regards,

Jon
 
laurapas responded:  2015-01-14 16:22
Hi Jon,
I can't see to get the right location. I am on a mac and have placed it here: /Library/Frameworks/R.framework/Versions/3.1/Resources/library. I also tried my home directory on the mac, but it's not working there either. Can you tell me where RLabkey searches for the .netrc file on a mac?

Regards,
Laura
 
Jon (LabKey DevOps) responded:  2015-01-14 16:35
Laura,

It should be on your home directory, so on a Mac it would be /Users/USERNAME. So on my Mac for example, it would be /Users/jonyoon.

The permissions on the file should also be only readable to you. If you use the Finder on your Mac, you should be able to search for that .netrc file, Control+Click and select Get Info, then expand the Sharing & Permissions section at the bottom of that info screen.

Can you verify the permissions you have setup on that .netrc file in either directory location on your Mac?

Regards,

Jon
 
laurapas responded:  2015-01-14 16:50
Hi Jon,
Thanks for your quick reply. I put it on my home directory.

/Users/laurapas
laurapas-JBG3QJ:~ laurapas$ ls -al .netrc
-r--------@ 1 laurapas staff 84 Jan 14 16:42 .netrc

Now, I get a new message. Perhaps I did something wrong in the .netrc file?

Error in function (type, msg, asError = TRUE) :
  Failed connect to labkey-test.roche.com:443; Connection refused

Here's what I have in my file, as per the instructions. The Xs aren't my actual password....just an example.

machine https://labkey-test.roche.com:8443 login laurapas@gene.com password XXXXXXX
 
Jon (LabKey DevOps) responded:  2015-01-14 16:56
Laura,

The machine name looks a little different than our docs. I don't think you need the https:// part.

Can you change it to this and give it another try?

machine labkey-test.roche.com:8443 login laurapas@gene.com password XXXXXXX

Regards,

Jon
 
laurapas responded:  2015-01-14 17:03
Hi Jon,
Unfortunately, I still get the 'Connection refused' error message. I'm able to log in via the web and access the files; I'm having a problem accessing with RLabkey , e.g., labkey.selectRows().

Regards,
Laura
 
laurapas responded:  2015-01-14 23:10
Hi Jon,
I didn't see the last line of the .netrc documentation earlier: "The _netrc file only deals with connections at the machine level and does not include a port or protocol designation.". So, I removed the port # and it is fine now.
 
Jon (LabKey DevOps) responded:  2015-01-15 09:59
Laura,

Thanks for catching that! I've updated our documentation so that section stands out.

Regards,

Jon