-
Notifications
You must be signed in to change notification settings - Fork 448
Description
Description
The content of
user-dataAPI should be stored properly, not to be continuously requested line by line.
On Alibaba Cloud, the user-data API (URL: http://100.100.100.200/2016-01-01/user-data ) responds the cloud-init config file in a multi-lined plain text way, and the first line is #cloud-config( or #!/bin/bash ) , which caused the URL will be requested later becomes http://100.100.100.200/2016-01-01/user-data/#cloud-config, the metadata API will respond the same content as before, so the recursion will never end.
Ohai Version
I'm using GitLab: GitLab (latest, 15.2.2) -> chef (17.10.0) -> ohai (17.9.0)
Platform Version
VMs on Alibaba Cloud, but I think those Clouds having the same user-data responding logic will have the same issue.
Ohai Output
I'm sorry I'll put the output of GitLab here.
WARN: Plugin Alibaba threw exception #<SystemStackError: stack level too deep> /opt/gitlab/embedded/lib/ruby/2.7.0/net/protocol.rb:277:in `block in write0'
/opt/gitlab/embedded/lib/ruby/2.7.0/net/protocol.rb:275:in `each'
/opt/gitlab/embedded/lib/ruby/2.7.0/net/protocol.rb:275:in `each_with_index'
/opt/gitlab/embedded/lib/ruby/2.7.0/net/protocol.rb:275:in `write0'
/opt/gitlab/embedded/lib/ruby/2.7.0/net/protocol.rb:248:in `block in write'
/opt/gitlab/embedded/lib/ruby/2.7.0/net/protocol.rb:265:in `writing'
/opt/gitlab/embedded/lib/ruby/2.7.0/net/protocol.rb:247:in `write'
/opt/gitlab/embedded/lib/ruby/2.7.0/net/http/generic_request.rb:335:in `write_header'
/opt/gitlab/embedded/lib/ruby/2.7.0/net/http/generic_request.rb:129:in `exec'
/opt/gitlab/embedded/lib/ruby/2.7.0/net/http.rb:1521:in `block in transport_request'
/opt/gitlab/embedded/lib/ruby/2.7.0/net/http.rb:1519:in `catch'
/opt/gitlab/embedded/lib/ruby/2.7.0/net/http.rb:1519:in `transport_request'
/opt/gitlab/embedded/lib/ruby/2.7.0/net/http.rb:1492:in `request'
/opt/gitlab/embedded/lib/ruby/2.7.0/net/http.rb:1241:in `get'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/mixin/alibaba_metadata.rb:38:in `http_get'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/mixin/alibaba_metadata.rb:42:in `fetch_metadata'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/mixin/alibaba_metadata.rb:52:in `block in fetch_metadata'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/mixin/alibaba_metadata.rb:51:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/mixin/alibaba_metadata.rb:51:in `fetch_metadata'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/mixin/alibaba_metadata.rb:52:in `block in fetch_metadata'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/mixin/alibaba_metadata.rb:51:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/mixin/alibaba_metadata.rb:51:in `fetch_metadata'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/mixin/alibaba_metadata.rb:52:in `block in fetch_metadata'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/mixin/alibaba_metadata.rb:51:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/mixin/alibaba_metadata.rb:51:in `fetch_metadata'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/mixin/alibaba_metadata.rb:52:in `block in fetch_metadata'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/mixin/alibaba_metadata.rb:51:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/mixin/alibaba_metadata.rb:51:in `fetch_metadata'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/plugins/alibaba.rb:64:in `block (2 levels) in <main>'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/dsl/plugin/versionvii.rb:139:in `instance_eval'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/dsl/plugin/versionvii.rb:139:in `run_plugin'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/dsl/plugin.rb:115:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/dsl/plugin.rb:200:in `safe_run'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/runner.rb:99:in `run_v7_plugin'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/runner.rb:57:in `block in run_plugin'
/opt/gitlab/embedded/lib/ruby/2.7.0/benchmark.rb:308:in `realtime'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/runner.rb:50:in `run_plugin'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/system.rb:131:in `block in run_plugins'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/system.rb:130:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/system.rb:130:in `run_plugins'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/ohai-17.9.0/lib/ohai/system.rb:105:in `all_plugins'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/chef-17.10.0/lib/chef/client.rb:589:in `run_ohai'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/chef-17.10.0/lib/chef/client.rb:256:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/chef-17.10.0/lib/chef/application.rb:305:in `run_with_graceful_exit_option'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/chef-17.10.0/lib/chef/application.rb:281:in `block in run_chef_client'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/chef-17.10.0/lib/chef/local_mode.rb:42:in `with_server_connectivity'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/chef-17.10.0/lib/chef/application.rb:264:in `run_chef_client'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/chef-17.10.0/lib/chef/application/base.rb:352:in `run_application'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/chef-17.10.0/lib/chef/application.rb:67:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/chef-bin-17.10.0/bin/cinc-client:25:in `<top (required)>'
/opt/gitlab/embedded/bin/cinc-client:23:in `load'
/opt/gitlab/embedded/bin/cinc-client:23:in `<main>'