Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Snakemake arguments with file paths containing backslashes produce file not found errors #251

Open
huddlej opened this issue Jan 17, 2023 · 0 comments
Labels
bug Something isn't working papercut Something that works but could be better windows Windows support

Comments

@huddlej
Copy link
Contributor

huddlej commented Jan 17, 2023

Current Behavior

When users run the nextstrain build command from Windows with Docker and provide an argument to Snakemake that references a local path using backslashes (e.g., nextstrain build . --configfile my_profiles\myconfig.yaml), Snakemake throws a FileNotFoundError. The error occurs because the file path is interpreted from a Linux operating system inside the Docker container or WSL2 VM where that path actually does not exist. However, this error is confusing for the user when they can clearly see the file on their local file system from Windows.

Expected behavior

Users should be able to provide a valid Windows path to nextstrain build and have it interpreted as expected, only returning an error if that file really does not exist.

How to reproduce

# Clone ncov repo.
git clone https://github.com/nextstrain/ncov.git
cd ncov

# Run Nextstrain's CI build from Windows.
nextstrain build . --configfile nextstrain_profiles\nextstrain-ci\builds.yaml

Possible solutions

  • Automatically convert slashes in paths for specific Snakemake arguments. We already pre-process some Snakemake arguments as part of the CLI, so this would not be unprecedented. Which arguments to process isn't as clear. Maybe just --configfile and --profile, to start.
  • Automatically convert all slashes in all path-like inputs? Probably hard to do correctly in every case, but would make behavior consistent across all Snakemake arguments unlike the special-casing approach above where --stats, for example, would behave differently from --configfile.
  • Create a troubleshooting page in our documentation with this specific example. We could at least reference this page from our own docs/office hours and users could find it via web search of the error message.
  • Encourage users to use forward slashes (/) on any supported operating system, since Windows accepts both types.

Your environment: if browsing Nextstrain online

  • Operating system: Windows

Your environment: if running Nextstrain locally

  • Operating system: Windows

Additional context

Thanks to Bryan Tegomoh for reporting this issue.

@huddlej huddlej added the bug Something isn't working label Jan 17, 2023
@tsibley tsibley added windows Windows support papercut Something that works but could be better labels Jan 18, 2023
@victorlin victorlin moved this from New to Backlog in Nextstrain planning (archived) Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working papercut Something that works but could be better windows Windows support
Projects
No open projects
Status: Backlog
Development

No branches or pull requests

2 participants