Unfortunately, I found an error that is not reproducible. I run a job scheduled by ariflow to start a docker container to run my R script processing api.
Part of code is something like the following
library(openssl)
library(jsonlite)
library(tidyverse)
library(httr)
library(DBI)
library(lubridate)
readr::write_rds(es4, "es4.rds") # save rds for debugging
es6 <- es4 %>%
mutate(escrow_item = map(content, function(x) {
items <- pluck(x, "items")
items <- items %>%
map(as_tibble) %>%
map(~mutate_at(., c("credit_card_promotion",
"discount_from_coin",
"discount_from_voucher",
"seller_rebate",
"discount_from_voucher_seller",
"original_price",
"discounted_price",
"deal_price"),
as.numeric) %>%
mutate(item_id = bit64::as.integer64(as.character(item_id)),
variation_id = bit64::as.integer64(as.character(variation_id))))
reduce(items, bind_rows)
} )) %>%
select(-Token1, -Token2, -Token3, -response, -content) %>%
unnest()
I got the following error in the logs
Error in bind_rows_(x, .id) :
STRING_ELT() can only be applied to a 'character vector', not a 'raw'
Calls: %>% ... unnest -> unnest.data.frame -> map -> .f -> bind_rows_
However, when I rerun the code with the saved rds in a docker container of the same image, there is no error.
Then I retried the job, this time it success. It is so strange.
Should I use other function to bind a list of dataframes than bind_rows
? If yes, any suggestion?
Session info
> devtools::session_info()
Failed to create bus connection: No such file or directory
─ Session info ───────────────────────────────────────────────────────────────
setting value
version R version 3.5.2 (2018-12-20)
os Debian GNU/Linux 9 (stretch)
system x86_64, linux-gnu
ui X11
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz Etc/UTC
date 2019-03-02
─ Packages ───────────────────────────────────────────────────────────────────
package * version date lib source
askpass 1.1 2019-01-13 [1] CRAN (R 3.5.2)
assertthat 0.2.0 2017-04-11 [1] CRAN (R 3.5.2)
backports 1.1.3 2018-12-14 [1] CRAN (R 3.5.2)
bindr 0.1.1 2018-03-13 [1] CRAN (R 3.5.2)
bindrcpp 0.2.2 2018-03-29 [1] CRAN (R 3.5.2)
broom 0.5.1 2018-12-05 [1] CRAN (R 3.5.2)
callr 3.1.1 2018-12-21 [1] CRAN (R 3.5.2)
cellranger 1.1.0 2016-07-27 [1] CRAN (R 3.5.2)
cli 1.0.1 2018-09-25 [1] CRAN (R 3.5.2)
colorspace 1.4-0 2019-01-13 [1] CRAN (R 3.5.2)
crayon 1.3.4 2017-09-16 [1] CRAN (R 3.5.2)
data.table 1.12.0 2019-01-13 [1] CRAN (R 3.5.2)
DBI * 1.0.0 2018-05-02 [1] CRAN (R 3.5.2)
desc 1.2.0 2018-05-01 [1] CRAN (R 3.5.2)
devtools 2.0.1 2018-10-26 [1] CRAN (R 3.5.2)
digest 0.6.18 2018-10-10 [1] CRAN (R 3.5.2)
dplyr * 0.7.8 2018-11-10 [1] CRAN (R 3.5.2)
forcats * 0.3.0 2018-02-19 [1] CRAN (R 3.5.2)
fs 1.2.6 2018-08-23 [1] CRAN (R 3.5.2)
generics 0.0.2 2018-11-29 [1] CRAN (R 3.5.2)
ggplot2 * 3.1.0 2018-10-25 [1] CRAN (R 3.5.2)
glue 1.3.0 2018-07-17 [1] CRAN (R 3.5.2)
gtable 0.2.0 2016-02-26 [1] CRAN (R 3.5.2)
haven 2.0.0 2018-11-22 [1] CRAN (R 3.5.2)
hms 0.4.2 2018-03-10 [1] CRAN (R 3.5.2)
httr * 1.4.0 2018-12-11 [1] CRAN (R 3.5.2)
jsonlite * 1.6 2018-12-07 [1] CRAN (R 3.5.2)
lattice 0.20-38 2018-11-04 [2] CRAN (R 3.5.2)
lazyeval 0.2.1 2017-10-29 [1] CRAN (R 3.5.2)
lubridate * 1.7.4 2018-04-11 [1] CRAN (R 3.5.2)
magrittr 1.5 2014-11-22 [1] CRAN (R 3.5.2)
memoise 1.1.0 2017-04-21 [1] CRAN (R 3.5.2)
modelr 0.1.2 2018-05-11 [1] CRAN (R 3.5.2)
munsell 0.5.0 2018-06-12 [1] CRAN (R 3.5.2)
nlme 3.1-137 2018-04-07 [2] CRAN (R 3.5.2)
openssl * 1.2.1 2019-01-17 [1] CRAN (R 3.5.2)
pillar 1.3.1 2018-12-15 [1] CRAN (R 3.5.2)
pkgbuild 1.0.2 2018-10-16 [1] CRAN (R 3.5.2)
pkgconfig 2.0.2 2018-08-16 [1] CRAN (R 3.5.2)
pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.5.2)
plyr 1.8.4 2016-06-08 [1] CRAN (R 3.5.2)
prettyunits 1.0.2 2015-07-13 [1] CRAN (R 3.5.2)
processx 3.2.1 2018-12-05 [1] CRAN (R 3.5.2)
ps 1.3.0 2018-12-21 [1] CRAN (R 3.5.2)
purrr * 0.3.0 2019-01-27 [1] CRAN (R 3.5.2)
R6 2.3.0 2018-10-04 [1] CRAN (R 3.5.2)
Rcpp 1.0.0 2018-11-07 [1] CRAN (R 3.5.2)
readr * 1.3.1 2018-12-21 [1] CRAN (R 3.5.2)
readxl 1.2.0 2018-12-19 [1] CRAN (R 3.5.2)
remotes 2.0.2 2018-10-30 [1] CRAN (R 3.5.2)
rlang 0.3.1.9000 2019-02-16 [1] Github (r-lib/rlang@7243c6d)
rlist * 0.4.6.1 2016-04-04 [1] CRAN (R 3.5.2)
rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.5.2)
rstudioapi 0.9.0 2019-01-09 [1] CRAN (R 3.5.2)
rvest 0.3.2 2016-06-17 [1] CRAN (R 3.5.2)
scales 1.0.0 2018-08-09 [1] CRAN (R 3.5.2)
sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.5.2)
stringi 1.2.4 2018-07-20 [1] CRAN (R 3.5.2)
stringr * 1.3.1 2018-05-10 [1] CRAN (R 3.5.2)
testthat 2.0.1 2018-10-13 [1] CRAN (R 3.5.2)
tibble * 2.0.1 2019-01-12 [1] CRAN (R 3.5.2)
tidyr * 0.8.2 2018-10-28 [1] CRAN (R 3.5.2)
tidyselect 0.2.5 2018-10-11 [1] CRAN (R 3.5.2)
tidyverse * 1.2.1 2017-11-14 [1] CRAN (R 3.5.2)
usethis 1.4.0 2018-08-14 [1] CRAN (R 3.5.2)
withr 2.1.2 2018-03-15 [1] CRAN (R 3.5.2)
xml2 1.2.0 2018-01-24 [1] CRAN (R 3.5.2)
[1] /usr/local/lib/R/site-library
[2] /usr/local/lib/R/library
Warning message:
In system("timedatectl", intern = TRUE) :
running command 'timedatectl' had status 1