Jira (BOLT-1075) command : commands fail if in a remote session to Windows

2 views
Skip to first unread message

William Hurt (JIRA)

unread,
Jan 8, 2019, 4:09:04 PM1/8/19
to puppe...@googlegroups.com
William Hurt created an issue
 
Puppet Task Runner / Bug BOLT-1075
command : commands fail if in a remote session to Windows
Issue Type: Bug Bug
Assignee: Unassigned
Attachments: bolt_BadFileDescriptor_error.PNG
Components: bolt, Windows
Created: 2019/01/08 1:08 PM
Labels: windows bolt
Priority: Normal Normal
Reporter: William Hurt

Bolt Version 1.8.1

If you are remoted into a Windows machine and attempt to run a command, the command may fail with an `Bad file descriptor` error.

This was discovered during the Getting Started with Puppet training class.

Desired Behavior: The command should execute normally.

Actual Behavior: A bad file descriptor error is encountered.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

William Hurt (JIRA)

unread,
Jan 8, 2019, 4:09:04 PM1/8/19
to puppe...@googlegroups.com
William Hurt updated an issue
Change By: William Hurt
Attachment: bolt_BadFileDescriptor_error.PNG

Michael Smith (JIRA)

unread,
Jan 9, 2019, 12:51:03 PM1/9/19
to puppe...@googlegroups.com
Michael Smith commented on Bug BOLT-1075
 
Re: command : commands fail if in a remote session to Windows

The error is specifically if you use --password without including the password after, triggering Bolt to prompt you for it. This is identical to BOLT-627.

Michael Smith (JIRA)

unread,
Jan 9, 2019, 12:53:03 PM1/9/19
to puppe...@googlegroups.com

It looks like you were using Enter-PSSession to connect to another machine, then running Bolt there?

William Hurt (JIRA)

unread,
Jan 9, 2019, 12:56:04 PM1/9/19
to puppe...@googlegroups.com
William Hurt commented on Bug BOLT-1075

Ok, I see the work around. If I provide the password in the commandline call then it works. The issue seems to be that if you are in a remote session to the computer, the prompt to enter a password doesn't work if you leave the password blank. If you are in a local session the prompt to enter the password works as expected.

Michael Smith (JIRA)

unread,
Jan 9, 2019, 12:57:03 PM1/9/19
to puppe...@googlegroups.com

A similar report at https://github.com/TerribleDev/zanzibar/issues/19 suggests this is an issue with Ruby when Cygwin or MinGW is involved.

William Hurt (JIRA)

unread,
Jan 9, 2019, 12:59:04 PM1/9/19
to puppe...@googlegroups.com
William Hurt commented on Bug BOLT-1075

It's not clear to me how either of those would be getting dragged into this, but maybe just because I don't know enough about how bolt is working under the hood here.

Michael Smith (JIRA)

unread,
Jan 9, 2019, 1:05:09 PM1/9/19
to puppe...@googlegroups.com

Maybe this is yet another case where Ruby falls over. If you're not using Cygwin or MinGW, I don't see a reason they'd be involved; Bolt doesn't include either.

William Hurt (JIRA)

unread,
Jan 9, 2019, 1:08:03 PM1/9/19
to puppe...@googlegroups.com
William Hurt commented on Bug BOLT-1075

You could make an argument that the workaround is the use bolts native ability to run these command remotely and not try to remote into a machine and run it 'locally' I guess. I do wonder if this will just magically work properly though if someone tried this in a domain environment where you don't need --no-ssl and --password and --user, which is how 99% of Windows users would do this anyway.

Michael Smith (JIRA)

unread,
Jan 9, 2019, 1:10:05 PM1/9/19
to puppe...@googlegroups.com

Repro steps:

  1. Install Bolt
  2. Open Powershell
  3. Run 'Enter-PSSession localhost'
  4. Run 'bolt command run hostname -n localhost -p'

Michael Smith (JIRA)

unread,
Jan 9, 2019, 1:18:04 PM1/9/19
to puppe...@googlegroups.com

You can use an inventory file or bolt.yaml to provide the password. We don't have password-less login on Windows yet.

Michael Smith (JIRA)

unread,
Jan 9, 2019, 1:27:05 PM1/9/19
to puppe...@googlegroups.com

I searched a bit longer for better workarounds, but https://stackoverflow.com/a/21466434/2048059 suggests there aren't any.

William Hurt (JIRA)

unread,
Jan 9, 2019, 1:29:03 PM1/9/19
to puppe...@googlegroups.com
William Hurt commented on Bug BOLT-1075

That seems fair. I'll be happy when the improvements to Windows console infrastructure start landing, but I'm fine with that conclusion for now.

Michael Smith (JIRA)

unread,
Jan 9, 2019, 1:29:03 PM1/9/19
to puppe...@googlegroups.com

Also yes, I'd suggest running Bolt locally and using its ability to connect via winrm, or using -n local:// to run truly run the command locally if you've already connected via a remote powershell session.

Michael Smith (JIRA)

unread,
Jan 9, 2019, 1:31:04 PM1/9/19
to puppe...@googlegroups.com
Michael Smith updated an issue
 
Change By: Michael Smith
Release Notes Summary: Interactive tools fail when run in a remote PowerShell session. As such, using `--password` to prompt for a password when running Bolt will trigger an error noting EBADF. Work-arounds include putting the password in bolt.yaml or an inventory file, passing the password on the command-line, or not running Bolt over a remote PowerShell session.
Release Notes: Known Issue

Michael Smith (JIRA)

unread,
Jan 9, 2019, 1:33:04 PM1/9/19
to puppe...@googlegroups.com
 
Re: command : commands fail if in a remote session to Windows

Melissa Amos let's add this as a known issue.

The restriction seems to be in how PowerShell remoting is implemented, so this is something Microsoft would have to change to fix.

Alex Dreyer (JIRA)

unread,
Jan 9, 2019, 1:43:03 PM1/9/19
to puppe...@googlegroups.com
Alex Dreyer commented on Bug BOLT-1075

Michael Smith is there a way we can detect this and refuse to accept input interactively? Would we want to do that anyway?

Michael Smith (JIRA)

unread,
Jan 9, 2019, 2:13:04 PM1/9/19
to puppe...@googlegroups.com

We could catch the error and provide a better error message. Might also be a method we can call on STDIN to determine whether it's usable.

Melissa Amos (JIRA)

unread,
Jan 9, 2019, 4:17:03 PM1/9/19
to puppe...@googlegroups.com
Melissa Amos updated an issue
 
Change By: Melissa Amos
Labels: bolt known-issue-added windows

Yasmin Rajabi (JIRA)

unread,
Aug 29, 2019, 5:38:07 PM8/29/19
to puppe...@googlegroups.com
Yasmin Rajabi updated an issue
Change By: Yasmin Rajabi
Labels: bolt closed-github-move eyu ghm known-issue-added windows
Reply all
Reply to author
Forward
0 new messages