Bugs

Known defects and inconsistencies in the build, deploy, and tooling.

Build / dependency

B1 — sync_www installs mkdocs-material but requirements.txt does not list it

br13000/sync_www runs apt install -y git mkdocs-material apache2, but br13000/requirements.txt only pins mkdocs>=1.5.3 (the mkdocs-material line is commented out). The two install paths disagree, so a host set up from requirements.txt will not match one set up from sync_www.

Fix: pick one source of truth. Either add mkdocs-material to requirements.txt and have sync_www use pip install -r requirements.txt, or drop the mkdocs-material install from sync_www.

B2 — sync_www installs apache2 but the site is served by nginx

br13000/sync_www installs apache2, then rsyncs to /var/www/html and runs systemctl restart nginx. br13000/www_setup_notes.md and br13000/cloud_init.sample also install apache2. The deploy target is nginx (see .gitlab-ci.yml and br13000/deploy.yml). Apache is dead weight at best, a port conflict at worst.

Fix: remove apache2 from sync_www, www_setup_notes.md, and cloud_init.sample.

B3 — sync_www and sync_website.sh duplicate each other

Both scripts:

  • cd into a checkout of the site
  • rewrite the Updated ... line in docs/index.md
  • run mkdocs build
  • rsync the result to /var/www/html
  • chown -R www-data:www-data /var/www/html
  • restart nginx

sync_website.sh additionally commits and pushes the Updated change back to git; sync_www does not. They also disagree on the checkout location (~/training/website_automation/www_site/ vs ~/training/website_automation/www_site/html/).

Fix: keep one script. If the git-commit-back behavior is wanted, keep sync_website.sh; otherwise keep sync_www. Delete the other.

B4 — Hardcoded, stale host IP in sync_website.sh

br13000/sync_website.sh sets HOST_IP=173.199.117.51 with a comment "Change HOST_IP as the website host IP changes." The same IP appears in br13000/disabled.gitlab-ci.yml and br13000/notes.md. This is a manual step that will be forgotten.

Fix: read the host from an environment variable or inventory, e.g. HOST_IP="${HOST_IP:?set HOST_IP}", and document it.

B5 — deploy.yml references seedling_result that is never registered

In br13000/deploy.yml, the "Add new hosts to inventory" task uses {{ seedling_result.vultr_instance.main_ip }}, but the preceding "Create hosts" task does not register: seedling_result. As written the play will fail with an undefined variable.

Fix: add register: seedling_result to the "Create hosts" task, or restructure so the IP is captured per-host (the current loop + single register would only capture the last host anyway — see B6).

B6 — deploy.yml loop + single register only captures the last host

Even after B5 is fixed, register: seedling_result on a looped task stores a list of results, not a single dict. The subsequent {{ seedling_result.vultr_instance.main_ip }} would need to be {{ item.vultr_instance.main_ip }} inside a loop over seedling_result.results.

Fix: iterate over seedling_result.results in the "Add new hosts" and "Add hosts to DNS" tasks.

B7 — deploy.yml "Cleanup old entries" runs before "Add hosts to DNS"

The Cloudflare cleanup task removes the DNS record, then the next task re-adds it. This is intentional (idempotent replace) but is fragile: if the add fails, the record is gone. Consider using state: present with overwrite semantics, or at least document the intent.

Fix: document, or switch to a single state: present task.

Tooling

B8 — wp2md.py requires Python 3.9+ without saying so

wp2md.py uses str.removeprefix (3.9+) and Path.is_relative_to (3.9+). The shebang is #!/usr/bin/env python3, and nothing in the file or docs states a minimum version. On RHEL 8 (Python 3.6) or older Debian, it will fail with AttributeError.

Fix: add a version check at startup, or document "Python 3.9+" in the docstring and in docs/project/documentation-gaps.md.

B9 — wp2md.py --dry-run still reads and parses every file

