404 error writing a pin to Posit Connect
pins
Connect
R
upgrade
Abstract
{pins} versions before 1.0.0 are not compatible with Connect 2024.05 and later, resulting in a 404 error when attempting to write a pin.
Description
{pins} versions before 1.0.0 are not compatible with Connect 2024.05 or later. The pre-1.0.0 API looks like this:
R
library(pins)
board_register_rsconnect(
server = Sys.getenv("CONNECT_SERVER"),
key = Sys.getenv("CONNECT_API_KEY")
)
pin(df, name = "my_pin", board = "rsconnect")Connect 2024.05 or later returns the following error:
Console output
Error in board_pin_create.rsconnect(board, store_path, name = name, metadata = metadata, :
Failed to create pin: Operation failed with status 404: 404 page not found
Calls: local ... board_pin_store -> board_pin_create -> board_pin_create.rsconnectSolution
{pins} 1.0.0 introduced board_connect(), an API compatible with all supported versions of Connect. Upgrade to 1.0.0 or later and replace the old workflow:
R
library(pins)
board <- board_connect(
server = Sys.getenv("CONNECT_SERVER"),
key = Sys.getenv("CONNECT_API_KEY")
)
pin_write(board, df, name = "my_pin")After updating {pins}, re-deploy the application to Connect. If the project uses {renv}, run renv::snapshot() before re-deploying to capture the current dependency versions.
If you’re still having issues, you can reach out to Support by opening a ticket.