Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#42296·appsmith

[Bug]: appsmithctl restore extracts into /tmpXXXXXX at the filesystem root instead of inside the temp directory

Author: breken-aiCreated Sep 26, 2026Updated Sep 26, 2026

Is there an existing issue for this?

  • I have searched the existing issues

Description

appsmithctl restore creates its extraction directory beside the temp directory, not inside it.

run() in app/client/packages/rts/src/ctl/restore.ts:487 (release @ a6ab36cb26) calls:

typescript
const restoreRootPath = await fsPromises.mkdtemp(os.tmpdir());

fs.mkdtemp(prefix) appends six random characters to the prefix. It does not create a child directory of it. With os.tmpdir() === "/tmp", the restore workspace becomes /tmpAbC123 at the filesystem root:

  • A non-root deployment can't write to /, so the restore fails with EACCES before extraction.
  • A root deployment extracts the whole backup (database dump, git storage, env) outside the configured temp directory. Temp cleanup, tmpfs sizing and volume layout all assume /tmp.

What I expect is that the workspace is created inside os.tmpdir(), e.g. /tmp/appsmithctl-restore-AbC123.

Steps To Reproduce

  1. node -e 'require("fs/promises").mkdtemp(require("os").tmpdir()).then(console.log)' prints /tmpXXXXXX, not /tmp/XXXXXX.
  2. Run appsmithctl restore in a container whose user can't write to /. The restore fails creating /tmpXXXXXX.

Failing unit test (red on release, green with the fix). It uses a real mkdtemp in a sandbox:

typescript
const restoreRoot = await createRestoreTempDirectory(tempRoot);
expect(path.dirname(restoreRoot)).toBe(tempRoot);
// release behaviour: the parent is the sandbox, not sandbox/tmp

Proposed approach (a fix with a regression test is ready): mkdtemp(path.join(os.tmpdir(), "appsmithctl-restore-")), extracted into a small exported helper so it can be tested. The change is 1 line in run() plus the helper, and it adds 1 test in restore.test.ts. The restore suite passes (16/16), along with RTS tsc, ESLint and Prettier.

@contributor-support I'd like to take this. Could it be assigned to me? I'll open the PR against release with Fixes #<this> once it's assigned.

Public Sample App

No response

Environment

Release

Severity

Medium (Frustrating UX)

Issue video log

No response

Version

Self Hosted - release @ a6ab36cb26

Prepared with AI assistance (Claude) from the breken-ai account.

Source: appsmithorg/appsmith

View original on GitHubView discussion on GitHub