sash011
February 5, 2021, 12:41pm
1
Hi folks,
Stumbled on this issue recently…
Using this API to convert the storage to view
https://developer.atlassian.com/cloud/confluence/rest/api-group-content-body/#api-api-contentbody-convert-to-post
And recently we have got a feedback from a client, who has reported that they started to get something like
{
"value": "<div class=\"error fatal-render-error\">Error: [com.ctc.wstx.exc.WstxLazyException] Unexpected character '=' (code 61); expected a semi-colon after the reference for entity 'avatarId'\n at [row,col {unknown-source}]: [135,190]</div>",
"representation": "view",
"_expandable": {
"webresource": "",
"embeddedContent": "",
"mediaToken": "",
"content": "/rest/api/content/245104781"
},
"_links": {
"base": "https://XXXXX.atlassian.net/wiki",
"context": "/wiki"
}
}
The cause of the issue was easy to fix, but the question is - how we can reliably understand the conversion has failed?
Checking for “fatal-render-error” in a response!?
Alex
3 Likes
dmorrow
February 12, 2021, 6:25am
2
Hi @sash011 ,
Do you have a test case to reproduce this? It seems like a bug, and instead a proper error response should be returned.
Regards,
Dugald
1 Like
sash011
February 12, 2021, 9:15am
3
Oh, that is very simple actually.
Any non valid XHTML will do I think… (I understand that it is our problem to verify it’s valid, but sometimes… well, we might fail to recognise that in advance)
See a missing opening < before the "a" tag
& instead of & in the link parameters
Would be good not to return 200 in this case… Or give some additional information about the error in the separate attribute (not in “value”)
dmorrow
February 15, 2021, 3:58am
4
Thanks @sash011 ,
The API is documented as always returning 200 responses so I created an issue to request a field be added in the response to indicate whether the content conversion was successful or not. See CONFCLOUD-71608 .
Regards,
Dugald
1 Like
sash011
February 15, 2021, 6:49am
5
Thanks, hopefully it gets some attention sooner than later
1 Like