pawelsikora / mkdocs-with-confluence

MkDocs plugin for uploading markdown documentation to Confluence via Confluence REST API
MIT License
67 stars 33 forks source link

Submission to Confluence fails with error #21

Open c-schinzer opened 1 year ago

c-schinzer commented 1 year ago

Hello,

my upload to confluence API fails with error for a certain page in my set of markdown files, so I suspect there is a certain md content that is not properly converted. Is there a way to increase verbosity of the mkdocs run in order to get more details?

Here is what I have so far:

...
[2023-06-01T10:48:14.399Z] ERROR    -  Error reading page 'outbound_pipeline.md': 400 Client Error:  for url: https://XXXXXXXXX.net/confluence/rest/api/content/
...
[2023-06-01T10:48:14.400Z] INFO    -   * Mkdocs With Confluence: Using the Pipeline - *UPDATE*
[2023-06-01T10:48:14.400Z] INFO    -   * Mkdocs With Confluence: Using the Pipeline for DDP - *NEW PAGE*
[2023-06-01T10:48:14.400Z] Trying to ADD page 'Using the Pipeline for DDP' to parent0(FTP Links Automaton) ID: 2999877739
[2023-06-01T10:48:14.400Z] INFO    -   * Mkdocs With Confluence: The MFT Pipeline - *NEW PAGE*
[2023-06-01T10:48:14.400Z] Traceback (most recent call last):
[2023-06-01T10:48:14.400Z]   File "/usr/local/bin/mkdocs", line 8, in <module>
[2023-06-01T10:48:14.400Z]     sys.exit(cli())
[2023-06-01T10:48:14.400Z]              ^^^^^
[2023-06-01T10:48:14.400Z]   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
[2023-06-01T10:48:14.400Z]     return self.main(*args, **kwargs)
[2023-06-01T10:48:14.400Z]            ^^^^^^^^^^^^^^^^^^^^^^^^^^
[2023-06-01T10:48:14.400Z]   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1055, in main
[2023-06-01T10:48:14.400Z]     rv = self.invoke(ctx)
[2023-06-01T10:48:14.400Z]          ^^^^^^^^^^^^^^^^
[2023-06-01T10:48:14.400Z]   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
[2023-06-01T10:48:14.400Z]     return _process_result(sub_ctx.command.invoke(sub_ctx))
[2023-06-01T10:48:14.400Z]                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2023-06-01T10:48:14.400Z]   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
[2023-06-01T10:48:14.400Z]     return ctx.invoke(self.callback, **ctx.params)
[2023-06-01T10:48:14.400Z]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2023-06-01T10:48:14.400Z]   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 760, in invoke
[2023-06-01T10:48:14.400Z]     return __callback(*args, **kwargs)
[2023-06-01T10:48:14.400Z]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2023-06-01T10:48:14.400Z]   File "/usr/local/lib/python3.11/site-packages/mkdocs/__main__.py", line 250, in build_command
[2023-06-01T10:48:14.400Z]     build.build(cfg, dirty=not clean)
[2023-06-01T10:48:14.400Z]   File "/usr/local/lib/python3.11/site-packages/mkdocs/commands/build.py", line 308, in build
[2023-06-01T10:48:14.400Z]     _populate_page(file.page, config, files, dirty)
[2023-06-01T10:48:14.400Z]   File "/usr/local/lib/python3.11/site-packages/mkdocs/commands/build.py", line 177, in _populate_page
[2023-06-01T10:48:14.400Z]     page.markdown = config.plugins.run_event(
[2023-06-01T10:48:14.400Z]                     ^^^^^^^^^^^^^^^^^^^^^^^^^
[2023-06-01T10:48:14.400Z]   File "/usr/local/lib/python3.11/site-packages/mkdocs/plugins.py", line 520, in run_event
[2023-06-01T10:48:14.400Z]     result = method(item, **kwargs)
[2023-06-01T10:48:14.400Z]              ^^^^^^^^^^^^^^^^^^^^^^
[2023-06-01T10:48:14.400Z]   File "/usr/local/lib/python3.11/site-packages/mkdocs_with_confluence/plugin.py", line 334, in on_page_markdown
[2023-06-01T10:48:14.400Z]     self.add_page(page.title, parent_id, confluence_body)
[2023-06-01T10:48:14.400Z]   File "/usr/local/lib/python3.11/site-packages/mkdocs_with_confluence/plugin.py", line 541, in add_page
[2023-06-01T10:48:14.400Z]     r.raise_for_status()
[2023-06-01T10:48:14.400Z]   File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
[2023-06-01T10:48:14.400Z]     raise HTTPError(http_error_msg, response=self)
[2023-06-01T10:48:14.400Z] requests.exceptions.HTTPError: 400 Client Error:  for url: https://XXXXXXXX.net/confluence/rest/api/content/

I think the issue might be related to the content inside the md page I am submitting, but how can I know if I cannot see the error message coming with the HTTP 400 from the Confluence space.

Hence the first request would be: Is there a way to increase verbosity of the logs? Second request: Is there a document that described the 'sensitive' characaters that should not appear on the .md page when attempting to convert to HTML with mkdocs?

Thanks for your consideration! Warm regards

Carsten

c-schinzer commented 1 year ago

I found how to switch on debug level. Now I see that the page being uploaded has a size of 20,770 characters on the body - maybe a size limitation?