[Bug]: appsmithctl restore extracts into /tmpXXXXXX at the filesystem root instead of inside the temp directory
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 withEACCESbefore 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
node -e 'require("fs/promises").mkdtemp(require("os").tmpdir()).then(console.log)'prints/tmpXXXXXX, not/tmp/XXXXXX.- Run
appsmithctl restorein 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from appsmithorg/appsmith
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
appsmithorg/appsmith#42297 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
appsmithorg/appsmith#42295 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
appsmithorg/appsmith#42118 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
appsmithorg/appsmith#42115 · 1 comment ·
Maintainers usually reply within 1 day
-
close-labeler workflow uses break instead of continue, dropping the QA label on multi-issue PRsOpenContributor Expressed Interest
Difficulty 1/5 Under an hour Newbie friendliness 88/100
appsmithorg/appsmith#41983 · 2 comments ·
Maintainers usually reply within 1 day
All issues in appsmithorg/appsmith
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
openedx/frontend-app-authoring#3274 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
area/documentation status/need-triage
Difficulty 1/5 Under an hour Newbie friendliness 95/100
google-gemini/gemini-cli#29548 ·
Maintainers usually reply within 1 day
-
sdk-typescript vector-store
Difficulty 2/5 Half a day Newbie friendliness 82/100
mem0ai/mem0#7495 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day