Wiki page with "pages" path cannot be accessed through the UI once created

Summary

When creating a wiki page named pages (available at the same path), the page (and its content) cannot be accessed, edited or removed afterwards.

Instead, an overview of all wiki pages is shown. The content shown is the same than when clicking on View all pages link in the wiki navigation.

Only the wiki REST API returns the correct list of wiki pages and the expected content for the pages wiki page.

Steps to reproduce

  1. Create or go to an existing wiki within a project
  2. Create a new wiki page named pages (check the Generate page path from title checkbox) with some content
  3. Click on "Create page"
  4. Notice that the content of the pages cannot be accessed through the UI. Instead, a summary of the wiki pages is displayed. This is the same behavior than when clicking the View all pages link in the wiki navigation.

Example Project

What is the current bug behavior?

The content shown is the same than when clicking on View all pages link in the wiki navigation.

The View all pages link has already the <BASE_URL>/-/wikis/pages URL hardcoded so it looks like pages should be part of the reserved wiki paths that cannot be used by users.

This should also be documented, maybe in https://docs.gitlab.com/user/reserved_names/.

What is the expected correct behavior?

Any created wiki page and its content should be available through the wiki UI/navigation.

Relevant logs and/or screenshots

image

  • GET https://gitlab.com/api/v4/projects/76804981/wikis
[
  {
    "format": "markdown",
    "slug": "home",
    "title": "home",
    "wiki_page_meta_id": 4959885
  },
  {
    "format": "markdown",
    "slug": "pages",
    "title": "pages",
    "wiki_page_meta_id": 4959887
  }
]
  • GET https://gitlab.com/api/v4/projects/76804981/wikis/pages
{
  "format": "markdown",
  "slug": "pages",
  "title": "pages",
  "wiki_page_meta_id": 4959887,
  "content": "Content of a wiki page with `pages` path",
  "encoding": "UTF-8",
  "front_matter": {}
}

Output of checks

  • Reproduced on self-hosted GitLab Enterprise Edition v18.6.1-ee.
  • This bug happens on GitLab.com (GitLab Enterprise Edition 18.7.0-pre a7dc473c6ef)

Possible fixes

Prevent users from creating wiki pages with the pages path since this looks like a reserved path/name.

I could not find a page listing those for wikis so maybe https://docs.gitlab.com/user/reserved_names/ could be extended.

Edited by 🤖 GitLab Bot 🤖