Determine / set Puppet environment

Try puppet agent --configprint environment - that'll make sure it's using the [agent] block in the config file, which will also be used when the agent is getting a catalog from a master.