Type Error : no implicit conversion of String into Integer

Hi,

I have a task to install a package on linux platform. The service that the package installed needs to run with a specific user. I am creating the user on the fly within the recipe and then using this user restarting the service thats installed within the recipe. Everything runs fine up until the service block. I get the below error in the service block:

  • service[service-manager] action enable

    ================================================================================
    Error executing action enable on resource 'service[service-manager]'

    TypeError

    no implicit conversion of String into Integer

    Resource Declaration:

    In /root/.chef/local-mode-cache/cache/cookbooks/service_manager/recipes/default.rb

    184: service 'service-manager' do
    185: user 'nginx'
    186: action :enable
    187: end
    188:

    Compiled Resource:

    Declared in /root/.chef/local-mode-cache/cache/cookbooks/service_manager/recipes/default.rb:184:in `from_file'

    service("nginx") do
    action [:enable]
    default_guard_interpreter :default
    service_name "service-manager"
    enabled nil
    running nil
    masked nil
    pattern "service-manager"
    user "nginx"
    declared_type :service
    cookbook_name "service_manager"
    recipe_name "default"
    end

    System Info:

    chef_version=14.1.12
    platform=redhat
    platform_version=7.3
    ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
    program_name=/bin/chef-client
    executable=/opt/chefdk/bin/chef-client