Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't log in with .synapseConfig #330

Open
lopierra opened this issue Feb 23, 2024 · 7 comments
Open

Can't log in with .synapseConfig #330

lopierra opened this issue Feb 23, 2024 · 7 comments

Comments

@lopierra
Copy link

lopierra commented Feb 23, 2024

Operating system

Windows 11
My Home directory is a OneDrive (ugh) folder, not sure if that is relevant

Description of the problem

I just installed the latest {synapser} on my new laptop. I got a personal auth token from Synapse and created a .synapseConfig file in my Home directory, but synLogin() returns Error in value[[3L]](cond) : No credentials provided.

I am able to log in with synLogin(authToken = "<my_token>") so the token seems to be working.

My .synapseConfig file looks like this:

[authentication]
authtoken = eyJ0eXAiOiJKV1QiLCJra..etc. [no quotes]

Output of sessionInfo()

R version 4.3.2 (2023-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22631)

Matrix products: default


locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

time zone: America/Los_Angeles
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] synapser_2.0.0.200

loaded via a namespace (and not attached):
 [1] utf8_1.2.4        codetools_0.2-19  Matrix_1.6-1.1    lattice_0.21-9   
 [5] rjson_0.2.21      reticulate_1.35.0 glue_1.7.0        png_0.1-8        
 [9] lifecycle_1.0.4   cli_3.6.2         fansi_1.0.6       vctrs_0.6.5      
[13] grid_4.3.2        compiler_4.3.2    rstudioapi_0.15.0 tools_4.3.2      
[17] pillar_1.9.0      Rcpp_1.0.12       rlang_1.1.3       jsonlite_1.8.8   
@lopierra
Copy link
Author

Also, hiii 👋 😁

@thomasyu888
Copy link
Member

thomasyu888 commented Feb 24, 2024

Hi @lopierra! Good to see you here.

Ah, sorry for the troubles! We have had troubles with OneDrive in the past as it's a 'virtual' file system - not sure that will work. Instead of using the config file, can you try setting a system environmental variable. Id have to look at what that looks like on Windows but on a Mac terminal.

export  SYNAPSE_AUTH_TOKEN=...

I'll have the team take a closer look on Monday when we are back in.

@lopierra
Copy link
Author

I think that worked - thanks @thomasyu888 !

In my Home directory (the OneDrive folder), I created a .Renviron file with SYNAPSE_AUTH_TOKEN=...
Restarted R and am now able to log in using synLogin()

No idea why it couldn't find my .synapseConfig file but seems to be able to find the .Renviron file 🤷

@thomasyu888
Copy link
Member

I think that worked - thanks @thomasyu888 !

In my Home directory (the OneDrive folder), I created a .Renviron file with SYNAPSE_AUTH_TOKEN=...
Restarted R and am now able to log in using synLogin()

No idea why it couldn't find my .synapseConfig file but seems to be able to find the .Renviron file 🤷

Awesome! I'll make sure to create a ticket so we add this to the documentation for OneDrive users.

Can it find the synapse cache folder?

@lopierra
Copy link
Author

Not sure - where do I find that?

@thomasyu888
Copy link
Member

Not sure - where do I find that?

Can you try downloading a file with synapser? It will download a file somewhere onto your drive (maybe OneDrive) just wanted to make sure it works.

@lopierra
Copy link
Author

test_download <- synGet("syn51216461")
test_download$path

resulted in

[1] "c:\\users\\lopi\\.synapsecache\\340\\124656340\\all_cohorts_study_2023-05-17.csv"

That's on my local machine - my "Home" folder according to Sys.getenv("R_USER") is

C:/Users/lopi/OneDrive - The University of Colorado Denver/Documents

But regardless, it is saving it to synapse cache, so I think that's working properly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants