Closed dewoller closed 2 years ago
The server is Connecting to RSC 2021.08.0
pin_read returns the same error:
myboard = pins::board_rsconnect(key = Sys.getenv("CONNECT_API_KEY"),
server = Sys.getenv("CONNECT_SERVER"))
pins::pin_read("XXXX", board = myboard)
Error: Condition message must be a string
Can you please provide a traceback?
Gladly!
> rlang::last_error()
<error/rlang_error>
Condition message must be a string
Backtrace:
1. pins::pin_get("abc", board = "rsconnect")
3. pins:::board_pin_get.pins_board_rsconnect(...)
5. pins:::pin_fetch.pins_board_rsconnect(...)
7. pins:::pin_meta.pins_board_rsconnect(board, name, version = version)
8. base::tryCatch(...)
9. base:::tryCatchList(expr, classes, parentenv, handlers)
10. base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
11. value[[3L]](cond)
12. pins:::abort_pin_version_missing(version)
13. rlang::abort(glue("Can't find version '{version}'"), class = "pins_pin_version_missing")
14. rlang::error_cnd(...)
Run `rlang::last_trace()` to see the full context.
> rlang::last_trace()
<error/rlang_error>
Condition message must be a string
Backtrace:
x
1. \-pins::pin_get("abc", board = "rsconnect")
2. +-pins::board_pin_get(...)
3. \-pins:::board_pin_get.pins_board_rsconnect(...)
4. +-pins::pin_fetch(board, name, version = version, ...)
5. \-pins:::pin_fetch.pins_board_rsconnect(...)
6. +-pins::pin_meta(board, name, version = version)
7. \-pins:::pin_meta.pins_board_rsconnect(board, name, version = version)
8. \-base::tryCatch(...)
9. \-base:::tryCatchList(expr, classes, parentenv, handlers)
10. \-base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
11. \-value[[3L]](cond)
12. \-pins:::abort_pin_version_missing(version)
13. \-rlang::abort(glue("Can't find version '{version}'"), class = "pins_pin_version_missing")
14. \-rlang::error_cnd(...)
Fortunately, the other bug I am having (unable to write a pin with pin_write twice) looks like the same problem. Thanks for the help!
> pin_write(iris, name='abcd', board=board) ### Writing the pin for the second time
Guessing `type = 'rds'`
Error in rsc_check_status(req) : Forbidden (HTTP 403).
> rlang::last_trace()
<error/rlang_error>
Condition message must be a string
Backtrace:
x
1. \-pins::pin_read("abc", board = board)
2. +-pins::pin_fetch(board, name, version = version, ...)
3. \-pins:::pin_fetch.pins_board_rsconnect(...)
4. +-pins::pin_meta(board, name, version = version)
5. \-pins:::pin_meta.pins_board_rsconnect(board, name, version = version)
6. \-base::tryCatch(...)
7. \-base:::tryCatchList(expr, classes, parentenv, handlers)
8. \-base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
9. \-value[[3L]](cond)
10. \-pins:::abort_pin_version_missing(version)
11. \-rlang::abort(glue("Can't find version '{version}'"), class = "pins_pin_version_missing")
12. \-rlang::error_cnd(...)
>
What does packageVersion("rlang")
return?
Good morning Hadley. Initially, packageVersion("rlang") returned 0.4.5.
When I reinstalled rlang (install.packages('rlang')), packageVersion("rlang") returned 0.4.11, but this did not fix either problem.
Hi @hadley , I dove into the code, learned a heap about good coding practice, and found part of the problem.
Unfortunately, this particular error message (Error: Condition message must be a string) is a trivial one, due to not initialising version in the _pin_meta.pins_boardrsconnect function. Because I do not pass in a version, when the http process crashes, the error message refers to the null version, not the underlying http failure.
You could fix this by checking for null version in _abort_pin_versionmissing, or by passing in _bundleid instead of version.
Fixing this would help debugging the underlying http errors.
@dewoller sorry for taking so long to get back to this; I see what you mean about the error, and I've at least fixed that so you'll now get a meaningful message. I'll hopefully fix the meat of your problem in the near future.
This works for me:
devtools::install_version("pins", "0.4.5")
library(pins)
board_register_rsconnect(server = "colorado.rstudio.com")
pin(mtcars, "pins-old", board = "rsconnect")
# -------- Restart R ----------
pak::pak("pins")
library(pins)
board <- board_rsconnect(server = "colorado.rstudio.com")
board %>% pin_read("pins-old")
pin_get("pins-old", board = board)
So there must be something else going on.
@dewoller any chance you could try out the dev version in the next couple of days? I'd really like to get a pins release out before Christmas, and I want to double check that I've actually fixed your issue.
Oh thanks for that Hadley. I greatly appreciate this, and all the nest tending you do around the R ecosystem.
I believe that particular error is fixed. I can read all my pins now. There is one little bug / feature still, but I am not sure if it is intended. I cannot read a pin using pin_get that was written by pin_write.
library(pins)
board =
pins::board_register_rsconnect(key = Sys.getenv("CONNECT_API_KEY"), server = Sys.getenv("CONNECT_SERVER"))
#> Connecting to RSC 2021.11.0 at <XXXX>
iris_small = head(iris, 5 )
pin( board=board, name="dennis.wollersheim@XXXX/abcde", x=iris_small)
pin_get("dennis.wollersheim@XXXX/abcde", board=board)
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1 5.1 3.5 1.4 0.2 setosa
#> 2 4.9 3.0 1.4 0.2 setosa
#> 3 4.7 3.2 1.3 0.2 setosa
#> 4 4.6 3.1 1.5 0.2 setosa
#> 5 5.0 3.6 1.4 0.2 setosa
pin_read("dennis.wollersheim@XXXX/abcde", board=board)
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1 5.1 3.5 1.4 0.2 setosa
#> 2 4.9 3.0 1.4 0.2 setosa
#> 3 4.7 3.2 1.3 0.2 setosa
#> 4 4.6 3.1 1.5 0.2 setosa
#> 5 5.0 3.6 1.4 0.2 setosa
pin_write( board=board, name="dennis.wollersheim@XXXX/abcde", x=iris_small)
#> Guessing `type = 'rds'`
#> Writing to pin 'dennis.wollersheim@XXXX/dennis.wollersheim@XXXX/abcde'
pin_read("dennis.wollersheim@XXXX/abcde", board=board)
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1 5.1 3.5 1.4 0.2 setosa
#> 2 4.9 3.0 1.4 0.2 setosa
#> 3 4.7 3.2 1.3 0.2 setosa
#> 4 4.6 3.1 1.5 0.2 setosa
#> 5 5.0 3.6 1.4 0.2 setosa
pin_get("dennis.wollersheim@XXXX/abcde", board=board)
#> Warning in gzfile(file, "rb"): cannot open compressed file 'C:/Users/
#> dwol3009/AppData/Local/pins/pins/Cache/rsc-e62371cfd77db754024f9c5ed3556a73/
#> c66379b8-57d1-4f99-8f61-d2b9f6d22d62/27131/data.rds', probable reason 'No such
#> file or directory'
#> Error in gzfile(file, "rb"): cannot open the connection
Created on 2021-12-14 by the reprex package (v2.0.1)
Yeah, that's by design — pins is only backward compatible, not forward compatible (i.e. the modern board can read legacy pins, but the legacy board can't read modern pins).
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.
The same pin_get command under pins_1.0.0.9000 returns the following error:
The same error occurs using the new api method:
I would like to be able to use the new package.