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

Chat fails when dependency libraries are installed read only #244

Closed
natashanath opened this issue Jan 6, 2025 · 6 comments
Closed

Chat fails when dependency libraries are installed read only #244

natashanath opened this issue Jan 6, 2025 · 6 comments

Comments

@natashanath
Copy link

Ollama chat using elmer fails when dependency libraries are installed read only

library(S7)
library(httr2)
library(coro)
library(shinychat)
library(elmer)

chat <- chat_ollama(
  model = 'zephyr7b',
  system_prompt = 'You are a friendly but terse coding assistant. You are an expert in R, Python, SQL.',
  echo = TRUE
)
elmer::live_browser(chat)
# UI error displayed:
An error occurred: inherits(pool, "curl_multi") is not TRUE
# Error in debugging:
Warning in file.copy(from, to, ...) :
  problem copying /path/to/R/library/bslib/lib/bs3/assets/fonts/bootstrap/glyphicons-halflings-regular.eot to /path/to/tmp/bslib-precompiled-5/fonts/bootstrap/glyphicons-halflings-regular.eot: Permission denied
Warning in file.copy(from, to, ...) :
  problem copying /path/to/R/library/bslib/lib/bs3/assets/fonts/bootstrap/glyphicons-halflings-regular.svg to /path/to/tmp/bslib-precompiled-5/fonts/bootstrap/glyphicons-halflings-regular.svg: Permission denied
Warning in file.copy(from, to, ...) :
  problem copying /path/to/R/librarybslib/lib/bs3/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf to /path/to/tmp/bslib-precompiled-5/fonts/bootstrap/glyphicons-halflings-regular.ttf: Permission denied
Warning in file.copy(from, to, ...) :
  problem copying /path/to/R/library/bslib/lib/bs3/assets/fonts/bootstrap/glyphicons-halflings-regular.woff to /path/to/tmp/bslib-precompiled-5/fonts/bootstrap/glyphicons-halflings-regular.woff: Permission denied
Warning in file.copy(from, to, ...) :
  problem copying /path/to/R/library/bslib/lib/bs3/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 to /path/to/tmp/bslib-precompiled-5/fonts/bootstrap/glyphicons-halflings-regular.woff2: Permission denied

In enterprise settings it is not uncommon to have a centralized library of packages where everything is installed read-only and maintained by designated users/teams. Another use case which is quickly gaining popularity is using Nix package manager for maintaining data science environments. Nix installs everything read-only.

@hadley
Copy link
Member

hadley commented Jan 6, 2025

The error looks like it's associated with copying to a temporary directory?

@natashanath
Copy link
Author

The source files have read-only permissions and result in an error when copied to the temporary directory.

One solution would be to add copy.mode = FALSE to the file.copy calls, so that the file mode attributes are not preserved.
Is there a way to identify where in the source code this file copy is happening and be modified?

@hadley
Copy link
Member

hadley commented Jan 6, 2025

Given the paths involved, I suspect it's from the bslib package.

@natashanath
Copy link
Author

Yes, that is correct. I believe this is where the file copy is happening in bslib that is also copying over the file mode attributes:
https://github.com/rstudio/bslib/blob/b54bfb5de82f76bc044c4c661995af3a63e7ab29/R/bs-dependencies.R#L88

@hadley
Copy link
Member

hadley commented Jan 6, 2025

Can you file an issue at bslib please?

@hadley
Copy link
Member

hadley commented Jan 10, 2025

Closing this issue, since it seems like the root cause is bslib.

@hadley hadley closed this as completed Jan 10, 2025
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