Could not autoload puppet/type/dism Error on running puppet script - windows

Puppet Agent - 64 bit v4.0.0
OS- Windows Server R2 64 bit
I am trying to install IIS by using DISM module (https://forge.puppetlabs.com/puppetlabs/dism) from Puppet site.
I am trying to run the following script. Im sure it is correct.
dism {
'IIS-WebServerRole': ensure => present,
}
dism {
'IIS-WebServer': ensure => present,
}
The module is correctly installed and I have tried re-installing it several times but I get the the error mentioned below repeatedly. How do I resolve this ?
Im using Puppet
C:\Program Files\Puppet Labs\Puppet\bin>puppet apply IIS_Install.pp
Error: Could not autoload puppet/type/dism: Attempt to redefine method set_present with block
Error: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/dism: Attempt to redefine method set_pesent with block at C:/Program Files/Puppet Labs/Puppet/bin/IIS_Install.pp:2:3 on node win-i73ju1hai2q.localdomain
Error: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/dism: Attempt to redefine method set_pesent with block at C:/Program Files/Puppet Labs/Puppet/bin/IIS_Install.pp:2:3 on node win-i73ju1hai2q.localdomain

Try ensure => 'present'
The error isn't very helpful, but I think it might be Puppet v4 and how the parser is different and more strict.
If that doesn't work, make sure that you should be using ensure at all. Not all resources are ensurable.

Related

Chef: Why am I not reading in the attribute value I just set?

I am getting my toes wet with chef at my job and have been tasked with installing making a recipe to install telegraf on our machines with custom configs. Let me also preface this with I have no ruby experience.
Before downloading or installing telegraf I want to verify that the if telegraf exists to only do all the following work if the versions miss match.
So I have attempted to set an attribute during the recipe runtime that other resources will check against.
ruby_block 'get telegraf version' do
block do
#tricky way to load this Chef::Mixin::ShellOut utilities
Chef::Resource::RubyBlock.send(:include, Chef::Mixin::ShellOut)
command = 'C:\\Program Files\\telegraf\\telegraf.exe --version'
command_out = shell_out(command)
node.default['windows']['telegraf']['installed_version'] = 'good'
end
notifies :write, 'log[log_version]', :delayed
action :run
only_if { ::File.exists?('C:\\Program Files\\telegraf\\telegraf.exe')}
end
log 'log_version' do
message node['windows']['telegraf']['installed_version']
level :error
end
When I look at the output though I see
* ruby_block[get telegraf version] action run[2018-07-23T14:48:11-07:00] INFO: Processing ruby_block[get telegraf version] action run (win-telegraf::telegraf line 26)
[2018-07-23T14:48:11-07:00] INFO: ruby_block[get telegraf version] called
- execute the ruby block get telegraf version
* log[log_version] action write[2018-07-23T14:48:11-07:00] INFO: Processing log[log_version] action write (win-telegraf::telegraf line 39)
[2018-07-23T14:48:11-07:00] ERROR:
So why is it when I read node['windows']['telegraf']['installed_version'] that the log prints nothing instead of 'good'?
Chef uses a two-pass loading system, check out https://coderanger.net/two-pass/ for more details. But the tl;dr for this case is that the stuff inside block do ... end runs in the second phase, while the Ruby code for the log resource is evaluated in the first phase. In general you can fix this using the lazy{} helper, but in this case what you probably want is either a custom resource or an Ohai plugin. For "normal" Windows applications, this is all handled by the MSI subsystem and the windows_package resource, but as Telegraf doesn't offer MSI packages you are a bit out of luck. That said, there are packages available for Chocolatey (a Windows packaging system like Mac's Homebrew) so you might want to look into using that instead of writing this yourself.

Internal error: org.jetbrains.concurrency.MessageError: Helper script failed on remote: _jb_debug_helper is not defined

WebStorm 2017.2.1
Internal error: org.jetbrains.concurrency.MessageError: Helper script failed on remote: _jb_debug_helper is not defined
I am getting above error when tries to run debugger and look for certain properties in 'local' section. Even a single watch expression added to it does not return the result.
the issue is tracked as WEB-27884, please follow it for updates

Why does Phalcon 2 raise "undefined symbol: php_pdo_get_dbh_ce in Unknown on line 0" warning?

When I installed Phalcon 2.0.13 according to the https://docs.phalconphp.com/en/latest/reference/install.html description and I wanted to launch my test script then I got the following error (literally it is just a warning but it causes Phalcon not to be loaded which causes errors):
{
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/phalcon.so' - /usr/lib/php/20131226/phalcon.so: undefined symbol: php_pdo_get_dbh_ce in Unknown on line 0
}
What is this symptom cased by and how could I get rid of it?
After struggling a lot, I managed to solve the problem. The {extension=phalcon.so} line should be put NOT in php.ini. Much rather, you should create a /etc/php/5.6/cli/conf.d/30-phalcon.ini file containing {extension=phalcon.so}.
The reason is that this way you can guarantee that the processing order of the ini files is appropriate.
If you want to use Phantom not just in cli but in apache module as well then copy the ini file in the corresponding directory too.
(The directory names can be different in your system.)

How to debug Errno::EIO error in Chef recipe using Chef::Provider::Git

I'm trying to use chef to check out a git repo to a windows client node.
This seems simple enough and I've got the following resource definition:
git "C:\\pathtocheckout" do
repo "https://gitserver/repo.git"
action [ :checkout, :sync]
end
But when this is reached by chef-client I get:
Errno::EIO: git[C:\pathtocheckout] (cookbook_name::test line 21) had an error: Errno::EIO: Input/output error - CreateProcessW
I've had a look at the stacktrace produced and it appears to be something to do with creating a process to run the git command - but this is the limit of my knowledge.
I've made sure git is installed on on Path, removed all other recipes from the run list, running as a different admin user and I've tried different repositories but all with the same error.
So I'm pretty stumped - anyone got a way I can dig into this error and see what is going on?

ADODB.Connection error from Ruby script on Apache server

I have a Ruby script (non-Rails) that connects to a SQL Server database. When run from the command line, it runs fine. When executed via an http request, it generates an error, specifically when opening the DB connection. Something about the combination of the http/SQL methods is failing.
I'm running the script on a machine with: Windows 7 Ultimate (64-bit), Ruby 1.9.3p125, Apache 2.2.11. The database is SQL Server 10.0.4000, hosted on a separate (corporate, internal) server.
The script looks something like this:
#!/Ruby193/bin/ruby
require 'win32ole'
...
$qadb = nil
begin
$qadb = SqlServer.new('192.168.100.249', 'qauser', 'password')
$qadb.open('qadb')
rescue
logRegression("Rescued: Unable to access QADB: #{$!}")
end
The SqlServer class is based on David Mullet's code, found at http://rubyonwindows.blogspot.com/2007/03/ruby-ado-and-sqlserver.html (not copied here for brevity).
From the command line, the DB opens fine and I get an expected result from the script. When I call the script via my internal server (http://qatools/getTask.rb) I get the following error in my log file:
Rescued: Unable to access QADB: failed to create WIN32OLE object from `ADODB.Connection'
HRESULT error code:0x8007007e
The specified module could not be found.
I've considered that I might be missing a DLL. Other research led me to ntwdblib.dll -- I tried downloading a copy and placing it in various folders. I've also considered that I might be facing an Apache configuration issue and/or a security/permissions issue but I haven't found any solutions for those that seem to fit my specific problem.
Any ideas?

Resources