0

I am having some issues with the Puppet Agent on Windows.

After installation and sign the certificate for my Windows node, when running the puppet agent for the first time, I get this error:
Error: Failure to apply catalog: Parameter creates failed on Exec[create repo_dir]: creates must be a fully qualified path (file: /opt/puppetlabs/puppet/modules/pe_repo/manifests/init.pp, line: 61) when it was trying to cache the catalog.

While on the PE console, the node for my Windows agent can be seen but I am unable to commence a run puppet from there as well as it says that "Run Puppet has been disabled because Node Manager cannot connect to (the agent)."

Any advise? Thanks!

YongSiang
  • 1
  • 1
  • If you're running Puppet Enterprise then you should have access to Puppet, Inc.'s technical support. I advise you to contact them, because the area in which Puppet reports the problem does not appear to be one that is intended to be maintained by the end user. – John Bollinger May 23 '18 at 13:13
  • I suspect the true source of the problem is not in the pe_repo module but rather at the Windows node. In particular, it looks like the module does not recognize the node to be running Windows, which would likely indicate a problem with the facts the node is reporting. – John Bollinger May 23 '18 at 13:16
  • Thanks John! I am using the free 10 nodes Puppet Enterprise, so they suggested I post in the ask puppet community, but haven't got any answers on this yet. – YongSiang May 23 '18 at 13:56
  • Oh John, and I checked the PE console, for the facts for the windows node. It recognises that the `osfamily` is `windows`. – YongSiang May 24 '18 at 03:16

1 Answers1

0

Looks like an issue with creates parameter in Exec resource in the init.pp manifest. Follow these steps:-

1> Open init.pp manifest of pe_repo module
2> Look for creates parameter in exec resource
3> Set its value to a fully qualified file path
4> The file path is supposed to be created when the exec runs, in case it is already present, the exec won't run.

See this link for trouble-shooting your master slave connection problem.

Abhijeetk431
  • 847
  • 1
  • 8
  • 18
  • Hi thanks for replying. What would consider as a fully qualified path for Windows Server 2016? In the pe_repo, the stated path is `/opt/puppetlabs/server/data/packages` for `create repo_dir`. I think it might be some issues with the naming of the directory as compared to linux and windows? – YongSiang May 23 '18 at 09:48
  • I would do C:\ProgramData\PuppetLabs\server\data\packages but you can choose any accessible location for this... – Abhijeetk431 May 23 '18 at 10:15
  • Take Caution, There might be 2 paths, 1 for the location of the installation script on the server and another for the target location. You have to change the target location and not the location of the script on the master. – Abhijeetk431 May 23 '18 at 10:22
  • Alright! thanks! I'll try that tomorrow! Thanks Abhijeetk431! =) – YongSiang May 23 '18 at 13:55
  • Didn't work as well. I changed the path for `create_repo_dir` and `staging dir` and it resulted in a different error. `Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Missing title at index 1. The title expression resulted in an undef title (file: /opt/puppetlabs/puppet/modules/pe_repo/manifests/init.pp, line 82,column:10) on node (agent name)` – YongSiang May 24 '18 at 00:23
  • Looks like you have changed some things and now, the title of a resource(at line 82) is either undefined or not initialized at time of execution of the resource. – Abhijeetk431 May 24 '18 at 05:44
  • Hmm.. Yeah i changed, but then it's weird. I set up a personal VM for another Puppet Enterprise, and I compared the init.pp files. They are the same, just that the agent are different versions of OS: Windows Server 2016 and the other (mine) is Windows 10. – YongSiang May 24 '18 at 06:11
  • I experimented with changing some other fields in the init.pp, and managed to get the node being able to run on the PE console. However, it says that dependencies are missing and some files are skipped, returning an failure on the PE console too. – YongSiang May 24 '18 at 06:14
  • I am not able to understand what might be causing this... Can you mention the error that you are getting. – Abhijeetk431 May 24 '18 at 12:00
  • Hi, after doing some of the changes in the `init.pp`, the first error I get is that `Could not find command 'mkdir' /Stage[main]/Pe_repo/Exec[create repo_dir]/returns: change from 'not run' to ['0'] failed. Could not find command 'mkdir'` This happens for both [create repo_dir] and [create staging_dir]. Then I have multiple warnings about skipping due to failed dependencies (which I think are linked to the error above). – YongSiang May 25 '18 at 00:50
  • I added a line in the Master node, to notify (like Hello Puppet). And although the errors, the agent was able to apply the catalog and print out the notify statement. I still get "With failures" under the PE Console though.. – YongSiang May 25 '18 at 00:51
  • Can you please tell what is the full command where mkdir is used. mkdir works for windows as well as for linux, but switches are different and that might be a reason for this error. – Abhijeetk431 May 25 '18 at 07:02
  • In `/opt/puppetlabs/puppet/modules/pe_repo/manifest` I changed the line inside `exec { 'create repo_dir'` and `exec { 'create staging_dir'` `command =>` to `"mkdir ${repo_dir_windows}"` and `"mkdir ${root_staging_dir_windows}"` `$root_staging_dir = 'C:\ProgramData\PuppetLabs\server\data\staging'` `$repo_dir = 'C:\ProgramData\PuppetLabs\server\data\packages'` – YongSiang May 28 '18 at 01:54