CloudPanel version(s) affected
2.5.4
Description
Summary
The Sites > (site) > Vhost editor refuses to save with
Vhost is not valid, error message:
and the error message placeholder is empty. No reason is shown.
This reproduces with the site's own, unmodified, currently stored
template: copy what the editor displays, paste it back unchanged,
press Save. It is rejected.
The rendered configuration is valid: nginx -t on the generated vhost
returns test is successful.
Environment
|
|
| CloudPanel |
2.5.4 (CLI 6.0.8) |
| OS |
Ubuntu 26.04 LTS |
| nginx |
1.30.4 |
| PHP |
8.4.24 |
| Site type |
PHP |
What I measured
1. The stored template is clean. Read directly from
/home/clp/htdocs/app/data/db.sq3, field site.vhost_template, at byte
level:
length 2368 bytes, 106 lines
contains \r 0
contains non-ASCII 0
2. nginx accepts the rendered result. I wrote the rendered template
to the live vhost path and ran nginx -t:
nginx: configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
3. The save sequence is visible in syslog, and the failure is not.
Two attempts, both identical:
sudo[...]: clp : COMMAND=/usr/bin/cp /etc/nginx/sites-enabled/<site>.conf /etc/nginx/sites-enabled/<site>.conf.bak
sudo[...]: clp : COMMAND=/usr/bin/cp /etc/nginx/sites-enabled/<site>.conf.bak /etc/nginx/sites-enabled/<site>.conf
sudo[...]: clp : COMMAND=/usr/bin/bash -c /bin/rm -f '/etc/nginx/sites-enabled/<site>.conf.bak'
Backup, write, restore, cleanup. The validation step itself
leaves no trace, presumably because it runs as root directly rather
than through sudo.
4. Nothing is logged anywhere.
/var/log/clp-agent/agent.log 0 bytes
/home/clp/logs/nginx/error.log 0 bytes
/home/clp/logs/php/error.log last entry 10 days old (FPM startup only)
journalctl -u clp-agent no entries
Why the empty message matters more than the rejection
A rejection with a reason is a normal guard rail. A rejection with an
empty reason gives the operator nothing to act on, and the
validation step writes no log, so there is no second place to look.
In my case I only established that my own change was not the cause
by pasting the unmodified template and seeing it rejected too.
What I was trying to do
Add a single include line to the template so a set of hand-maintained
location blocks survives vhost regeneration:
{{settings}}
include /etc/nginx/snippets/custom.conf;
The documentation describes syntax checking, rollback and an error
message, but says nothing about restrictions on include. I could not
find an existing issue with this symptom.
include is already used inside the default template
(include /etc/nginx/global_settings;), so the directive itself does
not appear to be rejected, and in any case the unmodified template is
rejected as well, so the include line is not the trigger.
Suggested fix
Surface the validator's actual error, or log it. If the check is
intentional, the message is what makes it usable.
How to reproduce
- Sites > (a PHP site) > Vhost
- Select the entire template shown in the editor, copy it
- Without changing anything, paste it back (replacing the content)
- Press Save
Expected: saved, or rejected with a reason.
Actual: Vhost is not valid, error message: with an empty reason.
Possible Solution
No response
Additional Context
No response
CloudPanel version(s) affected
2.5.4
Description
Summary
The Sites > (site) > Vhost editor refuses to save with
and the error message placeholder is empty. No reason is shown.
This reproduces with the site's own, unmodified, currently stored
template: copy what the editor displays, paste it back unchanged,
press Save. It is rejected.
The rendered configuration is valid:
nginx -ton the generated vhostreturns
test is successful.Environment
2.5.4(CLI6.0.8)What I measured
1. The stored template is clean. Read directly from
/home/clp/htdocs/app/data/db.sq3, fieldsite.vhost_template, at bytelevel:
2. nginx accepts the rendered result. I wrote the rendered template
to the live vhost path and ran
nginx -t:3. The save sequence is visible in syslog, and the failure is not.
Two attempts, both identical:
Backup, write, restore, cleanup. The validation step itself
leaves no trace, presumably because it runs as
rootdirectly ratherthan through
sudo.4. Nothing is logged anywhere.
Why the empty message matters more than the rejection
A rejection with a reason is a normal guard rail. A rejection with an
empty reason gives the operator nothing to act on, and the
validation step writes no log, so there is no second place to look.
In my case I only established that my own change was not the cause
by pasting the unmodified template and seeing it rejected too.
What I was trying to do
Add a single
includeline to the template so a set of hand-maintainedlocationblocks survives vhost regeneration:The documentation describes syntax checking, rollback and an error
message, but says nothing about restrictions on
include. I could notfind an existing issue with this symptom.
includeis already used inside the default template(
include /etc/nginx/global_settings;), so the directive itself doesnot appear to be rejected, and in any case the unmodified template is
rejected as well, so the
includeline is not the trigger.Suggested fix
Surface the validator's actual error, or log it. If the check is
intentional, the message is what makes it usable.
How to reproduce
Expected: saved, or rejected with a reason.
Actual:
Vhost is not valid, error message:with an empty reason.Possible Solution
No response
Additional Context
No response