Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open Beginner friendly
#42,296 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
node.js, typescript
Domain
cli

Research direction

Start in app/client/packages/rts/src/ctl/restore.ts at run() and review the proposed createRestoreTempDirectory helper. Run the restore.test.ts regression test, which checks that the workspace parent is the configured temp directory, then verify the restore suite, RTS tsc, ESLint, and Prettier pass.

Written by the indexing model from the issue text.

Description

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:

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:

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.

Dominant language
TypeScript
Stars
40.9k
Forks
4.8k
Avg merge
2d 10h
Merged PRs (30d)
57

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from appsmithorg/appsmith

All issues in appsmithorg/appsmith

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.