sous-chefs / java

Development repository for the java cookbook
https://supermarket.chef.io/cookbooks/java
Apache License 2.0
386 stars 637 forks source link

Chef Exceptions CookbookChefVersionMismatch: Cookbook 'java' version '8.5.0' depends on chef version [">= 15.0"], but the running chef version is 14.15.6 #647

Closed djcoster closed 3 years ago

djcoster commented 3 years ago

:speaking_head: Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

:ghost: Brief Description

Claims requirement of "Chef 15+" but trying to call this gives the error in subject.

:pancakes: Cookbook version

2.0.0

:woman_cook: Chef-Infra Version

14.15.6

:tophat: Platform details

Ubuntu 20.04

Steps To Reproduce

  1. Create a wrapper cookbook with:
    apt_package 'openjdk-8-jdk-headless'
    include_recipe 'unifi'` and nothing else.
  2. Bootstrap node with chef-client version 14.x.x
  3. See error for chef-client in /var/chef/cache/chef-stacktrace.out

:police_car: Expected behavior

No error should be produced.

:heavy_plus_sign: Additional context

The README mentions that Java version 8 is required, but putting depends java in the metadata.rb makes it use the most recent and produces this error, since I did not use that cookbook to install the JDK. The best thing would be to remove this dependancy. This doesn't even check if java is installed on the machine and just causes the error mentioned.

I got around this by putting a depends 'java', '~> 8.0.0' in my metadata.rb file to lock the version to one that accepts my version of chef-client.

ramereth commented 3 years ago

@djcoster I'm a little confused by your issue. The version of the cookbook you mention requires you use Chef 15 or greater. Chef 14 and below will not work properly with this cookbook. Can you please clarify?

djcoster commented 3 years ago

@ramereth, It appears that I created this issue on the wrong cookbook. It was supposed to be placed on the unifi cookbook that references this one in the metadata. Sorry for the confusion.