The command that removes the subscription notice: the most common one-liner, the quietest damage

The first thing everyone meets after installing is the subscription notice, and the first fix everyone finds is a one-line command. The common version of that command was measured: it can break the entire interface library.

AtlasPVE ·

This entry answers

  • proxmox remove subscription notice
  • proxmox no valid subscription
  • proxmox post install script
  • what to do after installing proxmox
  • proxmox nag remove

You installed Proxmox, logged in, and the subscription notice appeared. It is irritating, because it comes back at every login. You search, you find a one-line command. It appears to work.

This article is about that command, but its real subject is not the command: the quiet cost of pasting something you do not understand.

The measured mistake

There is a genuine flaw inside the widely circulated one-liner, and the flaw is subtle.

In the basic regular expressions of classic text-editing tools, a pipe written with a backslash is not a plain character, it is the alternation operator. The condition in the interface code contains two pipes, and when the command escapes them as they are, an empty alternative appears between two alternation operators.

An empty alternative matches at every position in the file. Run together with "replace all", the expression sprinkles the change through the entire file.

This is not a guess. It was measured on a copy of the real file: 26458 of 26458 lines changed, and the count of false in the file went from 558 to 26458. The administrator who ran that command would have broken the whole Proxmox interface library.

There is a second problem on top: the targeted condition does not sit on one line, Proxmox spreads it over six. A tool that works line by line could never have matched it correctly in the first place.

Why nobody noticed

Because the damage is silent. The command does not error, nothing turns red on the screen. The interface can keep working for a while, the trouble shows up later, and at that moment nobody connects it to "the command I pasted last week".

The general lesson from this: "it works for everyone" is not proof. Most of the time it is only proof that nobody looked.

Four rules for every change of this class

Any operation that touches a system file, whoever performs it, has to carry these four.

The backup is taken once and never overwritten. Refreshing the backup on every run means that on the second run you back up the broken state.

The aim is narrow. If the targeted text has genuinely changed, the operation is not performed. Changing the nearest thing by guesswork is worse than changing nothing.

The file is read back after writing. If the expected result did not appear, the backup is restored. A write not erroring does not mean it wrote the right thing.

A marker is left. The question "is this file patched" must be answered by the presence of a mark, not by guesswork.

The case nobody considers: what if the backup is already broken

Even doing all four leaves one gap. What if another tool broke the file earlier and you took the backup after that?

Then the revert brings back the broken file and you believe you fixed it. That is why the revert must be verified too: did the original really come back, or was the backup itself already patched?

This is an example of the question that has to be asked constantly when working with an installed machine: not what happens on a clean install, but what happens on a machine carrying an old state?

What Atlas does

Atlas does this work inside the product rather than by pasting a command, and it applies all four of the above.

The backup is taken once and never overwritten. The aim is narrow: a pattern that is flexible about whitespace but exact about the rest, so it keeps holding if Proxmox changes the formatting, but if the condition itself has changed, nothing is done. After writing, the file is read back and verified; if the expected result does not appear, the backup is restored. And the text that is put in place carries a marker, so the question "is it patched" is answered with certainty.

On the revert side the last case above is handled too: after the backup is restored, it is checked whether the original really came back, and if it did not, that is said plainly.

The one sentence this article really wants to say is this: the job is not hard, but the difference between doing it right and appearing to work runs through measuring.

Sources

Proxmox's own documentation. In English, and it has the final word on this subject.

Related entries

How does this look inside Atlas?

Go to the product page