Skip to content

API should not use /var/root on OS X #180

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

Closed
brianboonstra opened this issue Mar 9, 2015 · 6 comments
Closed

API should not use /var/root on OS X #180

brianboonstra opened this issue Mar 9, 2015 · 6 comments

Comments

@brianboonstra
Copy link

The API attempts to store credentials in /var/root, at least on my OS X Yosemite installation via MacPorts. This (rightly) fails due to permission problems.

Traditionally on OS X this type of thing is stored in something like $HOME/Library/Preferences/com.plotly.plist. Python probably has a good defaults module for it.

@chriddyp
Copy link
Member

chriddyp commented Mar 9, 2015

Yikes! Thanks for reporting. We were supposed to install it your home directory, ~, which used to be something like /Users/chris: https://github.com/ropensci/plotly/blob/master/R/tools.R#L4.

Where does $ cd ~ take you?

cc @theengineear

@brianboonstra
Copy link
Author

cd ~ takes me to /Users/brian. Please note I got mixed up about Python/Macports being involved. The issue is specific to the R API, and occurs whether I am running normally in RStudio or I am using an R kernel within iPython/Jupyter v3.0.0. R was installed via downloading the dmg from CRAN, not via Macports.

Is it perhaps related to the fact that I was running an R session as root when I did the install_github("ropensci/plotly") ?

@brianboonstra
Copy link
Author

Perhaps directory expansion does not work as expected during package load? Here is a direct transcript:

> py <- plotly('brianboonstra',  '<deleted>')
Error in if (file.info(CONFIG_FILE)$size) { : 
  argument is not interpretable as logical
In addition: Warning message:
In file.create(abspath) :
  cannot create file '/var/root/.plotly/.config', reason 'Permission denied'
> file.path(path.expand("~"), ".plotly")
[1] "/Users/brian/.plotly"

@bogdanrau
Copy link

Any updates to this? I'm running into the same issue on a Ubuntu 14.04 box, my path is:

[1] "Your credentials file:"
Error in if (file.info(CREDENTIALS_FILE)$size) { : 
  argument is not interpretable as logical
In addition: Warning message:
In file.create(abspath) :
  cannot create file '/root/.plotly/.credentials', reason 'Permission denied'
> file.path(path.expand("~"), ".plotly")
[1] "/home/[user]/.plotly"

with [user] being a specific username on the system. I should mention that I also installed this as ROOT, though it seems like it's trying to create the credentials file in the correct folder.

@Varshul
Copy link

Varshul commented May 20, 2015

Even I installed it as a root user, doesn't seem to work at all.
Warning in file.create(abspath) :
cannot create file '/root/.plotly/.credentials', reason 'Permission denied'
Error in if (file.info(CREDENTIALS_FILE)$size) { :
argument is not interpretable as logical

Even Though the CREDENTIALS_FILE does exist having non logical size, it doesn't seem to work.

Is there any solution to it ?

@cpsievert cpsievert added this to the v1.0 milestone May 30, 2015
@cpsievert cpsievert mentioned this issue Jun 3, 2015
@cpsievert
Copy link
Collaborator

Version 1.0 no longer requires credentials to be stored in this location. Instead, you can store credentials with:

Sys.setenv("plotly_username"="your_plotly_username")
Sys.setenv("plotly_api_key"="your_api_key")

If you want these credentials to be loaded on startup, put this code in your ~/.Rprofile

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

5 participants