genebean / genebean-nxlog

A Puppet module to manage NXLog
BSD 3-Clause "New" or "Revised" License
5 stars 16 forks source link

'No such file or directory' error #24

Open AnonSS opened 3 years ago

AnonSS commented 3 years ago

Hi,

I am getting this error with the default suggested config (please see full error below).
puppet server version: 6.15 Puppet agent: 7 (I also tried to run with lower versions with the same result).

Any ideas?


puppet : Error: Could not set 'file' on ensure: No such file or directory - A directory component in C:/Program Files (x86)/nxlog/conf/nxlog.conf20210508-4684-bdgpzl.lock does not exist or is a dangling symbolic link At line:1 char:7

Error: Could not set 'file' on ensure: No such file or directory - A directory component in C:/Program Files (x86)/nxlog/conf/nxlog.conf20210508-4684-bdgpzl.lock does not exist or is a dangling symbolic link Wrapped exception: No such file or directory - A directory component in C:/Program Files (x86)/nxlog/conf/nxlog.conf20210508-4684-bdgpzl.lock does not exist or is a dangling symbolic link Error: /Stage[main]/Nxlog::Config/Concat[C:/Program Files (x86)/nxlog/conf/nxlog.conf]/File[C:/Program Files (x86)/nxlog/conf/nxlog.conf]/ensure: change from 'absent' to 'file' failed: Could not set 'file' on ensure: No such file or directory - A directory component in C:/Program Files (x86)/nxlog/conf/nxlog.conf20210508-4684-bdgpzl.lock does not exist or is a dangling symbolic link (corrective) Notice: /Stage[main]/Nxlog::Service/Service[nxlog]: Dependency File[C:/Program Files (x86)/nxlog/conf/nxlog.conf ] has failures: true Warning: /Stage[main]/Nxlog::Service/Service[nxlog]: Skipping because of failed dependencies Warning: /Stage[main]/Nxlog/Anchor[nxlog::end]: Skipping because of failed dependencies

genebean commented 3 years ago

@AnonSS Does C:/Program Files (x86)/nxlog/conf/ exist currently on the system throwing the error?

AnonSS commented 3 years ago

@genebean no it does not currently reside. I have also created the folders manually and it throws other errors. However, the NXLog app did exist at some point but was unistalled in order to test this module.

genebean commented 3 years ago

Do you mind sharing exactly how you are calling the module so I can try and reproduce the problem?

AnonSS commented 3 years ago

Certainly. I am using the exact way the Readme suggests:

class {'nxlog':
  conf_dir       => 'C:/Program Files (x86)/nxlog/conf', # note the /'s here
  conf_file      => 'nxlog.conf',
  ensure_setting => latest,
  nxlog_root     => 'C:\Program Files (x86)\nxlog',
}
  nxlog::config::extension { 'gelf':
  ext_module => 'xm_gelf',
}

nxlog::config::input { 'eventlog_gelf':
  input_module => 'im_mseventlog',
}

nxlog::config::output { 'om_udp':
  output_file_path => 'C:\\Program Files (x86)\\nxlog\\data\\dataeventlog-gelf.txt',
  output_module    => 'om_file',
}

nxlog::config::output { 'logserver':
  output_address => '192.168.0.48',
  output_module  => 'om_udp',
  output_port    => '6514',
}

nxlog::config::route { 'local':
  route_destination => [ 'local_json', ],
  route_source      => [ 'eventlog_json', ],
}

nxlog::config::route { '1':
  route_destination => [ 'logserver', ],
  route_source      => [ 'eventlog_gelf', ],
}
AnonSS commented 3 years ago

I have gotten around the problem by adding this snippet to the top of the profile:

package { 'NXLog-CE':
    ensure => '2.10.2150',
    source => 'https://nxlog.co/system/files/products/files/348/nxlog-ce-2.10.2150.msi'
}

I can still use the mod to manage the config file. Thank you.

genebean commented 3 years ago

Sorry I missed your first reply! I’ll see if I can get this fixed as your fix indicates it wasn’t getting installed via Chocolatey like it should. I’m wondering if something has changed with either the upstream Chocolatey module or the package that it pulls down.