Skip to content

Fix Redis write failures on Windows Docker bind mounts#12418

Open
br413 wants to merge 6 commits into
inventree:masterfrom
br413:fix/docker-redis-windows
Open

Fix Redis write failures on Windows Docker bind mounts#12418
br413 wants to merge 6 commits into
inventree:masterfrom
br413:fix/docker-redis-windows

Conversation

@br413

@br413 br413 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Context

On Windows Docker Desktop, the inventree-data/redis bind mount can prevent Redis from writing dump.rdb, triggering MISCONF errors and blocking all write operations (including django-allauth login rate limiting).

#12415 merged the core fix (disable RDB/AOF persistence) but removed the external volume mount. This PR restores the #11100 volume layout for consistency, as discussed with @SchrodingersGat — persistence remains off, so no dump.rdb writes occur and the Windows permission issue is still resolved.

InvenTree uses Redis purely as a Django cache backend (django_redis); cache data is ephemeral and does not require durable storage.

Test plan

  • Verified Redis accepts writes after change (redis-cli SET testkey ok)
  • Verified login succeeds at http://localhost/web/login with demo credentials
  • Confirmed existing Linux Docker behavior is unaffected

br413 added 2 commits July 17, 2026 20:18
Disable Redis disk persistence to avoid bind-mount permission errors that caused login 500s, and configure localhost as the default site URL.
Disable RDB persistence for the cache container so login and other cache writes do not fail when the Redis data volume cannot be written on Windows hosts.
@br413
br413 requested a review from SchrodingersGat as a code owner July 18, 2026 02:28
@netlify

netlify Bot commented Jul 18, 2026

Copy link
Copy Markdown

Deploy Preview for inventree-web-pui-preview ready!

Name Link
🔨 Latest commit 25d2864
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/6a5e2535b9318d000825a0d9
😎 Deploy Preview https://deploy-preview-12418--inventree-web-pui-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 97 (no change from production)
Accessibility: 81 (no change from production)
Best Practices: 100 (no change from production)
SEO: 78 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@br413

br413 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

Hi @matmair — this fixes Redis MISCONF / HTTP 500 login failures on Windows Docker Desktop when the redis bind mount cannot write dump.rdb.

The change makes the cache service ephemeral (--save "" --appendonly no) and removes the data volume, which matches how Redis is used here (cache only, not durable storage).

Happy to adjust if you would prefer a platform-specific compose override instead.

@SchrodingersGat

Copy link
Copy Markdown
Member

This would prevent any persistent storage of redis data, correct? And thus revert the changes made in ff9f465

br413 added 2 commits July 19, 2026 22:57
Addresses review feedback on inventree#12418: retain the external /data volume from
inventree#11100 but disable RDB/AOF writes so Windows bind mounts no longer trigger
MISCONF errors.
@br413

br413 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@SchrodingersGat — good question. The initial version did revert the volume mount from #11100; I've pushed an update that keeps it.

The fix is disabling disk persistence (--save "" --appendonly no), not removing the mount. That stops Redis from writing dump.rdb to /data, which is what triggers MISCONF on Windows bind mounts when permissions block writes.

The volume from #11100 stays in place for layout consistency. With persistence off, Redis no longer snapshots to disk, so the original #10977 concern (anonymous volumes accumulating dump.rdb) is also addressed without needing RDB writes.

InvenTree uses Redis purely as a Django cache backend (django_redis), so cache loss on container restart is expected and acceptable — unlike Postgres, nothing durable lives in Redis here.

@br413

br413 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Migration Test failure is pre-existing on master (TestRemoveMpttFieldsMigration / duplicate status_custom_key ORM bug from #12360). Docker Build Test passed.

@br413

br413 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto latest master and resolved the merge conflict with #12415.

#12415 already landed the persistence disable (--save "" --appendonly no). This PR now only restores the ${INVENTREE_EXT_VOLUME}/redis:/data volume mount from #11100, per the earlier discussion with @SchrodingersGat — persistence stays off, so Windows MISCONF errors remain fixed while the external volume layout is preserved.

Updated the PR description to reflect the narrower scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants