-
Notifications
You must be signed in to change notification settings - Fork 62
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
Error when using pin_upload() in a pin board created by board_gdrive() #777
Comments
I think the problem is how you are specifying the Google Drive location
Can you use your URL to make a "dribble" or in To check out a working example, see how I specify my folder: library(pins)
board <- board_gdrive("pins-testing")
#> ! Using an auto-discovered, cached token.
#> To suppress this message, modify your code or options to clearly consent to
#> the use of a cached token.
#> See gargle's "Non-interactive auth" vignette for more details:
#> <https://gargle.r-lib.org/articles/non-interactive-auth.html>
#> ℹ The googledrive package is using a cached token for '[email protected]'.
board |> pin_list()
#> character(0)
path <- fs::path_temp("some-letters.txt")
readr::write_lines(sample(LETTERS, size = 20), path)
pin_upload(board, paths = path, name = "really-great-letters")
#> Creating new version '20230901T202058Z-56115'
board |> pin_list()
#> [1] "really-great-letters" Created on 2023-09-01 with reprex v2.0.2 |
Thanks for the quick answer Julia! With
Also, when using your example (I created the I also tried adapting your example and uploading a file with a normalizePath(), just in case. Nothing worked. I attach my session info in case helps debug this. library(pins)
board <- board_gdrive("pins-testing")
#> ! Using an auto-discovered, cached token.
#> To suppress this message, modify your code or options to clearly consent to
#> the use of a cached token.
#> See gargle's "Non-interactive auth" vignette for more details:
#> <https://gargle.r-lib.org/articles/non-interactive-auth.html>
#> ℹ The googledrive package is using a cached token for '[email protected]'.
board |> pin_list()
#> [1] "really-great-letters" "really-great-letters2"
> pin_upload(board, paths = normalizePath("~/Downloads/ASD/chart.csv"), name = "really-great-letters3)
Creating new version '20230902T065741Z-afc30'
#> Nothing happens for a loong time Created on 2023-09-02 with reprex v2.0.2 Session infosessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.3.1 (2023-06-16)
#> os Ubuntu 22.04.3 LTS
#> system x86_64, linux-gnu
#> ui X11
#> language en_US:en
#> collate en_US.UTF-8
#> ctype en_US.UTF-8
#> tz Atlantic/Canary
#> date 2023-09-02
#> pandoc 3.1.1 @ /usr/lib/rstudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date (UTC) lib source
#> askpass 1.1 2019-01-13 [1] RSPM (R 4.3.0)
#> cli 3.6.1 2023-03-23 [1] RSPM (R 4.3.0)
#> curl 5.0.2 2023-08-14 [1] RSPM (R 4.3.0)
#> digest 0.6.33 2023-07-07 [1] RSPM (R 4.3.0)
#> dplyr 1.1.2 2023-04-20 [1] RSPM (R 4.3.0)
#> ellipsis 0.3.2 2021-04-29 [1] RSPM (R 4.3.0)
#> evaluate 0.21 2023-05-05 [1] RSPM (R 4.3.0)
#> fansi 1.0.4 2023-01-22 [1] RSPM (R 4.3.0)
#> fastmap 1.1.1 2023-02-24 [1] RSPM (R 4.3.0)
#> fs 1.6.3 2023-07-20 [1] RSPM (R 4.3.0)
#> gargle 1.5.2 2023-07-20 [1] RSPM (R 4.3.0)
#> generics 0.1.3 2022-07-05 [1] RSPM (R 4.3.0)
#> glue 1.6.2 2022-02-24 [1] RSPM (R 4.3.0)
#> googledrive 2.1.1 2023-06-11 [1] RSPM (R 4.3.0)
#> htmltools 0.5.6 2023-08-10 [1] RSPM (R 4.3.0)
#> httr 1.4.7 2023-08-15 [1] RSPM (R 4.3.0)
#> jsonlite 1.8.7 2023-06-29 [1] RSPM (R 4.3.0)
#> knitr 1.43 2023-05-25 [1] RSPM (R 4.3.0)
#> lifecycle 1.0.3 2022-10-07 [1] RSPM (R 4.3.0)
#> magrittr 2.0.3 2022-03-30 [1] RSPM (R 4.3.0)
#> openssl 2.1.0 2023-07-15 [1] RSPM (R 4.3.0)
#> pillar 1.9.0 2023-03-22 [1] RSPM (R 4.3.0)
#> pins * 1.2.1 2023-08-16 [1] RSPM (R 4.3.0)
#> pkgconfig 2.0.3 2019-09-22 [1] RSPM (R 4.3.0)
#> purrr 1.0.2 2023-08-10 [1] RSPM (R 4.3.0)
#> R.cache 0.16.0 2022-07-21 [1] RSPM (R 4.3.0)
#> R.methodsS3 1.8.2 2022-06-13 [1] RSPM (R 4.3.0)
#> R.oo 1.25.0 2022-06-12 [1] RSPM (R 4.3.0)
#> R.utils 2.12.2 2022-11-11 [1] RSPM (R 4.3.0)
#> R6 2.5.1 2021-08-19 [1] RSPM (R 4.3.0)
#> rappdirs 0.3.3 2021-01-31 [1] RSPM (R 4.3.0)
#> reprex 2.0.2 2022-08-17 [1] RSPM (R 4.3.0)
#> rlang 1.1.1 2023-04-28 [1] RSPM (R 4.3.0)
#> rmarkdown 2.24 2023-08-14 [1] RSPM (R 4.3.0)
#> rstudioapi 0.15.0 2023-07-07 [1] RSPM (R 4.3.0)
#> sessioninfo 1.2.2 2021-12-06 [1] RSPM
#> styler 1.10.1 2023-06-05 [1] RSPM (R 4.3.0)
#> tibble 3.2.1 2023-03-20 [1] RSPM (R 4.3.0)
#> tidyselect 1.2.0 2022-10-10 [1] RSPM (R 4.3.0)
#> utf8 1.2.3 2023-01-31 [1] RSPM (R 4.3.0)
#> vctrs 0.6.3 2023-06-14 [1] RSPM (R 4.3.0)
#> withr 2.5.0 2022-03-03 [1] RSPM (R 4.3.0)
#> xfun 0.40 2023-08-09 [1] RSPM (R 4.3.0)
#> yaml 2.3.7 2023-01-23 [1] RSPM (R 4.3.0)
#>
#> [1] /home/emrys/R/x86_64-pc-linux-gnu-library/4.3
#> [2] /usr/local/lib/R/site-library
#> [3] /usr/lib/R/site-library
#> [4] /usr/lib/R/library
#>
#> ────────────────────────────────────────────────────────────────────────────── Thanks! |
So those items If you have a local googledrive::drive_upload(
path,
fs::path(board$dribble$path, "20230405T060708Z-xxxxx", fs::path_file(path))
) |
Yes, exactly, the folders are created but the pin contents (files) are not uploaded. Uploading a file using your code also get's stuck. No errors, no feedback. The only way I got it to work was by using a Dribble to the desired folder in the file_to_upload <- fs::path_temp("some-letters.txt")
readr::write_lines(sample(LETTERS, size = 20), file_to_upload)
DRIBBLE = googledrive::as_dribble("https://drive.google.com/drive/folders/1rZyqHbpVJ0ZPoOxXtwYGexQ-FegEXGtN")
#> ! Using an auto-discovered, cached token.
#> To suppress this message, modify your code or options to clearly consent to
#> the use of a cached token.
#> See gargle's "Non-interactive auth" vignette for more details:
#> <https://gargle.r-lib.org/articles/non-interactive-auth.html>
#> ℹ The googledrive package is using a cached token for '[email protected]'.
googledrive::drive_upload(
media = file_to_upload,
path = DRIBBLE,
name = fs::path_file(file_to_upload)
)
#> Local file:
#> • '/tmp/RtmpeklPCr/some-letters.txt'
#> Uploaded into Drive file:
#> • 'some-letters.txt' <id: 1QXSWb1lkf6iOWRewEstOfusn3RA4hGti>
#> With MIME type:
#> • 'text/plain' It seems that using an actual folder path in the
|
Hmmmm, this is definitely not something I have experienced. Can you use that working dribble as the first argument to |
I created a pull request that seems to solve the issue. The fix is very simple, just use a dribble for the path argument of According to the old googledrive issue mentioned above, in Google Drives with a lot of files and folders (I have > 1TB), it is important to be as specific as possible. For whatever reason, using the full path to the file ( |
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
Hi there. I am trying to use a Shared Google Drive folder to create pin boards to upload and download files.
If I do that with a local folder with
board_folder()
, everything works fine. But I can't makeboard_gdrive()
work with a shared Google Drive folder.The containing folders for the pin board are created, but the file never uploads, and I get some errors and warnings.
Created on 2023-09-01 with reprex v2.0.2
Thanks!
The text was updated successfully, but these errors were encountered: