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

working directory is invalid on windows #19

Closed
devsherm opened this issue Jun 7, 2024 · 6 comments · Fixed by #26
Closed

working directory is invalid on windows #19

devsherm opened this issue Jun 7, 2024 · 6 comments · Fixed by #26

Comments

@devsherm
Copy link

devsherm commented Jun 7, 2024

Working on Windows 11

$ wsl -v
WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.3672

Same result in git-bash and Powershell

$ ruby -v
ruby 3.3.2 (2024-05-30 revision e5a195edf6) [x64-mingw-ucrt]

$ rails -v
Rails 7.2.0.beta2

$ docker -v
Docker version 26.1.1, build 4cf5afa

$ rails-new -V
rails-new 0.3.0

$ rails-new rails_new720_b2 --database=postgresql -a propshaft --devcontainer
docker: Error response from daemon: the working directory 'C:\Users<user>\Documents<dir>' is invalid, it needs to be an absolute path.

@bobac
Copy link

bobac commented Aug 9, 2024

Same on my new machine, no ruby nor rails installed, just rails-new 0.3.0, wsl is on 2.2.4.0, docker -v gets Docker version 27.0.3, build 7d4bcd8, installed in wsl2 mode.
Panics on thread 'main' panicked at src\main.rs:58:5:
assertion failed: status.success()

Full backtrace looks like this:

C:\Users\RobertHouser\code>rails-new poc-devcontainers-72beta
...
building container layers omitted
...
docker: Error response from daemon: the working directory 'C:\Users\RobertHouser\code' is invalid, it needs to be an absolute path.
See 'docker run --help'.
thread 'main' panicked at src\main.rs:58:5:
assertion failed: status.success()
stack backtrace:
   0:     0x7ff6dda7a34a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h419f3866c85fe1bf
   1:     0x7ff6ddac954d - core::fmt::write::h81c90b6a84eba5be
   2:     0x7ff6dda7077d - std::io::Write::write_fmt::h216459b0e40bea5d
   3:     0x7ff6dda7a173 - std::sys_common::backtrace::print::hea1734d8b31113d5
   4:     0x7ff6dda7cea9 - std::panicking::default_hook::{{closure}}::ha8fd0cbe9cc21e6f
   5:     0x7ff6dda7cba8 - std::panicking::default_hook::hd35fa15eba4e74a2
   6:     0x7ff6dda7d588 - std::panicking::rust_panic_with_hook::hca0c0de800db3c83
   7:     0x7ff6dda7d421 - std::panicking::begin_panic_handler::{{closure}}::he773c37bd73058bd
   8:     0x7ff6dda7aae9 - std::sys_common::backtrace::__rust_end_short_backtrace::hff55a16a8c27989e
   9:     0x7ff6dda7d1a6 - rust_begin_unwind
  10:     0x7ff6ddac5b57 - core::panicking::panic_fmt::h678ed93bf965ebf9
  11:     0x7ff6ddac5c12 - core::panicking::panic::h7b26555fedc35695
  12:     0x7ff6dd9cfb1a - rails_new::main::h57fd6a6f5e8e529e
  13:     0x7ff6dd9ccba6 - std::sys_common::backtrace::__rust_begin_short_backtrace::hf8a0653b0d6c6323
  14:     0x7ff6dd9ce95c - std::rt::lang_start::{{closure}}::hcb8345bb746ca3ec
  15:     0x7ff6dda63584 - std::rt::lang_start_internal::h6db8f07dce4a1c6a
  16:     0x7ff6dd9cfc8d - main
  17:     0x7ff6dd9c12ef - __tmainCRTStartup
  18:     0x7ff6dd9c1406 - mainCRTStartup
  19:     0x7ffe3c15257d - <unknown>
  20:     0x7ffe3d5caf28 - <unknown>

@bobac
Copy link

bobac commented Aug 9, 2024

I've probably found the source of the issue, but I am unable to propose a fix as I am not proficient in Rust. I'd bet that the working directories set for the docker image run command in the pub fn run_image() sets (via calling the set_workdir() the commandline like this example:

C:\Users\RobertHouser\code>docker run -w C:\Users\RobertHouser\code hello-world
docker: Error response from daemon: the working directory 'C:\Users\RobertHouser\code' is invalid, it needs to be an absolute path.
See 'docker run --help'.

With the error clearly replicated. If the command would encode the path for the direcory as //C/Users/RobertHouser/code, it would run OK. See following example:

C:\Users\RobertHouser\code>docker run -w //C/Users/RobertHouser/code hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.
...
rest omitted
...

Sorry, i am unable to make PR as I do not use Rust.

@rafaelfranca
Copy link
Member

Could you try the new version 0.4.1?

@shoehle
Copy link

shoehle commented Aug 15, 2024

Tried it out with 0.4.1

Following error now appears (with RUST_BACKTRACE=full):

docker: invalid spec: \\?\C:\Temp\rails-new:\\?\C:\Temp\rails-new: too many colons.
See 'docker run --help'.
thread 'main' panicked at src/main.rs:58:5:
assertion failed: status.success()
stack backtrace:
   0:     0x7ff68342a81a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd2c0c69e7e34bde6
   1:     0x7ff683477589 - core::fmt::write::he86909a848b2a697
   2:     0x7ff683420e4f - std::io::Write::write_fmt::ha2beef964fc4e8a7
   3:     0x7ff68342a609 - std::sys_common::backtrace::print::h0b58485f096f252a
   4:     0x7ff68342d148 - std::panicking::default_hook::{{closure}}::hf290e3297ac8ff3d
   5:     0x7ff68342ce39 - std::panicking::default_hook::h958969ab2f2b8930
   6:     0x7ff68342d85c - std::panicking::rust_panic_with_hook::heec410d1d0aa0be8
   7:     0x7ff68342d6e2 - std::panicking::begin_panic_handler::{{closure}}::h80a1a7d407c1e23d
   8:     0x7ff68342b01f - std::sys_common::backtrace::__rust_end_short_backtrace::h2110fad0f61966f2
   9:     0x7ff68342d448 - rust_begin_unwind
  10:     0x7ff683473b24 - core::panicking::panic_fmt::h9e181c62584cc428
  11:     0x7ff683473bcd - core::panicking::panic::h8ea5606244902eff
  12:     0x7ff68337955a - rails_new::main::hcf4dcf6d43ad4e1b
  13:     0x7ff6833780d6 - std::sys_common::backtrace::__rust_begin_short_backtrace::hed9485bf3c671d2f
  14:     0x7ff68337555c - std::rt::lang_start::{{closure}}::hb463d58c655aefeb
  15:     0x7ff6834138ef - std::rt::lang_start_internal::hda05f36ec57a61d4
  16:     0x7ff6833796cd - main
  17:     0x7ff6833712ef - __tmainCRTStartup
  18:     0x7ff683371406 - mainCRTStartup
  19:     0x7ffa6580257d - <unknown>
  20:     0x7ffa66a8af28 - <unknown>

@bobac
Copy link

bobac commented Aug 15, 2024

Hi,
similar here, definitelly went longer distance but ends up with:

docker: Error response from daemon: mount denied:
the source path "\\\\?\\C:\\Users\\RobertHouser\\code:\\\\?\\C:\\Users\\RobertHouser\\code"
too many colons.
See 'docker run --help'.
thread 'main' panicked at src/main.rs:58:5:
assertion failed: status.success()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@rattling
Copy link

Yup, same error with me using 0.4.1. ..too many colons. As above, it is trying to run the docker command with the windows style path. I guess it needs to convert the string alright into linux stylee.

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 a pull request may close this issue.

5 participants