Skip to content

fix(plesk): list a panel that has no customers or no resellers - #448

Merged
Panelica merged 1 commit into
Panelica:mainfrom
vvezzola:fix/plesk-empty-owner-list
Nov 16, 2026
Merged

Panelica merged 1 commit into
Panelica:mainfrom
vvezzola:fix/plesk-empty-owner-list

Conversation

@vvezzola

Copy link
Copy Markdown
Contributor

Summary

On a Plesk server that has no customers, or no resellers, the account list for linking and for the sync page failed with Attempt to read property "login" on null.

Plesk answers an empty list with one result that is ok and carries nothing:

<reseller><get><result><status>ok</status></result></get></reseller>

owners() selected every result[status="ok"] and read that one as an owner. It has no data, so gen_info was null and the whole list stopped. The server where I met it holds only subscriptions of the administrator and of customers, with no reseller.

Every list read from the XML API now takes only the results that carry data (result[status="ok"][data]): owners, subscriptions, the sync page's details and the reseller accounts.

The same shape had a second effect, fixed by the same change. When the last subscription of a customer is terminated, the module counts what the customer has left; an empty answer counted as one subscription, so the Plesk customer was kept with the message that other subscriptions remained.

Linked issue

None. Follow-up to #426 and #428, where these reads were added.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that changes existing behaviour)
  • Documentation only
  • Refactor / chore (no behaviour change)
  • Translation
  • Theme / styling
  • New module (gateway / registrar / server adapter)

Checklist

  • My branch is up to date with main
  • ./vendor/bin/pint --test passes (changed files)
  • ./vendor/bin/phpstan analyse passes: not run for this change; only xpath strings and a comment changed in the module
  • php artisan test passes: I ran the Plesk and server sync test files only (99 tests, on MariaDB), not the full suite
  • I've added or updated tests for my change: two tests in PleskExistingSubscriptionsTest, both fail on main
  • I've updated documentation (docs/, README.md, .env.example) where relevant: not applicable
  • I've added or updated translation keys in lang/en/: not applicable
  • I've considered the impact on existing installations (migration, config defaults): none; a result with data is read as before

Additional context

The empty-result shape for owners is what the error on the real server points to: the same message at the same line comes from a test that feeds it. I have not captured that server's raw answer, and I have not confirmed on a real server that the filtered webspace get (by owner-id) answers with the same empty result when nothing is left; the change is safe either way, because a real subscription always carries data when gen_info is asked for.

Plesk answers an empty list with one result that is ok and carries
nothing: no id, no data. The owners list read it as an owner and the
whole account list stopped with 'Attempt to read property "login" on
null'. Every list now takes only the results that carry data, which
also lets the last subscription's customer be removed when Plesk
answers that way for what is left.
@Panelica
Panelica merged commit aa0db40 into Panelica:main Nov 16, 2026
1 check passed
@Panelica

Copy link
Copy Markdown
Owner

Merged — thank you. "ok and carries nothing" is a shape worth knowing about, and taking only the results that carry data is the right answer everywhere rather than at the one call that crashed.

Measured:

  • Both your tests fail on main and pass here; the Plesk and sync tests together are green on the merge result, full suite 5426 passed, 0 failed.
  • The [data] predicate is applied to all five reads, not only owners() — owners, subscriptions, the sync details, the reseller accounts and the remaining-subscriptions count.

The second effect deserves saying out loud, since it changes what happens to a customer's account rather than what a list shows: with the bug, an empty answer counted as one remaining subscription, so terminating the last service never removed the Plesk customer — it always reported that others remained. With this fix that deletion path works for the first time since #426 added it. It is the intended behaviour and it is guarded by a real count, but an operator who had grown used to the customer being left behind will see something new.

Merging is not shipping: this reaches installations with the next release.

@Panelica

Copy link
Copy Markdown
Owner

Released in 1.29.0 — thank you.

Gates on the tag: the full suite 5426 passed, 0 failed; the update lab's 14 scenarios green on a run of its own; the real package updating 1.28.0 on the stable channel and the last beta on the beta channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants