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

Use octal file modes in the Redis and Valkey modules

Open Beginner friendly
#1,526 0 comments 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
79/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
docker, node.js, typescript
Domain
databases, testing

Research direction

Read packages/modules/redis/src/redis-container.ts and packages/modules/valkey/src/valkey-container.ts, focusing on the withCopyFilesToContainer mode values. Check how FileToCopy.mode is documented or used, then run the relevant Redis and Valkey module tests. Done when the data file uses 0o644 and the import script uses 0o755 in both modules.

Written by the indexing model from the issue text.

Description

bug patch

What happens

The Redis and Valkey modules pass file modes as decimal numbers where octal was intended:

this.withCopyFilesToContainer([
  { mode: 666, source: this.initialImportScriptFile, target: this.importFilePath },
  { mode: 777, source: path.join(__dirname, "import.sh"), target: "/tmp/import.sh" },
]);

Decimal 666 is octal 1232 and decimal 777 is octal 1411. Copying files with those modes and running stat in the container:

/tmp/mode-decimal-666  1232  --w--wx-wT
/tmp/mode-decimal-777  1411  -r----x--t
/tmp/mode-octal-666     666  -rw-rw-rw-
/tmp/mode-octal-777     777  -rwxrwxrwx

So the import data file is write-only for its owner, and import.sh is read-only for its owner and execute-only for everyone else. withInitialData works today only because exec runs as root (uid 0), which bypasses the permission bits. A non-root exec user could read neither file.

Expected

The modes are written in octal (0o644 for the data file, 0o755 for the script).

Where

  • packages/modules/redis/src/redis-container.ts
  • packages/modules/valkey/src/valkey-container.ts

Notes

  • FileToCopy.mode and ContentToCopy.mode are typed number with no JSDoc. A one-line comment saying the value is an octal permission (0o644) would help prevent this.
  • The stat output was reproduced on main (aa60a746, 12.2.0) with GenericContainer and the same mode values. The non-root case is from reading the permission bits, not run.

Dependencies

  • Nothing blocks this. It can start now.
  • Coordinate with #1525: the exec call in the same two files sits a few lines below the modes. Change both in one pull request.
Dominant language
TypeScript
Stars
2.6k
Forks
274
Avg merge
1d 14h
Merged PRs (30d)
44

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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 testcontainers/testcontainers-node

All issues in testcontainers/testcontainers-node

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.