Skip to content

Conversation

@PandaFosec
Copy link

Description

This PR adds comprehensive Windows WSL Docker troubleshooting documentation to address "exec format error" issues when running DefectDojo in WSL environments.

Problem Addressed:
Users running DefectDojo with Docker in Windows WSL encounter "exec /wait-for-it.sh: exec format error" due to:

  • CRLF line endings in shell scripts (Windows default vs. Linux LF requirement)
  • UTF-8 BOM characters in script files
  • Lack of WSL-specific troubleshooting documentation

Solution Implemented:

  • Added comprehensive WSL troubleshooting section to readme-docs/DOCKER.md
  • Provided PowerShell scripts to fix line ending issues
  • Added minimal .editorconfig for prevention (shell scripts and Dockerfiles only)
  • Included WSL-specific prerequisites and performance recommendations

Files Changed:

  • Fixed CRLF line endings and removed UTF-8 BOM from all shell scripts in /docker/ directory (18 files)
  • Added minimal .editorconfig targeting only WSL Docker issues
  • Enhanced readme-docs/DOCKER.md with WSL troubleshooting section

Test results

Tested scenarios:

  • ✅ DefectDojo successfully deploys in Windows WSL 2 with Docker Desktop
  • ✅ All containers start without "exec format error"
  • ✅ Application accessible at http://localhost:8080
  • ✅ Database initialization completes successfully
  • ✅ Admin login works with generated password

Testing environment:

  • Windows 11 with WSL 2
  • Docker Desktop for Windows with WSL 2 backend
  • Ubuntu 22.04 LTS in WSL

Documentation

Updated readme-docs/DOCKER.md with:

  • New "Windows WSL Docker Troubleshooting" section
  • PowerShell scripts for fixing line ending issues
  • Prevention measures and best practices
  • WSL-specific prerequisites
  • Performance optimization recommendations

Checklist

  • Make sure to rebase your PR against the very latest bugfix
  • Bugfixes should be submitted against the bugfix branch ✅
  • Give a meaningful name to your PR ✅
  • If this is a new feature and not a bug fix, you've included the proper documentation ✅
  • Add applicable tests to the unit tests (N/A - documentation only)

Labels to add:

  • bugfix (fixes WSL container startup issues)
  • documentation (adds missing WSL troubleshooting)

Extra information

This contribution addresses a significant pain point for Windows developers using WSL, which is a common development environment. The documentation provides both immediate solutions for existing issues and prevention measures for new setups.

The PowerShell scripts provided can be easily copy-pasted by users experiencing the issue, making the troubleshooting process straightforward and accessible.

Commits in this PR:

  • 294beed600 Add Windows WSL Docker troubleshooting documentation
  • 934d0cb5c8 Simplify EditorConfig to minimal WSL Docker fix

Rene PERRAUX added 2 commits February 11, 2026 18:03
- Add comprehensive WSL troubleshooting section to DOCKER.md
- Document exec format error solutions for CRLF/LF line ending issues
- Include prevention measures with VS Code and EditorConfig examples
- Add WSL-specific prerequisites and common issues section
- Provide PowerShell scripts to fix line endings and UTF-8 BOM issues

Resolves common Windows WSL Docker container startup failures with
'exec format error' that occur due to Windows line endings and
UTF-8 BOM characters in shell scripts.
- Reduce .editorconfig to only essential WSL Docker troubleshooting rules
- Remove unnecessary formatting rules unrelated to line ending issues
- Update DOCKER.md documentation to match minimal configuration
- Focus on core fix: LF line endings for shell scripts and Dockerfiles
Copy link
Contributor

@Maffooch Maffooch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HI @PandaFosec thank you for the PR! I am a little hesitant to document debugging tips for WSL as it would imply that we support DefectDojo installations on WSL. Most of these debugging tips appear to be a pretty common experience for WSL users, so having dedicated documentation within DefectDojo feels a little out of scope

@mtesauro what are your thoughts?

@mtesauro
Copy link
Contributor

HI @PandaFosec thank you for the PR! I am a little hesitant to document debugging tips for WSL as it would imply that we support DefectDojo installations on WSL. Most of these debugging tips appear to be a pretty common experience for WSL users, so having dedicated documentation within DefectDojo feels a little out of scope

@mtesauro what are your thoughts?

I agree that, while these might be handy for someone, actually putting them in the docs would imply we develop and test DefectDojo on WSL (which we don't).

Maybe it makes more sense to put them in a Github Discussion so others can find them but they're not part of our "actual" documentation.

@PandaFosec Do you mind moving this content over to a discussion topic and closing this PR?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants