With version >=3.4.5 of the windows cookbook release, our instance builds are failing, since we're still on Chef 11.10 / Berkshelf 3.2.0.
I added cookbook 'windows', '= 3.4.4' to our Berksfile, but the build is still failing, since it's still loading windows 4.1.1, even with the added entry to Berksfile.
How do I override OpsWorks to use windows 3.4.4?
Here's the full error log:
Recipe Compile Error in /var/lib/aws/opsworks/cache.stage2/cookbooks/windows/resources/auto_run.rb
NoMethodError
-------------
undefined method `property' for #<Class:0x007f72ac6f8b20>
Cookbook Trace:
---------------
/var/lib/aws/opsworks/cache.stage2/cookbooks/windows/resources/auto_run.rb:22:in `class_from_file'
Relevant File Content:
----------------------
/var/lib/aws/opsworks/cache.stage2/cookbooks/windows/resources/auto_run.rb:
21:
22>> property :program_name, String, name_property: true
23: property :path, String, coerce: proc { |x| x.tr('/', '\\') }
24: property :args, String
25: property :root, Symbol,
26: equal_to: %i(machine user),
27: default: :machine
28:
29: alias_method :program, :path
30:
31: action :create do
add below in berksfile, this should work for 11+ versions
cookbook 'windows', '<= 1.44.3'
I fixed this by adding this to the Berksfile
cookbook 'windows', '= 2.0.2'
Update cookbooks, setup. I also added it to the wrong git branch, so lost about 20 minutes figuring that out.
Related
I'm trying to get a server up and running via knife bootstrap via this command:
knife bootstrap "<ip-address>"
-x ec2-user
-r recipe[connector],recipe[all-servers]
-N "serv-name"
-E staging
-i "~/.chef/mycert.pem"
--sudo
--no-host-key-verify
The all-servers recipe includes dependencies for windows that are broken in chef 13+:
(TLDRS, full stack traces are at the bottom)
13: undefined method “kernel” (outdated 7-zip cookbook dependency 3.0 instead of 2.0)
14: cannot load such file -- chef/mixin/language (windows cookbook dependency, 3.0 + for windows cookbook would fix this)
15: manual license acceptance required and cannot load such file -- chef/mixin/language error (windows cookbook dependency, 3.0 + for windows cookbook would fix this)
The big problem is that a bunch of under-maintained services use the older versions and upgrading any of them is likely to cause multitudes of problems throughout the chef org, so I want to have just this server use a newer version of either the windows or 7-zip cookbook.
What I tried to do to solve for this was created a new cookbook "all-servers-dev" and created dev versions of all the cookbooks in the dependency tree all the way down to "windows" where I downloaded the updated windows cookbook and replaced it at the bottom of the dependency tree. This didn't work however because chef keeps trying to sync all cookbooks even the windows one even though it's not included anywhere in the dependency tree that I can find.
I even tried removing the all-servers recipe and just installing the connector recipe whose only dependency is yum-epel whose only dependency is "compat_resource" which has no dependencies.
13.12.14
================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/seven_zip/attributes/default.rb
================================================================================
NoMethodError
-------------
undefined method `kernel' for #<Chef::Node::Attribute:xxxxxxxxxxxxxxxxx>
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/seven_zip/attributes/default.rb:21:in `from_file'
Relevant File Content:
----------------------
/var/chef/cache/cookbooks/seven_zip/attributes/default.rb:
14: # Unless required by applicable law or agreed to in writing, software
15: # distributed under the License is distributed on an "AS IS" BASIS,
16: # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: # See the License for the specific language governing permissions and
18: # limitations under the License.
19: #
20:
21>> if kernel['machine'] =~ /x86_64/
22: default['seven_zip']['url'] = 'http://www.7-zip.org/a/7z1514-x64.msi'
23: default['seven_zip']['checksum'] = 'xxxxxxxxxx'
24: default['seven_zip']['package_name'] = '7-Zip 15.14 (x64 edition)'
25: else
26: default['seven_zip']['url'] = 'http://www.7-zip.org/a/7z1514.msi'
27: default['seven_zip']['checksum'] = 'xxxxxxxxxx'
28: default['seven_zip']['package_name'] = '7-Zip 15.14'
29: end
30:
System Info:
------------
chef_version=13.12.14
platform=amazon
platform_version=2017.03
ruby=ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-linux]
program_name=chef-client worker: ppid=3493;start=17:29:14;
executable=/opt/chef/bin/chef-client
Running handlers:
[2019-12-04T17:29:32+00:00] ERROR: Running exception handlers
Running handlers complete
[2019-12-04T17:29:32+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 17 seconds
[2019-12-04T17:29:32+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2019-12-04T17:29:32+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2019-12-04T17:29:32+00:00] ERROR: undefined method `kernel' for #<Chef::Node::Attribute:xxxxxxxxxx>
[2019-12-04T17:29:32+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
14.14.29
================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/windows/libraries/windows_package.rb
================================================================================
LoadError
---------
cannot load such file -- chef/mixin/language
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/windows/libraries/windows_package.rb:7:in `<top (required)>'
Relevant File Content:
----------------------
/var/chef/cache/cookbooks/windows/libraries/windows_package.rb:
1: require 'chef/resource/lwrp_base'
2: require 'chef/provider/lwrp_base'
3:
4: require 'win32/registry' if RUBY_PLATFORM =~ /mswin|mingw32|windows/
5:
6: require 'chef/mixin/shell_out'
7>> require 'chef/mixin/language'
8: class Chef
9: class Provider
10: class WindowsCookbookPackage < Chef::Provider::LWRPBase
11: include Chef::Mixin::ShellOut
12: include Windows::Helper
13:
14: # the logic in all action methods mirror that of
15: # the Chef::Provider::Package which will make
16: # refactoring into core chef easy
System Info:
------------
chef_version=14.14.29
platform=amazon
platform_version=2017.03
ruby=ruby 2.5.7p206 (2019-10-01 revision 67816) [x86_64-linux]
program_name=/usr/bin/chef-client
executable=/opt/chef/bin/chef-client
Running handlers:
[2019-12-04T18:06:28+00:00] ERROR: Running exception handlers
Running handlers complete
[2019-12-04T18:06:28+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 35 seconds
[2019-12-04T18:06:28+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2019-12-04T18:06:28+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2019-12-04T18:06:28+00:00] FATAL: LoadError: cannot load such file -- chef/mixin/language
15.5.17
Chef has a new prompt that’s unhandled by knife bootstrap:
Do you accept the 2 product licenses (yes/no)?
You can’t accept these from the bootstrap CLI, so you have to ssh to the server and run chef manually which then results in the same error as 14:
================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/windows/libraries/windows_package.rb
================================================================================
LoadError
---------
cannot load such file -- chef/mixin/language
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/windows/libraries/windows_package.rb:7:in `<top (required)>'
Relevant File Content:
----------------------
/var/chef/cache/cookbooks/windows/libraries/windows_package.rb:
1: require 'chef/resource/lwrp_base'
2: require 'chef/provider/lwrp_base'
3:
4: require 'win32/registry' if RUBY_PLATFORM =~ /mswin|mingw32|windows/
5:
6: require 'chef/mixin/shell_out'
7>> require 'chef/mixin/language'
8: class Chef
9: class Provider
10: class WindowsCookbookPackage < Chef::Provider::LWRPBase
11: include Chef::Mixin::ShellOut
12: include Windows::Helper
13:
14: # the logic in all action methods mirror that of
15: # the Chef::Provider::Package which will make
16: # refactoring into core chef easy
System Info:
------------
chef_version=15.5.17
platform=amazon
platform_version=2017.03
ruby=ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
program_name=/usr/bin/chef-client
executable=/opt/chef/bin/chef-client
Running handlers:
[2019-12-04T18:14:03+00:00] ERROR: Running exception handlers
Running handlers complete
[2019-12-04T18:14:03+00:00] ERROR: Exception handlers complete
Chef Infra Client failed. 0 resources updated in 18 seconds
[2019-12-04T18:14:03+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2019-12-04T18:14:03+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2019-12-04T18:14:03+00:00] FATAL: LoadError: cannot load such file -- chef/mixin/language
15.5.17 Chef has a new prompt that’s unhandled by knife bootstrap:
Do you accept the 2 product licenses (yes/no)?
You can’t accept these from the bootstrap CLI, so you have to ssh to
the server and run chef manually
that is incorrect, you can use --chef-license accept when you bootstrap the node to accept the chef license
if i understood your right, you wish to pin the different versions of the same cookbooks collection. if that is the case, you can acheive it by using environment:
Cookbook versions can be pinned in each environment, which allows you to control the rollout of new cookbook releases through successive testing environments before releasing new cookbook versions into production environments. See the environment format examples below for the cookbook pinning syntax.
so just remember to associate your nodes with specific chef environment, such that each environment has its own cookbook collection.
I just install Xcode 9 and build my native iOS project. (Is written in swift)
The project was OK in Xcode 8 but now, I obtain this error:
No viable overloaded '='
In the file: Pods\Pods\Realm\object.cpp
Line 42 => m_notifier = std::make_shared<_impl::ObjectNotifier>(m_row, m_realm);
If you are using Cocoapods, open up the Podfile and set the RealmSwift version to 2.8.1 (or 2.8.3 as David mentioned above). Here is my Podfile for Swift 3.0 using Xcode 9:
target ‘<PROJECT>’ do
use_frameworks!
# Pods
...
pod 'RealmSwift', '2.8.1'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
Then, save the file and run:
pod install
If you're not setting a specific pod version (which I recommend), run the following command:
pod update RealmSwift
and it will automatically update to the most recent version (2.8.3).
Hope it helps to complement David's answer. Thanks!
The Realm team has worked on a new version allowing you to build your project with XCode 9.
Just update your Realm version to at least 2.8.1 (current version is 2.8.3)
https://github.com/realm/realm-cocoa/releases/tag/v2.8.1
The Realm release note of 2.8.1 clearly states :
Add support for building with Xcode 9 Beta 1.
I was using version 3.3 of the otrs and decided to upgrade to 4.0.9. I took to first uninstall all the modules that are not official (KIX4OTRS, complement and others), but after the upgrade by following the steps of the official documentation, without mistakes, I'm in trouble while trying to access the overview in the CMDB . The error occurs only in the overview, the creation and modification of items usually works.
Even after removing the KIX4OTRS still contained some messages it.
Error:
Backend ERROR: OTRS-CGI-10 Perl: 5.16.0 OS: linux Time: Wed Oct 21 14:26:45 2015 Message: No config option found for the view 'Custom'! RemoteAddress: 191.1.200.123 RequestURI: /otrs/index.pl?Action=AgentITSMConfigItem Traceback (3255): Module: Kernel::Output::HTML::LayoutITSMConfigItem::ITSMConfigItemListShow Line: 332 Module: Kernel::Modules::AgentITSMConfigItem::Run Line: 302 Module: Kernel::System::Web::InterfaceAgent::Run Line: 996 Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 41 Module: (eval) (v1.99) Line: 204 Module: ModPerl::RegistryCooker::run (v1.99) Line: 204 Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 170 Module: ModPerl::Registry::handler (v1.99) Line: 31
*I checked the Perl modules are all Okay
*My ITSM is version 4.0.9
It worked! Finally ... I used DataBase Browser software and deleted some entries and now I can access the CMDB. I deleted some entries referring to my ID in the table "user_preferences" session_id and session_profile. I'm not sure with was responsible for solving the problem.
I'm getting some very unusual behaviour.
I followed these instructions for installing jetty but used the latest version instead (9.1.1v20140108)
I had reason to restart Jetty and found I was getting these errors (logged in as root)
Starting Jetty: FAILED Wed Feb 5 12:35:59 EST 2014
So I spent 30 mins looking for an answer, then for reasons I can't recall, I did service jetty check and it was running (had a pid).
So I tried again with service Jetty stop:
root#erp:/var/log# service jetty stop
/etc/init.d/jetty: line 13: chkconfig:: command not found
/etc/init.d/jetty: line 14: description:: command not found
/etc/init.d/jetty: line 15: processname:: command not found
Stopping Jetty: start-stop-daemon: warning: failed to kill 7817: No such process
1 pids were not killed
No process in pidfile '/var/run/jetty.pid' found running; none killed.
OK
None killed? Ok. Let's check that:
root#erp:/var/log# service jetty check
/etc/init.d/jetty: line 13: chkconfig:: command not found
/etc/init.d/jetty: line 14: description:: command not found
/etc/init.d/jetty: line 15: processname:: command not found
Checking arguments to Jetty:
START_INI = /srv/jetty/start.ini
JETTY_HOME = /srv/jetty
JETTY_BASE = /srv/jetty
JETTY_CONF = /srv/jetty/etc/jetty.conf
JETTY_PID = /var/run/jetty.pid
JETTY_START = /srv/jetty/start.jar
JETTY_LOGS = /srv/jetty/logs
CLASSPATH =
JAVA = /usr/bin/java
JAVA_OPTIONS = -Dsolr.solr.home=/srv/solr -Djetty.state=/srv/jetty/jetty.state -Djetty.logs=/srv/jetty/logs -Djetty.home=/srv/jetty -Djetty.base=/srv/jetty -Djava.io.tmpdir=/tmp
JETTY_ARGS = jetty.port=8085 jetty-logging.xml jetty-started.xml
RUN_CMD = /usr/bin/java -Dsolr.solr.home=/srv/solr -Djetty.state=/srv/jetty/jetty.state -Djetty.logs=/srv/jetty/logs -Djetty.home=/srv/jetty -Djetty.base=/srv/jetty -Djava.io.tmpdir=/tmp -jar /srv/jetty/start.jar jetty.port=8085 jetty-logging.xml jetty-started.xml
No PID? Let's check that:
root#erp:/var/log# service jetty start
/etc/init.d/jetty: line 13: chkconfig:: command not found
/etc/init.d/jetty: line 14: description:: command not found
/etc/init.d/jetty: line 15: processname:: command not found
Starting Jetty: FAILED Wed Feb 5 12:39:43 EST 2014
Ok, is there a PID?
root#erp:/var/log# service jetty check
/etc/init.d/jetty: line 13: chkconfig:: command not found
/etc/init.d/jetty: line 14: description:: command not found
/etc/init.d/jetty: line 15: processname:: command not found
Checking arguments to Jetty:
[edit]
Jetty running pid=7993
Weird. Sure enough, a stop and check will give the same results.
What's going on with the jetty startup script? And why am I getting FAILED errors on start which are incorrect, and fail to remove pid errors on stop which are also incorrect?
I have got a fix for all those who have been using that tutorial to install jetty
nano /etc/init.d/jetty
And change this syntax :
start-log-file="$JETTY_LOGS/start.log"
to
start-log-file="start.log"
It will fix everything in the latest jetty build and make it run like a charm.
Hope I could be of help
Ok, so this was a tricky one that was the result of a recent Java update.
I jumped into the jetty.sh at /etc/init.d/jetty and grabbed out the actually executed line:
$ /usr/bin/java -Dsolr.solr.home=/srv/solr -Djetty.state=/srv/jetty/jetty.state \
-Djetty.logs=/srv/jetty/logs -Djetty.home=/srv/jetty -Djetty.base=/srv/jetty \
-Djava.io.tmpdir=/tmp -jar /srv/jetty/start.jar jetty.port=8085 \
jetty-logging.xml jetty-started.xml
and I got this:
java.io.IOException: Cannot read file: modules/npn/npn-1.7.0_51.mod
at org.eclipse.jetty.start.Modules.registerModule(Modules.java:405)
at org.eclipse.jetty.start.Modules.registerAll(Modules.java:395)
at org.eclipse.jetty.start.Main.processCommandLine(Main.java:561)
at org.eclipse.jetty.start.Main.main(Main.java:102)
Which in turn lead me to this solution on the eclipse dev list:
$ cp /srv/jetty/modules/npn/npn-1.7.0_45.mod /srv/jetty/modules/npn/npn-1.7.0_51.mod
$ chown jetty:jetty /srv/jetty/modules/npn/npn-1.7.0_51.mod
Sure enough, Jetty restarted without hassle.
Try running below command in terminal.
sudo service jetty9 stop
I run Jetty 9.2.10.v201503 on pcDuino v3, Ubuntu 14.04. According to my experience with this relatively slow platform, this message may be reported when Jetty server itself starts longer than internal waiting loop in /etc/init.d/jetty script expects.
After adding “set –x” at the beginning of /etc/init.d/jetty file and running that script I noticed that internal waiting loop is implemented as “for” making 15 steps and periodically checking content of the $JETTY_BASE/jetty.state file.
After waiting additional couple of seconds, Jetty server is up and running ok, no errors/warrnings in log files.
Maybe someone faced with the same situation
We have a clean instance on redis who try to put a chef
Default recipe has only
include_recipe "redisio :: install"
When I cook getting the following error
Enviroment AWS ec2.micro ubuntu 12.04
When I run cook to receive an error
================================================================================
Recipe Compile Error in /tmp/chef-solo/cookbooks/main/recipes/default.rb
================================================================================
NoMethodError
-------------
undefined method `[]' for nil:NilClass
Cookbook Trace:
---------------
/tmp/chef-solo/cookbooks/ulimit/recipes/default.rb:13:in `block in from_file'
/tmp/chef-solo/cookbooks/ulimit/recipes/default.rb:12:in `from_file'
/tmp/chef-solo/cookbooks/redisio/recipes/install.rb:20:in `from_file'
/tmp/chef-solo/cookbooks/main/recipes/default.rb:11:in `from_file'
Relevant File Content:
----------------------
/tmp/chef-solo/cookbooks/ulimit/recipes/default.rb:
6: # All rights reserved - Do Not Redistribute
7: #
8: ulimit = node['ulimit']
9:
10: case node[:platform]
11: when "debian", "ubuntu"
12: template "/etc/pam.d/su" do
13>> cookbook ulimit['pam_su_template_cookbook']
14: end
15: end
16:
[2013-04-06T14:09:50+00:00] ERROR: Running exception handlers
[2013-04-06T14:09:50+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated
[2013-04-06T14:09:50+00:00] FATAL: Stacktrace dumped to /tmp/chef-solo/chef-stacktrace.out
[2013-04-06T14:09:50+00:00] FATAL: NoMethodError: undefined method `[]' for nil:NilClass
ERROR: RuntimeError: chef-solo failed. See output above.
Resource https://github.com/Piom/redis-chef.git
I ran into this issue as well. I have one way to solve it but I am also just started looking into chef.
the issue is redisio depends on ulimit and looks like the recipe does not handle when you don't have any attributes for ulimit defined.
ulimit = node['ulimit']
try to get a hash of attributes but is getting nil. So if you define some attributes it should work.
there might be an updated version of the recipe since you downloaded it. If not in ulimit/attributes/default.rb I have default['ulimit']['pam_su_template_cookbook'] = nil and it worked for me.
ulimit let you limit resources. I think it can be used to limit redis resources. (again I am new too.) So the better way might be figure how you want to configure ulimit and set the correct attribute rather than nil