conflr icon indicating copy to clipboard operation
conflr copied to clipboard

Error after rendering

Open hanson377 opened this issue 2 years ago • 4 comments

After my document has finished rendering, and begins the upload process, I get this error:

Error in paste(httr::http_condition(res, type = "error"), httr::content(res)): Bad Request (HTTP 400). com.atlassian.confluence.api.service.exceptions.BadRequestException: Content body cannot be converted to new editor format

Any help with said error would be extremely helpful! Thanks in advance.

hanson377 avatar Oct 25 '21 20:10 hanson377

Could you provide a reproducible example? This seems an issue of compatibility with the new editor format, but I can't figure out what's happening without knowing the details.

yutannihilation avatar Oct 26 '21 04:10 yutannihilation

In my case, the problem appears when I add caption to knitr::kable(). Without the caption argument the function works as expected.

---
title: "Conflr debug"
author: "Alexander Matrunich"
date: '`r format(Sys.Date(), "%d %B, %Y")`'
output: 
  conflr::confluence_document:
    parent_id: "000000"
    space_key: "YYYYY"
    update: true
    code_folding: hide
    toc: false
---


Hello!


```{r testchunk, warning=FALSE}
cars |> 
  knitr::kable(
    caption = "Table caption",
    digits = 3
  )
\```

processing file: conflr_debug.Rmd
output file: conflr_debug.knit.md

Checking the existing images...
Uploading the images...
Uploading the document...
Error: Error in paste(httr::http_condition(res, type = "error"), httr::content(res)): Bad Request (HTTP 400).
 400
* Error in paste(httr::http_condition(res, type = "error"), httr::content(res)): Bad Request (HTTP 400).
 list(authorized = FALSE, valid = TRUE, errors = list(), successful = FALSE)
* Error in paste(httr::http_condition(res, type = "error"), httr::content(res)): Bad Request (HTTP 400).
 com.atlassian.confluence.api.service.exceptions.BadRequestException: Content body cannot be converted to new editor format
Backtrace:
    █
 1. └─rmarkdown::render(...)
 2.   └─output_format$post_processor(...)
 3.     ├─rlang::exec(...)
 4.     └─(function (title, space_key, type, parent_id, html_text, imgs, ...
 5.       └─conflr::confl_update_page(id = id, title = title, body = html_text)
 6.         └─conflr:::confl_verb(...)
Execution halted

malexan avatar Nov 25 '21 09:11 malexan

Thanks for the reproducible example!! This is really helpful.

yutannihilation avatar Nov 25 '21 10:11 yutannihilation

Hi I am getting a similar error when I try to upload an RNotebook, no captions in processing file: tmag5170_error.Rmd |.. | 4% ordinary text without R code

|.... | 8% label: unnamed-chunk-1 (with options) List of 1 $ echo: logi FALSE

|...... | 12% label: unnamed-chunk-2 (with options) List of 1 $ echo: logi FALSE

|........ | 15% ordinary text without R code

|.......... | 19% label: unnamed-chunk-3 (with options) List of 1 $ echo: logi FALSE

|............ | 23% ordinary text without R code

|.............. | 27% label: unnamed-chunk-4 (with options) List of 2 $ echo : logi FALSE $ results: chr "hide"

|................ | 31% ordinary text without R code

|.................. | 35% label: unnamed-chunk-5 (with options) List of 2 $ echo : logi FALSE $ results: chr "hide"

|.................... | 38% ordinary text without R code

|...................... | 42% label: unnamed-chunk-6 (with options) List of 1 $ echo: logi FALSE

|........................ | 46% ordinary text without R code

|.......................... | 50% label: unnamed-chunk-7 (with options) List of 1 $ echo: logi FALSE

|........................... | 54% label: unnamed-chunk-8 (with options) List of 2 $ echo : logi FALSE $ results: chr "hide"

|............................. | 58% ordinary text without R code

|............................... | 62% label: unnamed-chunk-9 (with options) List of 2 $ echo : logi FALSE $ results: chr "hide"

|................................. | 65% ordinary text without R code

|................................... | 69% label: unnamed-chunk-10 (with options) List of 1 $ echo: logi FALSE

|..................................... | 73% label: unnamed-chunk-11 (with options) List of 2 $ echo : logi FALSE $ results: chr "hide"

|....................................... | 77% ordinary text without R code

|......................................... | 81% label: unnamed-chunk-12 (with options) List of 2 $ echo : logi FALSE $ results: chr "hide"

|........................................... | 85% label: unnamed-chunk-13 (with options) List of 2 $ echo : logi FALSE $ results: chr "hide"

|............................................. | 88% ordinary text without R code

|............................................... | 92% label: unnamed-chunk-14 (with options) List of 2 $ echo : logi FALSE $ results: chr "hide"

|................................................. | 96% ordinary text without R code

|...................................................| 100% label: unnamed-chunk-15 (with options) List of 2 $ echo : logi FALSE $ results: chr "hide"

output file: tmag5170_error.knit.md

/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS tmag5170_error.knit.md --to commonmark-yaml_metadata_block --from markdown+autolink_bare_uris-tex_math_single_backslash-tex_math_dollars-raw_tex --output tmag5170_error.md --wrap=none Loading required package: shiny

Listening on http://127.0.0.1:7883 Warning: Error in : Error in paste(httr::http_condition(res, type = "error"), httr::content(res)): Bad Request (HTTP 400). 400

  • Error in paste(httr::http_condition(res, type = "error"), httr::content(res)): Bad Request (HTTP 400). list(authorized = FALSE, valid = TRUE, errors = list(), successful = FALSE)
  • Error in paste(httr::http_condition(res, type = "error"), httr::content(res)): Bad Request (HTTP 400). com.atlassian.confluence.api.service.exceptions.BadRequestException: Content body cannot be converted to new editor format 59: <Anonymous>

KevinHRea avatar Jan 05 '22 04:01 KevinHRea