How to configuring Puppetrun with Foreman 1.16 + Puppet 5

I have an environment with the following characteristics:
Foreman Server/ Puppet Master Server:
CentOS 7;
The Foreman 1.16
Puppet 5.x.
Puppet node:
Puppet 5.x.

I was able to enable the PuppetRUN, changing the flag “:puppetrun: false” to “:puppetrun: true” in the file

/etc/foreman/settings.yaml, but, when i am trying run puppetrun in GUI, the following message appears in the browser: … puppetrun: ERF12-4252 [ProxyAPI::ProxyException]….

The log /var/log/foreman-proxy/proxy.log:

W, [2018-02-23T19:41:30.453451 40759f1b] WARN – : Non-null exit code when executing ‘["/usr/bin/sudo", “-u”, “root”, “/opt/puppetlabs/bin/mco”, “puppet”, “runonce”, “-I”, “”]’

How can we configure PuppetRUN with puppet 5?

Thank you.

Try enabling debug-level logging, it might show more details. Also check puppet logs. I would also suggest trying to run the command shown in the log manually and see what it returns.