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

Ohai simultaneously detects EC2 and Azure clouds #1743

Open
thheinen opened this issue Mar 29, 2022 · 0 comments
Open

Ohai simultaneously detects EC2 and Azure clouds #1743

thheinen opened this issue Mar 29, 2022 · 0 comments
Labels
Type: Bug Does not work as expected.

Comments

@thheinen
Copy link
Contributor

Description

No, this is not a new hybrid cloud strategy ;-)

On customer Windows machines which include the Microsoft Monitoring Agent, the cloud.rb Ohai plugin crashes and thus does not provide data. Reason is, that the azure.rb plugin checks for an existing C:\WindowsAzure directory instead of directly going to metadata. The Microsoft Monitoring Agent, which is independent of Azure, seems to sometimes place install logs there.

As subsequently the cloud.rb plugin tries to access metadata attributes with metadata being nil and crashes silently, the cloud Mash never gets populated.

Ohai Version

Ohai 17.3.1

Platform Version

Windows Server 2016

Ohai Output

C:\Windows\system32>ohai
[2022-03-29T11:43:55+00:00] WARN: Mixin AzureMetadata: Received response code 404 requesting metadata
C:\Windows\system32>ohai cloud
C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/ohai-17.3.1/lib/ohai/plugins/hostname.rb:194: warning: Socket.gethostbyname is deprecated; use Addrinfo.getaddrinfo instead.
[2022-03-29T11:44:29+00:00] WARN: Mixin AzureMetadata: Received response code 404 requesting metadata
C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/ohai-17.3.1/lib/ohai/system.rb:185:in `attributes_print': I cannot find an attribute named cloud! (ArgumentError)
        from C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/ohai-17.3.1/lib/ohai/application.rb:151:in `block in run_application'
        from C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/ohai-17.3.1/lib/ohai/application.rb:150:in `each'
        from C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/ohai-17.3.1/lib/ohai/application.rb:150:in `run_application'
        from C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/ohai-17.3.1/lib/ohai/application.rb:92:in `block in run'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/benchmark.rb:308:in `realtime'
        from C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/ohai-17.3.1/lib/ohai/application.rb:90:in `run'
        from C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/ohai-17.3.1/bin/ohai:25:in `<top (required)>'
        from C:/opscode/chef/bin/ohai:167:in `load'
        from C:/opscode/chef/bin/ohai:167:in `<main>'
C:\Windows\system32>ohai azure
[2022-03-29T11:44:34+00:00] WARN: Mixin AzureMetadata: Received response code 404 requesting metadata
{
  "metadata": null
}
@thheinen thheinen added Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected. labels Mar 29, 2022
@PrajaktaPurohit PrajaktaPurohit removed the Status: Untriaged An issue that has yet to be triaged. label Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

2 participants