Skip to content

fix(website): skip runtime archive for websites on a local PHP runtime - #14409

Merged
ssongliu merged 1 commit into
1Panel-dev:dev-v2from
b84330808:fix-backup-website-local-php-runtime
Nov 13, 2026
Merged

ssongliu merged 1 commit into
1Panel-dev:dev-v2from
b84330808:fix-backup-website-local-php-runtime

Conversation

@b84330808

Copy link
Copy Markdown
Contributor

What this PR does / why we need it?

Fixes #13900.

Backing up a website that runs on a PHP runtime whose source is "local" always fails, both from the backup page and from a scheduled backup:

备份 [www.xxx.com] 失败: stderr: tar: php81l: Cannot stat: No such file or directory

A local runtime is only a database record. RuntimeService.Create returns before anything is written to disk, so /opt/1panel/runtime/php/<name> never exists. doWebsiteBackup still calls handleRuntimeBackup for every runtime website, and that tars the missing directory.

Restoring such a website has the same problem: recover first takes a rollback backup (which fails the same way), and then expects a <alias>.runtime.tar.gz inside the archive.

Summary of your change

  • doWebsiteBackup: skip the runtime archive when the runtime's resource is local. The site files, nginx config and database are still backed up.
  • handleWebsiteRecover: skip the runtime restore for these websites, since their backups never contain a runtime archive.
  • Add TestWebsiteBackupWithLocalPHPRuntime, which backs up a website on a local PHP runtime. It fails without the change with the tar ... Cannot stat error and passes with it (run on ubuntu-latest; the repo has no Go test CI). In that run TestAppStoreIndexUsesCacheUntilRevisionChanges fails both with and without this change, on a TLS error from the test's fake server.

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

A PHP runtime whose source is "local" has no directory under
/opt/1panel/runtime/php, so backing up a website that uses it fails
with "tar: <name>: Cannot stat: No such file or directory". Skip the
runtime archive for local runtimes on backup, and skip the runtime
restore on recover, since such a backup never contains one.

Refs 1Panel-dev#13900
@ssongliu
ssongliu merged commit aea4de1 into 1Panel-dev:dev-v2 Nov 13, 2026
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.

[Bug] Fix an Error When Creating a Scheduled Task Backup Website

2 participants