.NET Framework Detection in the Windows Registry

To determine which .NET framework is installed on the Windows computer check the values in the registry. The HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full key contains two values you can check: Release Version You can use InSpec, part of the Chef DK, to check the values: describe registry_key(‘HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full’) do it { should have_property ‘Release’ } it { …

Chef exit codes

Chef uses the standard RFC 062 exit codes. In your .kitchen.yml file, you can supply an array of exit codes in the “retry_on_exit_code” option to retry the operation in case the Chef script execution is interrupted. The usual values are retry_on_exit_code: # An array of exit codes that can indicate that kitchen should retry the converge …

FATAL: Chef::Exceptions::Reboot: Rebooting server at a recipe’s request.

When your Chef recipe requests a reboot using the “reboot” Chef resource, the output window shows an error message: Chef Client finished, …/… resources updated in … seconds […] WARN: Rebooting server at a recipe’s request. Details: {:delay_mins=>1, :reason=>”…”, :timestamp=>…, :requested_by=>”…”} Running handlers: […] ERROR: Running exception handlers Running handlers complete […] ERROR: Exception handlers complete Chef …

Unable to satisfy constraints on package

When you make a change to the version restrictions in the metadata.rb file and execute berks install in your Chef cookbook directory, you may get the error message: Unable to satisfy constraints on package … due to solution constraint (…). Solution constraints that may result in a constraint on …: [(…)], [(…) -> (…)] Demand that …

amazon-ebs: Error waiting for SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

When you launch a Linux AWS EC2 instance with Terraform or create a Linux AWS image with Packer, one of the following errors are displayed: amazon-ebs: Error waiting for SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain aws_instance.default: 1 error(s) occurred: * ssh: handshake failed: ssh: unable to …

Procedure or function ‘`…_Insert`’ cannot be found in database …

When you use the Microsoft .NET Entity framework to access a MySql database, the autogenerated code throws an error when you try to insert a row into the database with context.MY_TABLE.Add(MY_OBJECT); Server Error in ‘/’ Application. Procedure or function ‘`…_Insert`’ cannot be found in database ‘`…`’. Description: An unhandled exception occurred during the execution of …

No connection string named ‘…’ could be found in the application config file.

Two-tier applications separate the presentation layer and the data layer, and all database access related objects are located in the data-tier. When the application runs, the config file of the main project is read. In web applications, it is the web.config, in console applications the app.config file. When you get the following runtime exception Exception thrown: ‘System.InvalidOperationException’ in …

delimited by end-of-file (wanted `EOF’)

When you create a file in a script and use an end of file delimiter, if … cat <<EOF> $chef_dir/attrib.json $json EOF fi and you indent the word EOF to look nicer, you will get the error message warning: here-document at line … delimited by end-of-file (wanted `EOF’) STDERR> …: line …: syntax error: unexpected end of file …

could not find filename for attribute .DS_Store in cookbook

The Macintosh workstation saves application states in .DS_Store files. When you edit your Chef cookbooks the MacOS leaves these files in many folders. When the Chef cookbook is executed, the Chef Client reads all files in the attributes folder and tries to extract values from them. If the .DS_Store file is uploaded with the rest of …