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
{{ message }}
Repository navigation
Unhelpful error: "cannot find column" when only some of the entries are missing the column #17448
I have done a basic search of the issue tracker to find any existing issues that are similar.
I have checked that my version is at least the latest stable release available via my installation method.
Describe the bug
sort shows a "cannot find column" error but when I run the command without piping it into sort I can see a name column in the result.
How to reproduce
I have encountered the issue while trying to format a cargo test output using the command bellow. Once I add a where type == "test" eliminating suites the command passes with no issues.
To reproduce, run the command on any codebase with at least one integration test (I could provide a link to the specific repo I run it on but it's probably unnecesarry)
cargo +nightly test -- --format json -Z unstable-options
| lines
| each { from json }
| sort-by name
Expected behavior
A more explicit error message: column not present for some entries
Configuration
key
value
version
0.109.1
major
0
minor
109
patch
1
branch
commit_hash
build_os
linux-x86_64
build_target
x86_64-unknown-linux-gnu
rust_version
rustc 1.92.0 (ded5c06cf 2025-12-08) (built from a source tarball)
One thing I only now noticed is that even though I'm on the latest version available through nix pkgs unstable (which I assumed would be at least the last stable release), it's only 0.109.1 not 0.110.0, my bad.
I tried to reproduce it on a podman image "ghcr.io/nushell/nushell:latest" ( v0.110.0 ) and it's still occuring
Yeah, then it works just fine. The 'name' field is present even after the sort.
Though that doesn't really solve the issue if that's what you're getting at. It still stands that the behaviour without the '?' is not quite what you would expect. Not a major issue though
One thing I probably should've checked for earlier, this is not something that affects just sort as it turns out, it seems to be an issue for possibly all commands operating on table columns (I've checked just a few I know of: get, where, group-by, rename )
changed the title [-]Unhelpful error: `sort` errors with "cannot find column" even when the column exists[/-][+]Unhelpful error: "cannot find column" when only some of the entries are missing the column[/+]on Jan 29, 2026
What it means is that there are holes in the data which is why name? works, it ignores the holes in the data. So, even though you're confident all the data is there, nushell is telling you something is missing.
I get this error just trying to save the file, so each line must not be json.
Error:nu::shell::cant_convert×Can't convert to string. ╭─[entry #2:3:10] 2 │ | lines 3 │ | each { from json } · ────┬──── · ╰── can'tconvertrecord<type:string, event:string, test_count:int>tostring4│|savefile.txt
Also, you should be able to do from json --objects instead of using each.
There's also irregular columns, which is probably the problem.
The irregularity is that there are at least two different sets of columns.
Yeah, once I tried looking into it more I did find that not all fields are present in every entry, in particular, the only fields shared by both test and suite is "type" and "event". Though I have no clue how you're unable to parse from json.
My point is, the error message is quite unintuitive, especially so when nushell displays the column even if not present for all entries with a '❎' symbol. I get why it works the way it works now, but I think the error message could be a bit more clear. As someone that doesn't know nushell that well I'm just trying to convey this is not as obvious as it might seem to someone that is familiar with the inner workings of nushell.
#18108 fixed this for sort-by, get, where, group-by and select: on 0.117 they say the column "is missing in one or more values" and suggest name? or default. rename -c {name: n} still gives "The column 'name' does not exist in the input", the same text as when no row has it.
Activity
forder0000 commentedon Jan 28, 2026
One thing I only now noticed is that even though I'm on the latest version available through nix pkgs unstable (which I assumed would be at least the last stable release), it's only 0.109.1 not 0.110.0, my bad.
I tried to reproduce it on a podman image "ghcr.io/nushell/nushell:latest" ( v0.110.0 ) and it's still occuring
fdncred commentedon Jan 28, 2026
What if you do this? note the end question mark which makes it optional
forder0000 commentedon Jan 29, 2026
Yeah, then it works just fine. The 'name' field is present even after the sort.
Though that doesn't really solve the issue if that's what you're getting at. It still stands that the behaviour without the '?' is not quite what you would expect. Not a major issue though
forder0000 commentedon Jan 29, 2026
One thing I probably should've checked for earlier, this is not something that affects just sort as it turns out, it seems to be an issue for possibly all commands operating on table columns (I've checked just a few I know of:
get,where,group-by,rename)[-]Unhelpful error: `sort` errors with "cannot find column" even when the column exists[/-][+]Unhelpful error: "cannot find column" when only some of the entries are missing the column[/+]fdncred commentedon Jan 29, 2026
What it means is that there are holes in the data which is why
name?works, it ignores the holes in the data. So, even though you're confident all the data is there, nushell is telling you something is missing.I get this error just trying to save the file, so each line must not be json.
Also, you should be able to do
from json --objectsinstead of usingeach.There's also irregular columns, which is probably the problem.
The irregularity is that there are at least two different sets of columns.
{ "type": "suite", "event": "started", "test_count": 7 } { "type": "test", "event": "started", "name": "command_context::tests::arguments_end_period" }There's probably an easier way to do it but once the data is purified, it works. This is what I did after saving the initial results to file.txt.
forder0000 commentedon Jan 30, 2026
Yeah, once I tried looking into it more I did find that not all fields are present in every entry, in particular, the only fields shared by both test and suite is "type" and "event". Though I have no clue how you're unable to parse from json.
My point is, the error message is quite unintuitive, especially so when nushell displays the column even if not present for all entries with a '❎' symbol. I get why it works the way it works now, but I think the error message could be a bit more clear. As someone that doesn't know nushell that well I'm just trying to convey this is not as obvious as it might seem to someone that is familiar with the inner workings of nushell.
(nushell#17448) Update label and help text on CantFindCol error
(#17448) Update label and help text on CantFindCol error (#18108)
kronberger-droid commentedon Nov 16, 2026
#18108 fixed this for
sort-by,get,where,group-byandselect: on 0.117 they say the column "is missing in one or more values" and suggestname?ordefault.rename -c {name: n}still gives "The column 'name' does not exist in the input", the same text as when no row has it.manavkdubey commentedon Nov 19, 2026
I opened #19609 to clarify the remaining rename --column diagnostic so it identifies the input record that’s missing the requested column.
fix(rename): clarify missing column errors (#19609)