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

Looking at wrong source.list file in Ubuntu #103

Closed
switchflip opened this issue Oct 31, 2014 · 3 comments
Closed

Looking at wrong source.list file in Ubuntu #103

switchflip opened this issue Oct 31, 2014 · 3 comments

Comments

@switchflip
Copy link

I'm trying to get this plugin working for Ubuntu 14.04 trusty.

I suppose my question is, why is chef complaining about /etc/apt/sources.list.d/nginx.list when the docs at nginx tell you to format the etc/apt/sources.list?

This is the code from my recipe:

apt_repository 'nginx' do
  uri           'http://nginx.org/packages/ubuntu/'
  key           'http://nginx.org/keys/nginx_signing.key'
  distribution  'trusty'
  deb_src       true
  action        :add
end

apt_package "nginx" do
  provider Chef::Provider::Package::Apt
  action   :install
end

And here is the error message from chef:

* execute[apt-get update] action run[2014-10-31T15:45:40+00:00] ERROR: execute[apt-get update] (/tmp/kitchen/cookbooks/apt/providers/repository.rb line 156) had an error: Expected process to exit with [0], but received '100'
       ---- Begin output of apt-get update -o Dir::Etc::sourcelist='sources.list.d/nginx.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0' ----
       STDOUT:
       STDERR: E: Malformed line 1 in source list /etc/apt/sources.list.d/nginx.list (dist parse)
       E: The list of sources could not be read.
       ---- End output of apt-get update -o Dir::Etc::sourcelist='sources.list.d/nginx.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0' ----
       Ran apt-get update -o Dir::Etc::sourcelist='sources.list.d/nginx.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0' returned 100; ignore_failure is set, continuing

       ================================================================================
       Error executing action `run` on resource 'execute[apt-get update]'
       ================================================================================

       Mixlib::ShellOut::ShellCommandFailed
       ------------------------------------
       Expected process to exit with [0], but received '100'
       ---- Begin output of apt-get update -o Dir::Etc::sourcelist='sources.list.d/nginx.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0' ----
       STDOUT:
       STDERR: E: Malformed line 1 in source list /etc/apt/sources.list.d/nginx.list (dist parse)
       E: The list of sources could not be read.
       ---- End output of apt-get update -o Dir::Etc::sourcelist='sources.list.d/nginx.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0' ----
       Ran apt-get update -o Dir::Etc::sourcelist='sources.list.d/nginx.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0' returned 100

       Resource Declaration:
       ---------------------
       # In /tmp/kitchen/cookbooks/apt/providers/repository.rb

       156:   execute 'apt-get update' do
       157:     command "apt-get update -o Dir::Etc::sourcelist='sources.list.d/#{new_resource.name}.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0'"
       158:     ignore_failure true
       159:     action :nothing
       160:     notifies :run, 'execute[apt-cache gencaches]', :immediately
       161:   end
       162:

       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cookbooks/apt/providers/repository.rb:156:in `block in class_from_file'

       execute("apt-get update") do
         action [:nothing]
         ignore_failure true
         retries 0
         retry_delay 2
         command "apt-get update -o Dir::Etc::sourcelist='sources.list.d/nginx.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0'"
         backup 5
         returns 0
         cookbook_name :"touchbistro-rails"
       end


       Recipe: touchbistro-rails::newrelic_nginx_agent

       ================================================================================
       Error executing action `install` on resource 'apt_package[nginx]'
       ================================================================================

       Mixlib::ShellOut::ShellCommandFailed
       ------------------------------------
       Expected process to exit with [0], but received '100'
       ---- Begin output of apt-cache policy nginx ----
       STDOUT:
       STDERR: E: Malformed line 1 in source list /etc/apt/sources.list.d/nginx.list (dist parse)
       E: The list of sources could not be read.
       E: The package lists or status file could not be parsed or opened.
       ---- End output of apt-cache policy nginx ----
       Ran apt-cache policy nginx returned 100


       ---------------------
       # In /tmp/kitchen/cookbooks/touchbistro-rails/recipes/newrelic_nginx_agent.rb

        23: apt_package "nginx" do
        24:   provider Chef::Provider::Package::Apt
        25:   action   :install

        27:

       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cookbooks/touchbistro-rails/recipes/newrelic_nginx_agent.rb:23:in `from_file'

       apt_package("nginx") do
         provider Chef::Provider::Package::Apt
         action [:install]
         retries 0
         retry_delay 2
         package_name "nginx"
         cookbook_name :"touchbistro-rails"
         recipe_name "newrelic_nginx_agent"
       end



           - reload service service[nginx]
         * service[nginx] action restart
           - restart service service[nginx]

       Running handlers:
       [2014-10-31T15:45:40+00:00] ERROR: Running exception handlers
       Running handlers complete


       Chef Client failed. 87 resources updated in 631.862846189 seconds
       [2014-10-31T15:45:40+00:00] ERROR: apt_package[nginx] (touchbistro-rails::newrelic_nginx_agent line 23) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '100'
       ---- Begin output of apt-cache policy nginx ----
       STDOUT:
       STDERR: E: Malformed line 1 in source list /etc/apt/sources.list.d/nginx.list (dist parse)
       E: The list of sources could not be read.
       E: The package lists or status file could not be parsed or opened.
       ---- End output of apt-cache policy nginx ----
       Ran apt-cache policy nginx returned 100
       [2014-10-31T15:45:40+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
@switchflip
Copy link
Author

I fixed this... sorry.

@georeith
Copy link

@switchflip I am getting the same error, what was the issue in your case? Mine works if I re-run but always fails on first attempt with that error.

@ohlol
Copy link

ohlol commented Dec 8, 2015

@georeith Did you specify components? I had this issue until I did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants