Execution of '/etc/puppetlabs/puppet/node.rb web3.example.org' returned 1; vardir /opt/puppetlabs/server/data/puppetserver doesn't show host data

Have a look here, it’s not a fix but it does shed some light on the situation: Error 500 Unable to fetch my node definition
I did what this person did, copy an existing node’s .yaml and name it according to the new node you are trying to add. You can then do a successful ‘puppet agent -t’ from the new node.

cp /opt/puppetlabs/server/data/puppetserver/yaml/foreman/existing.node.yaml /opt/puppetlabs/server/data/puppetserver/yaml/foreman/new.node.yaml

Whether or not that gives the wrong facts to the new node or not, I am unsure. I tried creating a blank.yaml and that didn’t work.

I also tried copying the new.node.yaml from /opt/puppetlabs/server/data/puppetserver/yaml/facts to /opt/puppetlabs/server/data/puppetserver/yaml/foreman/ but for whatever reason that resulted in error, also.