You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PowerShell PS command returns a lot more process information, but the shell just hangs. There's no process activity for nu.exe or Windows Command Processor. The shell is unresponsive.
Just the external command, powershell -c "ps | convertto-json" works as expected and spits out json to the screen.
I've seen this with some invocations of the Azure az command and keyvault combinations. I wonder if there's a timeout we could introduce and/or tune so that at least something comes back to the user with a warning that the operation couldn't be finished successfully
I have found (on Linux) that when JSON parsing fails, due to malformed JSON, piping to from-json hangs indefinitely. The error is :
> kubectl logs mysvc | from-json --objects <<hang>>
^C
thread 'main' panicked at 'index out of bounds: the len is 2 but the index is 2', /rustc/9eae1fc0ea9b00341b8fe191582c4decb5cb86a3/src/libcore/slice/mod.rs:2715:10
stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.35/src/backtrace/libunwind.rs:88
1: backtrace::backtrace::trace_unsynchronized
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.35/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:47
3: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:36
4: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:200
5: std::panicking::default_hook
at src/libstd/panicking.rs:214
6: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:477
7: std::panicking::continue_panic_fmt
at src/libstd/panicking.rs:384
8: rust_begin_unwind
at src/libstd/panicking.rs:311
9: core::panicking::panic_fmt
at src/libcore/panicking.rs:85
10: core::panicking::panic_bounds_check
at src/libcore/panicking.rs:61
11: nu::format::table::TableView::from_list
12: <futures_async_stream::stream::GenStream<G,T> as futures_core::stream::Stream>::poll_next
13: <futures_util::stream::collect::Collect<St,C> as core::future::future::Future>::poll
14: <futures_async_stream::stream::GenStream<G,T> as futures_core::stream::Stream>::poll_next
15: std::future::poll_with_tls_context
16: nu::cli::cli::{{closure}}
17: std::thread::local::LocalKey<T>::with
18: nu::main
19: std::rt::lang_start::{{closure}}
20: std::rt::lang_start_internal::{{closure}}
at src/libstd/rt.rs:49
21: std::panicking::try::do_call
at src/libstd/panicking.rs:296
22: __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:80
23: std::panicking::try
at src/libstd/panicking.rs:275
24: std::panic::catch_unwind
at src/libstd/panic.rs:394
25: std::rt::lang_start_internal
at src/libstd/rt.rs:48
26: main
27: __libc_start_main
28: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
I have found (on Linux) that when JSON parsing fails, due to malformed JSON, piping to from-json hangs indefinitely. The error is :
> kubectl logs mysvc | from-json --objects <<hang>>
^C
thread 'main' panicked at 'index out of bounds: the len is 2 but the index is 2', /rustc/9eae1fc0ea9b00341b8fe191582c4decb5cb86a3/src/libcore/slice/mod.rs:2715:10
stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.35/src/backtrace/libunwind.rs:88
1: backtrace::backtrace::trace_unsynchronized
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.35/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:47
3: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:36
4: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:200
5: std::panicking::default_hook
at src/libstd/panicking.rs:214
6: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:477
7: std::panicking::continue_panic_fmt
at src/libstd/panicking.rs:384
8: rust_begin_unwind
at src/libstd/panicking.rs:311
9: core::panicking::panic_fmt
at src/libcore/panicking.rs:85
10: core::panicking::panic_bounds_check
at src/libcore/panicking.rs:61
11: nu::format::table::TableView::from_list
12: <futures_async_stream::stream::GenStream<G,T> as futures_core::stream::Stream>::poll_next
13: <futures_util::stream::collect::Collect<St,C> as core::future::future::Future>::poll
14: <futures_async_stream::stream::GenStream<G,T> as futures_core::stream::Stream>::poll_next
15: std::future::poll_with_tls_context
16: nu::cli::cli::{{closure}}
17: std::thread::local::LocalKey<T>::with
18: nu::main
19: std::rt::lang_start::{{closure}}
20: std::rt::lang_start_internal::{{closure}}
at src/libstd/rt.rs:49
21: std::panicking::try::do_call
at src/libstd/panicking.rs:296
22: __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:80
23: std::panicking::try
at src/libstd/panicking.rs:275
24: std::panic::catch_unwind
at src/libstd/panic.rs:394
25: std::rt::lang_start_internal
at src/libstd/rt.rs:48
26: main
27: __libc_start_main
28: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Thanks!
Can you try kubectl logs mysvc | from-json --objects | debug and paste the output? It looks like it does the parsing correctly but it's failing when displaying the table (the pipeline ends implicitly with autoview)
Alternatively, please try kubectl logs mysvc | from-json --objects | save my_data.json and inspect the file to check if it's correct or if it's saving correctly?
kubectl logs mysvc | from-json --objects | save foo.json
It hangs, but it doesn't error.. I still hit ctrl-c... but there is no panic or backtrace, and foo.json is populated with what appears to be the expected data, including strings containing the invalid json
opening results in the panic with the same error as above.
> open foo.json
thread 'main' panicked at 'index out of bounds: the len is 2 but the index is 2', /rustc/9eae1fc0ea9b00341b8fe191582c4decb5cb86a3/src/libcore/slice/mod.rs:2715:10
stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.35/src/backtrace/libunwind.rs:88
1: backtrace::backtrace::trace_unsynchronized
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.35/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:47
3: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:36
4: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:200
5: std::panicking::default_hook
at src/libstd/panicking.rs:214
6: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:477
7: std::panicking::continue_panic_fmt
at src/libstd/panicking.rs:384
8: rust_begin_unwind
at src/libstd/panicking.rs:311
9: core::panicking::panic_fmt
at src/libcore/panicking.rs:85
10: core::panicking::panic_bounds_check
at src/libcore/panicking.rs:61
11: nu::format::table::TableView::from_list
12: <futures_async_stream::stream::GenStream<G,T> as futures_core::stream::Stream>::poll_next
13: <futures_util::stream::collect::Collect<St,C> as core::future::future::Future>::poll
14: <futures_async_stream::stream::GenStream<G,T> as futures_core::stream::Stream>::poll_next
15: std::future::poll_with_tls_context
16: nu::cli::cli::{{closure}}
17: std::thread::local::LocalKey<T>::with
18: nu::main
19: std::rt::lang_start::{{closure}}
20: std::rt::lang_start_internal::{{closure}}
at src/libstd/rt.rs:49
21: std::panicking::try::do_call
at src/libstd/panicking.rs:296
22: __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:80
23: std::panicking::try
at src/libstd/panicking.rs:275
24: std::panic::catch_unwind
at src/libstd/panic.rs:394
25: std::rt::lang_start_internal
at src/libstd/rt.rs:48
26: main
27: __libc_start_main
28: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@cdhunt - I just landed a fix that should help with the hangs you were seeing. I've tested it on Linux, and I'm hoping the same fix helps Windows also.
If you can, would you be able to checkout the latest Nu from master, build it, and try your example again?
FWIW, I experienced the same problem on Windows, and the fix did help: the command from the first comment no longer hands (though the powershell command itself takes a while to finish).
@jonathandturner No. I was originally using the 0.2.0 release on my workstation. I just don't want to pollute my workstation with the Rust toolchain to run a single build and from what I've read several people have a problem getting link.exe without containers being involved. However, that's all really a Rust issue and not Nu. Sounds like @nickolay verified it so I think you can close this out.
Activity
wycats commentedon Aug 28, 2019
Thanks for the report. This seems bad indeed.
sophiajt commentedon Aug 28, 2019
I've seen this with some invocations of the Azure
azcommand and keyvault combinations. I wonder if there's a timeout we could introduce and/or tune so that at least something comes back to the user with a warning that the operation couldn't be finished successfullycdhunt commentedon Aug 29, 2019
I've encountered this again while using
from-json.docker images --format "{{json .}}" | from-jsoncdhunt commentedon Aug 29, 2019
I tried
docker images | split-column " "and it hung until I hit^C. Then rendered as expected.sophiajt commentedon Aug 29, 2019
@cdhunt - out of curiosity, are the
dockerhangs on Windows too?cdhunt commentedon Aug 29, 2019
Yes. All on Windows 10.
andrasio commentedon Aug 30, 2019
@cdhunt can you try
docker images --format "{{json .}}" | from-json --objects?andrasio commentedon Aug 30, 2019
Possibly related to #489 (both on Windows)
cdhunt commentedon Aug 30, 2019
I get
error: Unimplemented: passing flags is not supported yet.rrichardson commentedon Sep 10, 2019
I have found (on Linux) that when JSON parsing fails, due to malformed JSON, piping to
from-jsonhangs indefinitely. The error is :andrasio commentedon Sep 10, 2019
--objectswas introduced after the release you are using. Try building from master and it should work.andrasio commentedon Sep 10, 2019
Thanks!
Can you try
kubectl logs mysvc | from-json --objects | debugand paste the output? It looks like it does the parsing correctly but it's failing when displaying the table (the pipeline ends implicitly withautoview)Alternatively, please try
kubectl logs mysvc | from-json --objects | save my_data.jsonand inspect the file to check if it's correct or if it's saving correctly?rrichardson commentedon Sep 10, 2019
rrichardson commentedon Sep 10, 2019
interestingly...
It hangs, but it doesn't error.. I still hit ctrl-c... but there is no panic or backtrace, and foo.json is populated with what appears to be the expected data, including strings containing the invalid json
andrasio commentedon Sep 10, 2019
@rrichardson How about now if you do
open foo.json?rrichardson commentedon Sep 11, 2019
opening results in the panic with the same error as above.
andrasio commentedon Sep 11, 2019
@rrichardson Thanks. The problem could be in the parsing of json in that case (and potentially the culprit of the hanging issue)
sophiajt commentedon Sep 13, 2019
@cdhunt - I just landed a fix that should help with the hangs you were seeing. I've tested it on Linux, and I'm hoping the same fix helps Windows also.
If you can, would you be able to checkout the latest Nu from master, build it, and try your example again?
cdhunt commentedon Sep 13, 2019
I'm working on a Rustlang Windows container to run the build.
cdhunt commentedon Sep 16, 2019
I give up. I can't find a way to get
vs-buildtoolsinstalled to providelink.exe.sophiajt commentedon Sep 17, 2019
@cdhunt thanks for trying. I've never built a Windows container.
We're you using a container for your original report?
nickolay commentedon Sep 17, 2019
FWIW, I experienced the same problem on Windows, and the fix did help: the command from the first comment no longer hands (though the powershell command itself takes a while to finish).
cdhunt commentedon Sep 17, 2019
@jonathandturner No. I was originally using the 0.2.0 release on my workstation. I just don't want to pollute my workstation with the Rust toolchain to run a single build and from what I've read several people have a problem getting
link.exewithout containers being involved. However, that's all really a Rust issue and not Nu. Sounds like @nickolay verified it so I think you can close this out.sophiajt commentedon Sep 17, 2019
Sounds good. (and thanks @nickolay for verifying)
We should be rolling out the next release in a couple weeks, which will include this fix.
Update zh_CN translation for nu books (nushell#514)