Skip to content

No version is shown in footer if at least one remote version is missing/empty from versions file #3728

@stroebjo

Description

@stroebjo

Versions

  • Pi-hole: v6.4
  • Web: v6.4.1
  • FTL: v6.5

Platform

  • OS and version: Pi-hole Docker 2026.02.0
  • Platform: Synology

Expected behavior

Locally used version should always be shown in the footer.

Actual behavior / bug

In the footer.js the function to compare the versions doesn't handle null values. If the remote version (v2) is null it breaks, and leads to no versions being displayed in the footer at all.

A safety check to convert null values to string would resolve this, and at least the local version would always be displayed, i.e. with this at the beginning of the versionCompare function:

v1 = typeof v1 === "string" ? v1 : "";
v2 = typeof v2 === "string" ? v2 : "";

Though this would not show to the user, that the update check was not successful, I would suggest to to implement a third state in the JavaScript logic, to show that no remote version is known? Like the N/A in the pihole -v command.

Steps to reproduce

  1. Edit versions file (inside the Docker container at /etc/pihole/versions) to have at least one empty GITHUB_*_VERSION=-key, i.e. GITHUB_WEB_VERSION= (no value!).
  2. Open web interface, versions are missing. Browser DevTools shows the error Uncaught TypeError: can't access property 0, v2 is null.

Additional context

The empty/null value can happen if the curl calls fail for some reason in the updatecheck.sh script, which leads to empty strings in the /etc/pihole/versions file, which in turn lead to null values returned from the api/info/version endpoint.

There also seems some mix in setting empty string (->null) and "null" in case of errors in the shell script.

In my specific case only the first curl call in the updatecheck.sh worked and all following failed for a reason I don't fully understand. Leading to the empty string/null values in the version file. I documented this behavior here: https://jonathanstroebele.de/notes/it-s-always-dns-pi-hole-curl-fritz-box

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions