odpi/egeria-docs

mkdocs build failing

planetf1 opened this issue · 7 comments

As reported via https://lfaifoundation.slack.com/archives/C02M2222F63/p1672667645179079

mkdocs build is failing

ERROR    -  Error building page 'release-notes/1-0.md': can only join an iterable
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.1/x64/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/mkdocs/__main__.py", line 250, in build_command
    build.build(cfg, dirty=not clean)
  File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/mkdocs/commands/build.py", line 329, in build
    _build_page(file.page, config, doc_files, nav, env, dirty)
  File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/mkdocs/commands/build.py", line 226, in _build_page
    context = config.plugins.run_event(
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/mkdocs/plugins.py", line 520, in run_event
    result = method(item, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/material/plugins/search/plugin.py", line 90, in on_page_context
    self.search_index.add_entry_from_context(page)
  File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/material/plugins/search/plugin.py", line 149, in add_entry_from_context
    self.create_entry_for_section(section, page.toc, page.url, page)
  File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/material/plugins/search/plugin.py", line 167, in create_entry_for_section
    title = "".join(section.title).strip()
            ^^^^^^^^^^^^^^^^^^^^^^
TypeError: can only join an iterable
Error: Process completed with exit code 1.

This has affected only builds since yesterday, and can be replicated locally using mkdocs 1.4.2

The last mkdocs release (on their github repo) was to 1.4.2 on 1 Nov https://github.com/mkdocs/mkdocs
the latest image for our github runner (ubuntu-latest) was 12 Dec - https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md -
python 3.11 was 24 Oct https://www.python.org/downloads/

The error occurs from the mkdocs-material search plugin

        title = "".join(section.title).strip()

The cause appears to be related to files containing numerics, ie
docs/release-notes/1-0.md
where these are also in the mkdocs.yml navigation index.

Probably some kind of type conversion issue.

Thank you @planetf1 for your analysis 👍

I have been thinking that we should consolidate the list in the nav into a consolidated file for the older releases. This is a trigger to do so. I will do that today so we have our builds working again

The builds are working now. I submitted a pr. another one to follow to reinstate v9 with a workaround from the devs.

Of course that's aside from any changes we want to make

As per workaround in the mkdocs-material bug report, versions are now quoted, so all should be working at the latest level regardless of any decisions we wish to make to improve our docs.