I've built a model using tidymodels (an XGBoost model forecasting business event counts) and deployed it as a plumber API to Posit Connect (via vetiver). The API itself was deployed without error, however, when I try and get predictions from it, either in R or in the browser, it returns
"500 - Internal server error". The API logs offer a little more detail:
<simpleError in Sys.setlocale("LC_TIME", locale): (converted from warning) OS reports request to set locale to "English_United Kingdom.utf8" cannot be honored>
The locale details in the API logs state:
LANG: C.UTF-8, but using
Sys.getlocale() to get my locale settings, I get the following:
"LC_COLLATE=English_United Kingdom.utf8;LC_CTYPE=English_United Kingdom.utf8;LC_MONETARY=English_United Kingdom.utf8;LC_NUMERIC=C;LC_TIME=English_United Kingdom.utf8"
I did try specifying
LC_ALL=C in .Renviron (it was a bit of a shot in the dark), but this didn't resolve the error.
The Connect server version is 188.8.131.52 and the Connect R version is 4.0.4. Finally, my
sessionInfo() when I deploy the API:
R version 4.2.1 (2022-06-23 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19044) Matrix products: default locale:  LC_COLLATE=English_United Kingdom.utf8 LC_CTYPE=English_United Kingdom.utf8  LC_MONETARY=English_United Kingdom.utf8 LC_NUMERIC=C  LC_TIME=English_United Kingdom.utf8 attached base packages:  stats graphics grDevices datasets utils methods base other attached packages:  vetiver_0.1.8 workflows_1.1.2 tune_1.0.1 yardstick_1.1.0 parsnip_1.0.3 timetk_2.8.2 recipes_1.0.3  rsample_1.1.0 ggplot2_3.4.0 dplyr_1.0.10 loaded via a namespace (and not attached):  ggtext_0.1.2 fs_1.5.2 xts_0.12.2 lubridate_1.9.0 bit64_4.0.5  DiceDesign_1.9 httr_1.4.4 tools_4.2.1 utf8_1.2.2 R6_2.5.1  rpart_4.1.19 DBI_1.1.3 colorspace_2.0-3 nnet_7.3-18 withr_2.5.0  tidyselect_1.2.0 bit_4.0.5 curl_4.3.3 compiler_4.2.1 cli_3.4.1  swagger_3.33.1 xml2_1.3.3 scales_1.2.1 readr_2.1.3 askpass_1.1  odbc_1.3.3 rappdirs_0.3.3 plumber_1.2.1 stringr_1.4.1 digest_0.6.30  webutils_1.1 pkgconfig_2.0.3 parallelly_1.32.1 lhs_1.1.5 rlang_1.0.6  rstudioapi_0.14 generics_0.1.3 zoo_1.8-11 jsonlite_1.8.3 vroom_1.6.0  magrittr_2.0.3 Matrix_1.5-3 Rcpp_1.0.9 munsell_0.5.0 fansi_1.0.3  GPfit_1.0-8 lifecycle_1.0.3 furrr_0.3.1 stringi_1.7.8 yaml_2.3.6  snakecase_0.11.0 MASS_7.3-58.1 grid_4.2.1 blob_1.2.3 promises_184.108.40.206  parallel_4.2.1 listenv_0.8.0 crayon_1.5.2 lattice_0.20-45 splines_4.2.1  gridtext_0.1.5 hms_1.1.2 pillar_1.8.1 dials_1.1.0 future.apply_1.10.0  codetools_0.2-18 glue_1.6.2 packrat_0.8.1 renv_0.16.0 vctrs_0.5.1  tzdb_0.3.0 foreach_1.5.2 openssl_2.0.4 gtable_0.3.1 purrr_0.3.5  tidyr_1.2.1 future_1.29.0 pins_1.0.3 gower_1.0.0 janitor_2.1.0  prodlim_2019.11.13 later_1.3.0 rsconnect_0.8.28 class_7.3-20 survival_3.4-0  timeDate_4021.106 tibble_3.1.8 iterators_1.0.14 hardhat_1.2.0 lava_1.7.0  timechange_0.1.1 globals_0.16.2 ellipsis_0.3.2 ipred_0.9-13
I'm a little bit stumped as to what to do to resolve this error, so I suspect that I'm also not giving all the relevant information that folks will need to help (though I've included everything that I thought might be useful). Let me know if anything is missing and I can update.
Any help would be greatly appreciated!