Skip to content

Link checker fails when anchor exists #287

@bmorelli25

Description

@bmorelli25

Summary

I'm struggling to figure out why this is the case, but I'm seeing ~70 instances of this.

Reproduce:

  1. Clone the elasticsearch.md repo
  2. cd elasticsearch.md
  3. Add two files:
    a. add-missing-anchors.py https://gist.github.com/bmorelli25/bc93ab7dd4d4e89270133a4cc5d27a4b
    b. output.log.txt https://gist.github.com/bmorelli25/c8d46c59074f652e6cc412e38b9d8f7f (the docs-builder error log when building the elasticsearch.md content set)
  4. Run python add-missing-anchors.py ./docs/ (this will use the error log to add missing anchors to all files)
  5. Run docs-builder: dotnet publish "src/docs-builder/docs-builder.csproj" && ./.artifacts/publish/docs-builder/release/docs-builder -p ../elasticsearch.md.

Even though all anchors are now present, the docs build fails with ~70 broken links. Partial error log:

:: fail: Documentation.Builder.Log[0] `forced-awareness` does not exist in shard-allocation-awareness.md. (/Users/brandon/Documents/GitHub/elasticsearch.md/docs/modules-cluster.md:209)

:: fail: Documentation.Builder.Log[0] `data-node-role` does not exist in node-roles-overview.md. (/Users/brandon/Documents/GitHub/elasticsearch.md/docs/modules-cluster.md:266)
:: fail: Documentation.Builder.Log[0] `data-node-role` does not exist in node-roles-overview.md. (/Users/brandon/Documents/GitHub/elasticsearch.md/docs/modules-cluster.md:266)
:: fail: Documentation.Builder.Log[0] `data-node-role` does not exist in node-roles-overview.md. (/Users/brandon/Documents/GitHub/elasticsearch.md/docs/high-availability-cluster-small-clusters.md:53)
:: fail: Documentation.Builder.Log[0] `ml-node-role` does not exist in node-roles-overview.md. (/Users/brandon/Documents/GitHub/elasticsearch.md/docs/high-availability-cluster-small-clusters.md:53)
:: fail: Documentation.Builder.Log[0] `voting-only-node` does not exist in node-roles-overview.md. (/Users/brandon/Documents/GitHub/elasticsearch.md/docs/high-availability-cluster-small-clusters.md:57)

:: fail: Documentation.Builder.Log[0] `schedule-cron` does not exist in . (/Users/brandon/Documents/GitHub/elasticsearch.md/docs/snapshot-settings.md:19)

:: fail: Documentation.Builder.Log[0] `shard-recovery` does not exist in shard-allocation-relocation-recovery.md. (/Users/brandon/Documents/GitHub/elasticsearch.md/docs/high-availability-cluster-design-large-clusters.md:7)

If you go through the files listed in the log, you'll see that the anchor does exist in all markdown files. If you build with the serve command, all of these links also work.

Other note: Some errors don't list a file name:

:: fail: Documentation.Builder.Log[0] `schedule-cron` does not exist in . (/Users/brandon/Documents/GitHub/elasticsearch.md/docs/snapshot-settings.md:19)

This seems to occur when the file name starts with an underscore (_). In the example above, the file name is: _schedule_types.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions