2

Wondering if anyone has any thoughts about this. When I try to redirect stdout in my WSL terminal I get an error about having an open pipe. But I can run the same command from Git Bash without any problems. Does anyone have any thoughts on how I might get around this?

I am not a Linux power user by any stretch. I saw that this was an issue marked as closed on the WSL Github https://github.com/microsoft/WSL/issues/2370

Not sure if the fault lies with WSL or the user. Redirect works if I am not using SF commands. echo hello > hello.txt works just fine.

brooksdjohnson@DESKTOP-L4C7EFO:~$ sfdx force:data:soql:query -q 'SELECT FirstName, LastName FROM COntact Limit 20' -u uber > test.csv
net.js:268
    err = this._handle.open(fd);
                       ^

Error: EINVAL: invalid argument, uv_pipe_open
    at new Socket (net.js:268:24)
    at createWritableStdioStream (internal/process/stdio.js:191:18)
    at process.getStderr [as stderr] (internal/process/stdio.js:32:14)
    at console.js:455:19
    at NativeModule.compile (internal/bootstrap/loaders.js:364:7)
    at Function.NativeModule.require (internal/bootstrap/loaders.js:176:18)
    at setupGlobalConsole (internal/bootstrap/node.js:407:41)
    at startup (internal/bootstrap/node.js:142:7)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
  • 1
    The official line on using the CLI in WSL is that The Salesforce CLI works best within the native Windows command prompt (cmd.exe) and the Microsoft Powershell. We do not recommend using the Salesforce CLI with a Linux terminal emulator, such as Windows 10 Subsystem for Linux, cygwin, or MinGW, because support for bugs is limited.. Do you have the CLI installed through WSL (ie, using the Linux commands from the install page)? – Thomas Taylor Aug 5 at 13:15
  • Hmmm, no I never installed it that way. My Ubuntu terminal always picked it up so I never worried about it. – Brooks Johnson Aug 5 at 13:37
  • 1
    I'm not saying that that would fix it, but it might. I've not tried the SF CLI in WSL, ever, and haven't used WSL at all of late. Last time I actively used it was before it would run Win executables, & so I had to install the Linux tools to run them. Not sure how it resolves conflicts when the same command is on your Linux path and your Win path. – Thomas Taylor Aug 5 at 13:42
  • I installed it on my WSL but it is not finding any of my dev hubs or scratch org. And force:auth:web:loging is timing out. – Brooks Johnson Aug 5 at 13:50
  • 1
    Right, so the WSL-installed version isn't pointed to all the same config folders (it's basically like having an installation on a different computer) -- that might be fixable, but I'm not certain how. The Win-installed version doesn't act right with some WSL functions like stdout redirection. Hence SF's recommendation against. – Thomas Taylor Aug 5 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.