--dry-run avoids writes, but convert_file still reads every index.html, parses it with lxml, and runs the converter. That is fine, but the claimed dict is populated with planned destinations and never cleared between runs — if the same script is invoked twice in one process (it isn't today, but could be), names would drift. Low priority.

Fix: none required today; note for future refactor.

B10 — update_blog_index.py split_front_matter can mis-split on --- in body

split_front_matter looks for the first \n--- after the opening ---. If a post body contains a horizontal rule (---) before the real end of front matter, it will split in the wrong place. In practice front matter is at the top, so this is unlikely, but the parser is not robust.

Fix: require the closing --- to be on its own line and to be the first such line after the opening, or use a real YAML parser (PyYAML) for front matter.

B11 — update_blog_index.py silently skips files not in YYYY/MM/DD/

collect_entries prints Skipping (not in YYYY/MM/DD/ layout) for any .md under the blog dir that doesn't match. That includes blog.md itself (handled) but also any future docs/blog/README.md or docs/blog/index.md. The message goes to stdout, not stderr, so it is easy to miss in CI logs.

Fix: send skip messages to stderr, or make the skip list explicit.

B12 — update_blog_index.py --today is only used for feature expiry

The --today flag is documented as "Override today's date for feature expiry checks (testing)." It does not affect the timeline sort (which uses the path date). That is correct, but the help text could be clearer that it only affects featured_until.

Fix: clarify help text.

CI/CD

B13 — .gitlab-ci.yml deploys main by wiping /var/www/html/*

The main branch deploy does rm -rf ${WEBSITE_ROOT}/* then cp -r ./built_site/* ${WEBSITE_ROOT}/. If the build fails partway, the site is left empty. There is no atomic swap.

Fix: build to a staging dir, then rsync --delete or swap a symlink.

B14 — .gitlab-ci.yml appends a deploy marker to index.html

echo "### Deployed to ..." >> ./built_site/index.html appends raw text after </html>. Browsers tolerate it, but it is invalid HTML and will show up in view-source. It also means the deployed index.html differs from the built one, which complicates "is this what I built?" checks.

Fix: write the marker to a separate deploy-info.txt, or inject it into a <meta> tag before </head>.

B15 — .gitlab-ci.yml uses ssh-keyscan without verifying the host key

ssh-keyscan ${REMOTE_SERVER_IP} >> ~/.ssh/known_hosts trusts whatever key the server presents on first contact. That is TOFU, not verification. For a deploy pipeline this is a supply-chain risk.

Fix: pin the host key fingerprint in a CI variable and verify it, or use a dedicated deploy key with a known fingerprint.

B16 — .gitlab-ci.yml clones the repo on the remote host every deploy

The remote script does rm -rf ./www_site/ && git clone --depth=1 ... on every run. That is slow and depends on the remote host having git credentials for the repo (it uses the CI project URL, which may be private). It also means the remote host needs network access to GitLab.

Fix: either rsync the built site from the runner (no remote clone), or keep a persistent checkout on the remote and git fetch + reset.

B17 — .gitlab-ci.yml does not pin the alpine image

image: alpine:latest will silently change over time. Pin a version, e.g. alpine:3.20.

Fix: pin the image tag.

B18 — br13000/disabled.gitlab-ci.yml is dead config

The file is entirely commented out and duplicates the intent of the root .gitlab-ci.yml. It is not referenced anywhere. It will rot.

Fix: delete it, or move it to docs/project/orphaned-files.md as a historical note and remove the file.

Docs site

B19 — Two mkdocs.yml files have drifted

Root mkdocs.yml and br13000/mkdocs.yml are nearly identical but not quite: br13000/mkdocs.yml has commented-out pymdownx.striphtml and git-revision-date-localized blocks that the root file lacks. It is unclear which one is authoritative.

Fix: keep one mkdocs.yml at the repo root and delete br13000/mkdocs.yml, or document why both exist.

B20 — docs/index.md contains commented-out template experiments

docs/index.md has a large HTML comment block with Jinja/MkDocs experiments (build_date_utc, {% block footer %}, "SED follows:"). These are leftovers from an earlier templating approach and confuse readers.

Fix: remove the comment block, or move it to a scratch note outside docs/.

B21 — docs/blog.md is generated but also hand-edited

update_blog_index.py regenerates docs/blog.md, but the file is checked in and has a "Featured" section that depends on front matter in individual posts. If someone hand-edits docs/blog.md, the next CI run will overwrite it. There is no warning.

Fix: add a header comment to the generated file ("generated by update_blog_index.py — do not edit") and have the script emit it.

B22 — docs/blog.md lists a post that does not exist in the tree

docs/blog.md links to 2026/09/13/testing_automation.md, but the file summary does not show that path. Either the post is missing or the index is stale.

Fix: run update_blog_index.py and commit the result, or add the missing post.

B23 — Committed private SSH key (br13000/deploy_key)

br13000/deploy_key is an OpenSSH private key committed to the repo. .gitignore does not exclude it (see O13). This is a security issue regardless of the key's scope.

Fix: see O8 — remove, rotate, store as a CI/CD variable, and fix .gitignore.

B24 — br13000/blog.md is a stale duplicate of docs/blog.md

See O10. It uses the old .md-less link style and is missing the 2026-09-13 entry. It is not referenced by anything.

Fix: delete it.