michaelklishin / cassandra-chef-cookbook

Chef cookbook for Apache Cassandra, DataStax Enterprise (DSE) and DataStax agent
Apache License 2.0
163 stars 228 forks source link

dse-full package install throwing dependency errors on Ubuntu #277

Closed kbruner closed 6 years ago

kbruner commented 8 years ago

If I specify the following:

node.set['cassandra'] = {
  install_method: 'datastax',
  version: '4.7.2',
  release: '1',
  package_name: 'dse-full',
  service_name: 'dse',
  dse: {
     credentials: {
        username: x,
        password: x
     }
  }
...
}

and include_recipe 'cassandra-dse', on Ubuntu-14.04, I get the following:

    ================================================================================
    Error executing action `install` on resource 'apt_package[dse-full]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '100'
    ---- Begin output of apt-get -q -y --force-yes -o Dpkg::Options::="--force-confold" install dse-full=4.7.2-1 ----
    STDOUT: Reading package lists...
    Building dependency tree...
    Reading state information...
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
     dse-full : Depends: dse-hive (= 4.7.2-1) but it is not going to be installed
                Depends: dse-pig (= 4.7.2-1) but it is not going to be installed
                Depends: dse-demos (= 4.7.2-1) but it is not going to be installed
                Depends: dse-libsolr (= 4.7.2-1) but 4.8.6-1 is to be installed
                Depends: dse-libtomcat (= 4.7.2-1) but 4.8.6-1 is to be installed
                Depends: dse-libsqoop (= 4.7.2-1) but 4.8.6-1 is to be installed
                Depends: dse-liblog4j (= 4.7.2-1) but 4.8.6-1 is to be installed
                Depends: dse-libmahout (= 4.7.2-1) but 4.8.6-1 is to be installed
                Depends: dse-libspark (= 4.7.2-1) but 4.8.6-1 is to be installed
    STDERR: E: Unable to correct problems, you have held broken packages.
    ---- End output of apt-get -q -y --force-yes -o Dpkg::Options::="--force-confold" install dse-full=4.7.2-1 ----
    Ran apt-get -q -y --force-yes -o Dpkg::Options::="--force-confold" install dse-full=4.7.2-1 returned 100

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/cassandra-dse/recipes/datastax.rb

     90:   package node['cassandra']['package_name'] do
     91:     action :install
     92:     options '--force-yes -o Dpkg::Options::="--force-confold"'
     93:     version "#{node['cassandra']['version']}-#{node['cassandra']['release']}"
     94:     # giving C* some time to start up
     95:     notifies :start, 'service[cassandra]', :immediately
     96:     notifies :run, 'ruby_block[sleep30s]', :immediately
     97:     notifies :run, 'ruby_block[set_fd_limit]', :immediately
     98:     notifies :run, 'execute[set_cluster_name]', :immediately
     99:   end
    100:

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/cassandra-dse/recipes/datastax.rb:90:in `from_file'

    apt_package("dse-full") do
      action [:install]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      options "--force-yes -o Dpkg::Options::=\"--force-confold\""
      package_name "dse-full"
      version "4.7.2-1"
      declared_type :package
      cookbook_name "cassandra-dse"
      recipe_name "datastax"
    end

The only workaround I can see for trying to install a specific version of dse-full to get the dependencies to work out is, in my wrapper recipe, add apt_preference resources for each one, setting the correct version. Am I missing something?

(This is a clean system, with no strange apt configs.)

kbruner commented 8 years ago

Actually, this seems to be related to a larger problem. The dse version is totally different from the C* version it contains. (dse 4.7.2 has C* 2.1.18 or so). This is also causing issues with the jamm version calculations, because node['cassandra']['version'] that I need to specify the dse package is being used to decide the jamm version, resulting in the wrong version (and preventing startup).

MirrorZ commented 8 years ago

One of the workarounds for the jamm issue would be to override the jamm version, source in your wrapper cookbook.

eyalzek commented 8 years ago

Any solutions to the original problem here? I started facing these issues yesterday in my kitchen tests for no apparent reason. EDIT: seems like trying to install the non-latest version causes this issue. If I use the latest available (5.0.4 in this case) I don't get any dependency problems...

michaelklishin commented 8 years ago

@eyalzek the message comes from apt. Try to make apt-get install work first as it very well may be a system-specific dependency resolution problem that this cookbook is not responsible for.

eyalzek commented 8 years ago

From googling around it seems like this issue comes up every time a new version of cassandra-dse is released and you try to install an older version. I agree, it doesn't seem to be your problem.

michaelklishin commented 6 years ago

@eyalzek this cookbook does not do anything particularly clever with Debian package dependencies. If what you claim to happen is true, something is wrong with the Debian package we use.

eyalzek commented 6 years ago

@michaelklishin the problem and solution are described here: https://stackoverflow.com/questions/30890610/cant-install-previous-version-of-datastax-dse