puppetlabs / pdk

The shortest path to better modules: Puppet Development Kit; Download:
https://puppet.com/download-puppet-development-kit
Apache License 2.0
225 stars 105 forks source link

Unable to create new module using pdk new module in windows #953

Closed saturbo closed 2 years ago

saturbo commented 3 years ago

Describe the bug I was trying to create a new module after my first time installation but get stuck at step 4 with below output

[Q 4/4] What operating systems does this module support?
Use the up and down keys to move between the choices, space to select and enter to continue.
--> RedHat based Linux, Debian based Linux, Windows (Press a?‘/a?“ arrow or 1-8 number to move, Space/Ctrl+A|R to select (all|rev) and Enter to finish)
  (*) 1) RedHat based Linux
  (*) 2) Debian based Linux
  ( ) 3) Fedora
  ( ) 4) OSX
  ( ) 5) SLES
  ( ) 6) Solaris
> (*) 7) Windows
  ( ) 8) AIXC:/PUPPET~1/DEVELO~1/private/ruby/2.4.10/lib/ruby/2.4.0/forwardable.rb:229:in `write': Resource temporarily unavailable @ io_write - <STDOUT> (Errno::EAGAIN)
        from C:/PUPPET~1/DEVELO~1/private/ruby/2.4.10/lib/ruby/2.4.0/forwardable.rb:229:in `print'
        from C:/PUPPET~1/DEVELO~1/private/ruby/2.4.10/lib/ruby/2.4.0/forwardable.rb:229:in `print'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/tty-prompt-0.22.0/lib/tty/prompt/list.rb:422:in `render'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/tty-prompt-0.22.0/lib/tty/prompt/list.rb:241:in `block in call'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/tty-reader-0.8.0/lib/tty/reader.rb:107:in `subscribe'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/tty-prompt-0.22.0/lib/tty/prompt/list.rb:240:in `call'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/tty-prompt-0.22.0/lib/tty/prompt.rb:249:in `invoke_select'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/tty-prompt-0.22.0/lib/tty/prompt.rb:306:in `multi_select'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/tty-prompt-0.22.0/lib/tty/prompt/answers_collector.rb:73:in `public_send'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/tty-prompt-0.22.0/lib/tty/prompt/answers_collector.rb:73:in `method_missing'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/pdk-2.0.0/lib/pdk/cli/util/interview.rb:43:in `block in run'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/pdk-2.0.0/lib/pdk/cli/util/interview.rb:31:in `each'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/pdk-2.0.0/lib/pdk/cli/util/interview.rb:31:in `run'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/pdk-2.0.0/lib/pdk/generate/module.rb:305:in `module_interview'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/pdk-2.0.0/lib/pdk/generate/module.rb:149:in `prepare_metadata'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/pdk-2.0.0/lib/pdk/generate/module.rb:28:in `invoke'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/pdk-2.0.0/lib/pdk/cli/new/module.rb:50:in `block (2 levels) in <module:CLI>'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:329:in `run_this'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:269:in `run'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:287:in `run'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:287:in `run'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/pdk-2.0.0/lib/pdk/cli.rb:71:in `run'
        from C:/Puppet Labs/DevelopmentKit/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/pdk-2.0.0/exe/pdk:6:in `<top (required)>'
        from C:/PUPPET~1/DEVELO~1/private/ruby/2.4.10/bin/pdk:23:in `load'
        from C:/PUPPET~1/DEVELO~1/private/ruby/2.4.10/bin/pdk:23:in `<main>'

Anyone facing as same issue as well?

Additional context

jpogran commented 3 years ago

Thank you for the report @saturbo. What terminal are you using on Windows 10? The default powershell.exe, Windows Terminal, or another option like cmder?

saturbo commented 3 years ago

Thank you for the report @saturbo. What terminal are you using on Windows 10? The default powershell.exe, Windows Terminal, or another option like cmder?

Hi jpogran I use the powershell 5.1.Below info for your reference.

PS D:\Work\VS\ni_puppet> $PSVersionTable

Name Value


PSVersion 5.1.19041.610 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.19041.610 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

jpogran commented 3 years ago

Using PowerShell (by starting powershell.exe) on a newly created Windows 10 machine I was able to walk through the interview steps.

Are you sure you are not starting PDK from another terminal like git bash or Windows Terminal?

Did you install PDK from a package or through the ruby gem?

saturbo commented 3 years ago

Using PowerShell (by starting powershell.exe) on a newly created Windows 10 machine I was able to walk through the interview steps.

Are you sure you are not starting PDK from another terminal like git bash or Windows Terminal?

Did you install PDK from a package or through the ruby gem?

Yes, I run the powershell.exe to start the shell and run the pdk command but fail with the output I paste before. I install the package using the msi package.

saturbo commented 3 years ago

I re-install the PDK 2.0,0 and use choco to install the PDK once again , but still meet the same issue. I think it might not caused by the installation.

jpogran commented 3 years ago

I agree it looks like it's not caused by the installation. I'll try to summarize your steps for far, correct me if I'm wrong:

# opens powershell.exe
PS C:\Users\UserName>
PS C:\Users\UserName> cd D:\Work\VS\ni_puppet>
PS D:\Work\VS\ni_puppet> pdk new module <module_name>
# select inputs, errors at step 4

It's likely something to do with the interview template code, but I need some more information to try to repo:

  1. Is this on a localized version of Windows? For example here
  2. I noticed that the module was being created in the D:\ drive. Are there any special permissions on that drive that would prevent writes? Does this occur if you try to create it on the C:\ drive?
  3. Can you paste a screenshot or copy the full text from an example session here so I can see the end to end interaction?
github-actions[bot] commented 3 years ago

This issue has been marked stale because it is open with no recent activity. The PDK Team is actively prioritizing existing bugs and new features, if this issue is still important to you please comment and we will add this to our backlog to complete.

github-actions[bot] commented 2 years ago

This issue was closed because it is open with no recent activity. The PDK Team is actively prioritizing existing bugs and new features, if this issue is still important to you please comment and we will add this to our backlog to complete.