Skip to content

Issues when using confluence-builder with sphinxcontrib-plantuml #1135

@thoerdo

Description

@thoerdo

Hi.

When using confluencebuilder I ran into an issued when combining with sphinxcontrib-plantuml and I can not find the issue myself. Any chance you might guide me where to look / how to fix?

Issue summary

PlantUML images are created, yet not uploaded to Confluence, so the resulting Confluence pages only show an error message "Unknown Attachment", where the images should be. When creating plain HTML pages instead of Confluence pages, everything works fine.

Minimal code setup for test

project-dir

  • docs/
    • index.rst
    • conf.py
    • requirements.txt
  • requirements.txt
  • tox.ini

requirements.txt
tox

tox.ini

[tox]
envlist = html, confluence
skipsdist = false

[testenv:html]
deps =
    -r docs/requirements.txt
commands =
     sphinx-build -a -E -n -j auto -T -v -W --keep-going --color docs docs/_build/html{posargs}

[testenv:confluence]
deps =
    -r docs/requirements.txt
commands =
    sphinx-build -a -b confluence -E -n -j auto -T -v -W --keep-going --color docs docs/_build/confluence {posargs}

docs/index.rst

PlantUML Demo
===============

This is a demo for PlantUML.

.. plantuml::

    Alice -> Bob: Hi!
    Alice <- Bob: How are you?

docs/requirements.txt

sphinx
sphinxcontrib-confluencebuilder
sphinxcontrib-plantuml

conf.py

extensions = [
    # -- General extensions
    "sphinx.ext.duration",  # durations report at the end of  Sphinx build
    # -- Specific addons
    "sphinxcontrib.plantuml",   # support for PlantUML diagrams
    # -- Confluene specific extensions
    # If building "tox -e html"  ensure to comment out the following extensions
    "sphinxcontrib.confluencebuilder"
]

# -- Extensions options: Plant-UML -------------------------------------------
# PlantUML configuration
current_dir = os.path.dirname(os.path.abspath(__file__))
plantuml_jar_path = os.path.join(current_dir, "../plantuml.jar")

plantuml = 'java -jar ' + plantuml_jar_path # Path to PlantUML jar file
plantuml_output_format = 'png'  # Output format for PlantUML diagrams
plantuml_cache_path = "plantuml"

# -- Extensions options: ConfluenceBuilder -----------------------------------
confluence_server_url = <server_url>
confluence_space_key = <space_key>
confluence_parent_page = <parent_page>
confluence_publish_token = <personal access token>

confluence_publish = True
confluence_publish_debug = "all" 

--> Yes the PAT should not be directly in the conf.py file, but for testing it will do

Execution & results

HTML

Running tox -e html from CLI (confluencebuilder extension is comment out within conf.py)

In docs/_build/html/plantuml/ac/ac54ff83b1193e04582c7ec1040cc831dafcc20c.png the created UML image is available, and also copied to docs/_build/html/_images/ac54ff83b1193e04582c7ec1040cc831dafcc20c.png.

In the rendered HTML pages the created image is visible as expected, with source path: _images/plantuml-ac54ff83b1193e04582c7ec1040cc831dafcc20c.png

Confluence

Running tox -e confluence from CLI

In docs/_build/confluence/plantuml/ac/ac54ff83b1193e04582c7ec1040cc831dafcc20c.png the created UML image is available, and also copied to docs/_build/confluence/ac54ff83b1193e04582c7ec1040cc831dafcc20c.png.

BE AWARE: For some reason the image is not linked in the docs/_build/confluence/scb-manifest.json file, and maybe this is also the error here.

In the rendered Confluence pages the created image is properly linked as ac54ff83b1193e04582c7ec1040cc831dafcc20c.png file, yet the image is not uploaded to the Confluence page, so the page only shows an "Unknown attachment" error.

Machine data

Ubuntu WSL on Windows 11

Distributor ID: Ubuntu
Description:    Ubuntu 24.04.2 LTS
Release:        24.04
Codename:       noble

Python version

> python --version
Python 3.12.3

Java version

