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

show_download_progress in remote_file is causing FloatDomainError: Infinity #8831

Open
isuftin opened this issue Aug 20, 2019 · 0 comments

Comments

@isuftin
Copy link

commented Aug 20, 2019

Description

Calling remote_file on an HTTPS URL that includes a 307 redirect causes chef_client to error with FloatDomainError: Infinity when I have show_progress set to true. When it's set to false, my code runs with no issue.

The issue happens when the chef-client hits this code:
https://github.com/USGS-CIDA/chef-cookbook-datachecks/blob/master/recipes/emailer_scheduler_setup.rb#L46-L48

Chef Version

14.13.11

Platform Version

CentOS 7 x86_64-linux

Replication Case

remote_file File.join(Chef::Config[:file_cache_path].to_s, 'pom.xml') do
  source "https://cida.usgs.gov/maven/service/local/artifact/maven/redirect?r=cida-public-releases&g=gov.usgs.cida&a=data-checks-email&v=1.0.5&e=pom"
  show_progress true
end

Client Output

    ================================================================================
    Error executing action `create` on resource 'remote_file[/var/chef/cache/pom.xml]'
    ================================================================================

    FloatDomainError
    ----------------
    Infinity

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/data-checks/recipes/emailer_scheduler_setup.rb

     46: remote_file File.join(Chef::Config[:file_cache_path].to_s, 'pom.xml') do
     47:   source "https://cida.usgs.gov/maven/service/local/artifact/maven/redirect?r=cida-public-releases&g=gov.usgs.cida&a=data-checks-email&v=#{email_project_version}&e=pom"
     48: end
     49:

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/data-checks/recipes/emailer_scheduler_setup.rb:46:in `from_file'

    remote_file("/var/chef/cache/pom.xml") do
      action [:create]
      default_guard_interpreter :default
      source ["https://cida.usgs.gov/maven/service/local/artifact/maven/redirect?r=cida-public-releases&g=gov.usgs.cida&a=data-checks-email&v=1.0.5&e=pom"]
      declared_type :remote_file
      cookbook_name "data-checks"
      recipe_name "emailer_scheduler_setup"
      owner nil
      remote_domain nil
      remote_user nil
      path "/var/chef/cache/pom.xml"
      mode nil
      group nil
      verifications []
      headers {}
    end

    System Info:
    ------------
    chef_version=14.13.11
    platform=centos
    platform_version=7.6.1810
    ruby=ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]
    program_name=chef-client worker: ppid=22566;start=15:40:21;
    executable=/opt/chef/bin/chef-client

Stacktrace

/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/formatters/doc.rb:295:in `to_i'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/formatters/doc.rb:295:in `resource_update_progress'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/event_dispatch/dispatcher.rb:43:in `call'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/event_dispatch/dispatcher.rb:43:in `block in call_subscribers'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/event_dispatch/dispatcher.rb:34:in `each'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/event_dispatch/dispatcher.rb:34:in `call_subscribers'
(eval):2:in `resource_update_progress'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/provider/remote_file/http.rb:69:in `block in fetch'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/http.rb:529:in `block in stream_to_tempfile'
/opt/chef/embedded/lib/ruby/2.5.0/net/protocol.rb:433:in `call_block'
/opt/chef/embedded/lib/ruby/2.5.0/net/protocol.rb:424:in `<<'
/opt/chef/embedded/lib/ruby/2.5.0/net/protocol.rb:144:in `read_all'
/opt/chef/embedded/lib/ruby/2.5.0/net/http/response.rb:301:in `block in read_body_0'
/opt/chef/embedded/lib/ruby/2.5.0/net/http/response.rb:253:in `inflater'
/opt/chef/embedded/lib/ruby/2.5.0/net/http/response.rb:283:in `read_body_0'
/opt/chef/embedded/lib/ruby/2.5.0/net/http/response.rb:204:in `read_body'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/http.rb:527:in `stream_to_tempfile'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/http.rb:184:in `block in streaming_request_with_progress'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/http/basic_client.rb:92:in `block in request'
/opt/chef/embedded/lib/ruby/2.5.0/net/http.rb:1506:in `block in transport_request'
/opt/chef/embedded/lib/ruby/2.5.0/net/http/response.rb:165:in `reading_body'
/opt/chef/embedded/lib/ruby/2.5.0/net/http.rb:1505:in `transport_request'
/opt/chef/embedded/lib/ruby/2.5.0/net/http.rb:1467:in `request'
/opt/chef/embedded/lib/ruby/2.5.0/net/http.rb:1460:in `block in request'
/opt/chef/embedded/lib/ruby/2.5.0/net/http.rb:910:in `start'
/opt/chef/embedded/lib/ruby/2.5.0/net/http.rb:1458:in `request'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/http/basic_client.rb:69:in `request'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/http.rb:370:in `block in send_http_request'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/http.rb:411:in `block in retrying_http_errors'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/http.rb:409:in `loop'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/http.rb:409:in `retrying_http_errors'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/http.rb:365:in `send_http_request'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/http.rb:390:in `block (2 levels) in send_http_request'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/http.rb:485:in `follow_redirect'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/http.rb:383:in `block in send_http_request'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/http.rb:411:in `block in retrying_http_errors'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/http.rb:409:in `loop'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/http.rb:409:in `retrying_http_errors'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/http.rb:365:in `send_http_request'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/http.rb:182:in `streaming_request_with_progress'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/provider/remote_file/http.rb:68:in `fetch'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/provider/remote_file/content.rb:71:in `grab_file_from_uri'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/provider/remote_file/content.rb:56:in `try_multiple_sources'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/provider/remote_file/content.rb:41:in `file_for_provider'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/file_content_management/content_base.rb:42:in `tempfile'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/provider/file.rb:450:in `tempfile'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/provider/file.rb:327:in `do_generate_content'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/provider/file.rb:140:in `action_create'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/provider.rb:182:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/resource.rb:578:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/runner.rb:70:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/runner.rb:98:in `block (2 levels) in converge'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/runner.rb:98:in `each'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/runner.rb:98:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/runner.rb:97:in `converge'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/client.rb:720:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/client.rb:715:in `catch'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/client.rb:715:in `converge'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/client.rb:754:in `converge_and_save'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/client.rb:286:in `run'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/application.rb:321:in `block in fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/application.rb:309:in `fork'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/application.rb:309:in `fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/application.rb:274:in `block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/local_mode.rb:44:in `with_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/application.rb:261:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/application/client.rb:484:in `sleep_then_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/application/client.rb:473:in `block in interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/application/client.rb:472:in `loop'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/application/client.rb:472:in `interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/application/client.rb:456:in `run_application'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/lib/chef/application.rb:66:in `run'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.13.11/bin/chef-client:25:in `<top (required)>'
/bin/chef-client:81:in `load'
/bin/chef-client:81:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.