Skip to content

Bulk model dry runs fail with MODEL_CACHE_MODELSET_MISSING_SIGNATURE #967

Closed

Description

@pavelsg

On unmodified pfREST 2.10.2, a dry-run replacement of HAProxy frontends containing
one ordinary independent frontend throws:

RESTAPI\Responses\ServerError: ModelSet cannot be cached without a valid signature.

Reproduction on a disposable pfSense CE 2.8.1 installation with HAProxy 0.63_11:

require_once 'RESTAPI/autoloader.inc';
(new \RESTAPI\Models\HAProxyFrontend(dry_run: true))->replace_all([
    ['name' => 'upstream_repro', 'type' => 'http'],
]);

Expected: validate and return the prospective frontend collection without writing
configuration. Actual: MODEL_CACHE_MODELSET_MISSING_SIGNATURE.

Core/Model.inc::replace_all() constructs $new_objects = new ModelSet() without
a signature, then its dry-run branch passes that set to
ModelCache::cache_modelset(), which requires a signature. This is present at
next_minor commit 27e7fd9f28b8f8d25abe594aefa09803a81434a8 as well.

While adding Shared Frontend reference validation, a related ordering problem
became apparent: the first replacement candidate can query the old collection
before the new collection is cached. A shared frontend referencing an existing
primary that is omitted from the replacement must be rejected; it must not
validate using the old primary and only fail later at cache insertion.

Suggested direction for maintainer review: construct the prospective collection
with the model's root signature, seed it before validating the first candidate,
invalidate cached derived queries as that collection grows, and clear temporary
cache state in finally, including on validation errors. Protected objects and
both direct and foreign-model lookups need regression coverage.

No Core patch is included. The repository's agent guide explicitly requires
maintainer approval for Core changes. This issue is proposed to agree scope before
addressing the framework behavior. No production firewall was used.

Activity

  1. jaredhendrickson13 commented on Nov 1, 2026

    @jaredhendrickson13
    Member

    This is already addressed by 20bea6e in the next release branch.

  2. linked a pull request that will close this issuev2.11.0 Fixes & Features #959on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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