> java --version
openjdk 21.0.8 2025-07-15
OpenJDK Runtime Environment (build 21.0.8+9-Ubuntu-0ubuntu124.04.1)
OpenJDK 64-Bit Server VM (build 21.0.8+9-Ubuntu-0ubuntu124.04.1, mixed mode, sharing)

PlantUML version
1.2025.4

Python packages within root folder

>pip list

Package       Version
------------- -------
cachetools    6.1.0
cfgv          3.4.0
chardet       5.2.0
colorama      0.4.6
distlib       0.4.0
filelock      3.18.0
identify      2.6.12
nodeenv       1.9.1
packaging     25.0
pip           24.0
platformdirs  4.3.8
pluggy        1.6.0
pre_commit    4.2.0
pyproject-api 1.9.1
PyYAML        6.0.2
tox           4.28.3
virtualenv    20.32.0

Python packages within tox Confluence environment

Package                         Version
------------------------------- -----------
alabaster                       1.0.0
anyio                           4.10.0
babel                           2.17.0
build                           1.3.0
cachetools                      6.1.0
certifi                         2025.8.3
cffi                            1.17.1
cfgv                            3.4.0
chardet                         5.2.0
charset-normalizer              3.4.3
click                           8.2.1
colorama                        0.4.6
coverage                        7.10.3
cryptography                    45.0.6
distlib                         0.4.0
docutils                        0.21.2
epac                            0.0.32
filelock                        3.18.0
gitdb                           4.0.12
GitPython                       3.1.45
h11                             0.16.0
hatch                           1.14.1
hatchling                       1.27.0
httpcore                        1.0.9
httpx                           0.28.1
hyperlink                       21.0.0
identify                        2.6.13
idna                            3.10
imagesize                       1.4.1
iniconfig                       2.1.0
jaraco.classes                  3.4.0
jaraco.context                  6.0.1
jaraco.functools                4.2.1
jeepney                         0.9.0
Jinja2                          3.1.6
keyring                         25.6.0
markdown-it-py                  3.0.0
MarkupSafe                      3.0.2
mdit-py-plugins                 0.5.0
mdurl                           0.1.2
more-itertools                  10.7.0
myst-parser                     4.0.1
nodeenv                         1.9.1
packaging                       25.0
pathspec                        0.12.1
pexpect                         4.9.0
pip                             25.1.1
platformdirs                    4.3.8
pluggy                          1.6.0
pre_commit                      4.3.0
ptyprocess                      0.7.0
pycparser                       2.22
pygit2                          1.18.1
Pygments                        2.19.2
pyproject-api                   1.9.1
pyproject_hooks                 1.2.0
pytest                          8.4.1
pytest-cov                      6.2.1
python-git                      2018.2.1
PyYAML                          6.0.2
requests                        2.32.4
rich                            14.1.0
roman-numerals-py               3.1.0
SecretStorage                   3.3.3
Send2Trash                      1.8.3
shellingham                     1.5.4
smmap                           5.0.2
sniffio                         1.3.1
snowballstemmer                 3.0.1
Sphinx                          8.2.3
sphinx-autodoc-typehints        3.2.0
sphinx-rtd-theme                3.0.2
sphinxcontrib-applehelp         2.0.0
sphinxcontrib-confluencebuilder 2.14.0
sphinxcontrib-devhelp           2.0.0
sphinxcontrib-htmlhelp          2.1.0
sphinxcontrib-jquery            4.1
sphinxcontrib-jsmath            1.0.1
sphinxcontrib-plantuml          0.30
sphinxcontrib-qthelp            2.0.0
sphinxcontrib-serializinghtml   2.0.0
tomli_w                         1.2.0
tomlkit                         0.13.3
tox                             4.28.4
trove-classifiers               2025.8.6.13
typing_extensions               4.14.1
urllib3                         2.5.0
userpath                        1.9.2
uv                              0.8.10
virtualenv                      20.34.0
yamllint                        1.37.1
zstandard                       0.23.0.0.0
urllib3                         2.5.0

I have no clue where to look.
So please, if you have any idea, where I might start investigating / fixing the problem, that would really be helpful.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions