Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(tools): use of deprecated wmic module windows #16419

Closed
Calkines opened this issue Sep 8, 2021 · 4 comments · Fixed by #17070
Closed

(tools): use of deprecated wmic module windows #16419

Calkines opened this issue Sep 8, 2021 · 4 comments · Fixed by #17070
Labels
bug This issue is a bug. effort/small Small work item – less than a day of effort p1 package/tools Related to AWS CDK Tools or CLI

Comments

@Calkines
Copy link

Calkines commented Sep 8, 2021

Cdk Cli uses WMI (Windows Management Instrumentation) cmdlets (docs) that is deprecated since version 3 of Power Shell. Today the cmdlet used is CIM (Common Information Model).

With the WMI the command to init a CDK folder cannot be executed.

Command failed: wmic path win32_computersystemproduct get uuid
'wmic' is not recognized as an internal or external command,
operable program or batch file.

Reproduction Steps

Install cdk:

npm install -g aws-cdk

Try to initiate a cdk repo like this:

cdk init

What did you expect to happen?

I expected the cdk prepare the first config files in folder.

What actually happened?

The mentioned error above.

Environment

  • Windows 10 Version 21H1 (OS Build 19043.1165)
  • Node version v12.16.3
  • Powershell Desktop Edition 5.1.19041.1151
  • or Powershell Core Edition 7.0.3

Other

These links maybe useful:


This is 🐛 Bug Report

@Calkines Calkines added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 8, 2021
@JordanRickman
Copy link

I am getting a different but presumably related error on the same wmic module, also making it impossible to use cdk init.

> cdk init app --language typescript
Command failed: wmic path win32_computersystemproduct get uuid
ERROR:
Description = Not found

@JordanRickman
Copy link

I am getting a different but presumably related error on the same wmic module, also making it impossible to use cdk init.

> cdk init app --language typescript
Command failed: wmic path win32_computersystemproduct get uuid
ERROR:
Description = Not found

Correction: I cannot do anything with cdk, all commands fail with this error.

@peterwoodworth peterwoodworth removed the needs-triage This issue or PR still needs to be triaged. label Oct 12, 2021
@peterwoodworth peterwoodworth changed the title aws-cdk: use of deprecated wmic module windows (tools): aws-cdk: use of deprecated wmic module windows Oct 12, 2021
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Oct 12, 2021
@peterwoodworth peterwoodworth changed the title (tools): aws-cdk: use of deprecated wmic module windows (tools): use of deprecated wmic module windows Oct 12, 2021
@rix0rrr
Copy link
Contributor

rix0rrr commented Oct 20, 2021

Passing --no-ec2creds should help you out until the fix is released.

rix0rrr added a commit that referenced this issue Oct 20, 2021
Apparently Microsoft stopped shipping `wmic.exe` in certain situations
(modern systems?). We rely on this to detect whether we are on an EC2
instance, so that we do or do not configure the IMDS credential
provider (we try to avoid the IMDS credential provider if unnecessary,
because in certain network setups it may hang for a long time failing to
connect to `169.254.169.254`).

If calling `wmic` fails, just assume we're not on an EC2 instance
and proceed.

Fixes #16419.
@rix0rrr rix0rrr added the effort/small Small work item – less than a day of effort label Oct 20, 2021
@rix0rrr rix0rrr removed their assignment Oct 20, 2021
@mergify mergify bot closed this as completed in #17070 Nov 5, 2021
mergify bot pushed a commit that referenced this issue Nov 5, 2021
Apparently Microsoft stopped shipping `wmic.exe` in certain situations
(modern systems?). We rely on this to detect whether we are on an EC2
instance, so that we do or do not configure the IMDS credential
provider (we try to avoid the IMDS credential provider if unnecessary,
because in certain network setups it may hang for a long time failing to
connect to `169.254.169.254`).

If calling `wmic` fails, just assume we're not on an EC2 instance
and proceed.

Fixes #16419.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

github-actions bot commented Nov 5, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

iliapolo pushed a commit that referenced this issue Nov 7, 2021
Apparently Microsoft stopped shipping `wmic.exe` in certain situations
(modern systems?). We rely on this to detect whether we are on an EC2
instance, so that we do or do not configure the IMDS credential
provider (we try to avoid the IMDS credential provider if unnecessary,
because in certain network setups it may hang for a long time failing to
connect to `169.254.169.254`).

If calling `wmic` fails, just assume we're not on an EC2 instance
and proceed.

Fixes #16419.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this issue Feb 21, 2022
Apparently Microsoft stopped shipping `wmic.exe` in certain situations
(modern systems?). We rely on this to detect whether we are on an EC2
instance, so that we do or do not configure the IMDS credential
provider (we try to avoid the IMDS credential provider if unnecessary,
because in certain network setups it may hang for a long time failing to
connect to `169.254.169.254`).

If calling `wmic` fails, just assume we're not on an EC2 instance
and proceed.

Fixes aws#16419.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. effort/small Small work item – less than a day of effort p1 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants