Repository navigation
fix(website): skip runtime archive for websites on a local PHP runtime - #14409
Merged
ssongliu merged 1 commit intoNov 13, 2026
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
A local runtime is only a database record.
RuntimeService.Createreturns before anything is written to disk, so/opt/1panel/runtime/php/<name>never exists.doWebsiteBackupstill callshandleRuntimeBackupfor 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.gzinside the archive.Summary of your change
doWebsiteBackup: skip the runtime archive when the runtime's resource islocal. 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.TestWebsiteBackupWithLocalPHPRuntime, which backs up a website on a local PHP runtime. It fails without the change with thetar ... Cannot staterror and passes with it (run on ubuntu-latest; the repo has no Go test CI). In that runTestAppStoreIndexUsesCacheUntilRevisionChangesfails both with and without this change, on a TLS error from the test's fake server.Please indicate you've done the following: