mark icon indicating copy to clipboard operation
mark copied to clipboard

Links surrounded by <> generate "Confluence API 400 Bad Request"

Open eitchugo opened this issue 3 years ago • 5 comments

Hi there,

I tested a sample markdown cheat sheet [1] with this and was getting the following error:

FATAL Confluence API returned unexpected status: 400 Bad Request, output: ""

I isolated the following line that generates this error:

The link <http://www.example.com> will NOT be OK

I think this is supported by markdown (and I saw this working In other tools), the link surrounded by angle brackets. For now I just won't use the angle brackets :)

[1] https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet

eitchugo avatar Jun 28 '21 22:06 eitchugo

Yeah, I can confirm that I am having this issue as well after removing <https://somelink.com>, the API error is gone if add --trace, I can get the detailed error message as below:

FATAL Confluence API returned unexpected status: 400 Bad Request, output: "{\"statusCode\":400,\"data\":{\"authorized\":false,\"valid\":true,\"errors\":[],\"successful\":false},\"message\":\"com.atlassian.confluence.api.service.exceptions.BadRequestException: Content body cannot be converted to new editor format\"}"

bobby-wang-xero avatar Sep 13 '21 06:09 bobby-wang-xero

It also breaks for unicode characters,

An error message like this isn't very helpful

FATAL Confluence API returned unexpected status: 400 Bad Request, output: ""

I think its better if the tool would show this detail by default or support unicode.

adharshmk96 avatar Oct 29 '21 04:10 adharshmk96

The tool shows what it can show. It received 400 Bad Request from the server.

There is --trace argument if you want more details.

пт, 29 окт. 2021 г. в 10:50, Adharsh M @.***>:

An error message like this isn't very helpful

FATAL Confluence API returned unexpected status: 400 Bad Request, output: ""

I think its better if the tool would show this properly.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kovetskiy/mark/issues/90#issuecomment-954427879, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAN7ZFAAYUADK3GWPGH5F3UJIR2JANCNFSM47O43MEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kovetskiy avatar Oct 29 '21 10:10 kovetskiy

I have had this occur a few times, the most inconvenient part of this is that --dry-run actually succeeds, so when running it in CI (for me at least) it will succeed on the branch and then fail when merged in to develop when it doesn't do a dry run.

I have had a look for a confluence schema, but it does not exist, so any validation would be a hack. Something like

  • Check if valid html tag
  • Check if '<ac (or any other confluence tag) I think this may be referred to as a namespace
  • Otherwise, error out with invalid tag message

kevindotglasson avatar Nov 10 '21 12:11 kevindotglasson

Hi, can you try the latest commit? https://github.com/kovetskiy/mark/commit/f0e00468e94406d3c57ceb896293ba7312992a96

kovetskiy avatar Nov 11 '21 08:11 kovetskiy

Please test with mark 9.8.0 or later and report back if the issue still exists.

mrueg avatar Aug 11 '23 13:08 mrueg