After upgrading the packages on my puppet master server with puppetdb I was getting this error when running the agent:
May 23 19:15:45 test puppet-agent: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to submit 'replace facts' command for test.server.com to PuppetDB at puppet.server.com:8081: [400 Bad Request] Missing required query parameter 'payload'
During the package upgrade puppetdb was restarted, but the restart didn’t work (a new process was started but the port was already in use).
To fix this, kill the puppetdb process and then start it again, it looks like this in the processlist:
puppetdb 3931 1.0 6.9 821672 281912 ? Sl May23 3:08 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -XX:OnOutOfMemoryError=kill -9 %p -Xmx192m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/puppetdb/puppetdb-oom.hprof -Djava.security.egd=file:/dev/urandom -cp /usr/share/puppetdb/puppetdb.jar clojure.main -m com.puppetlabs.puppetdb.core services -c /etc/puppetdb/conf.d
Once running, run the agent and it should be fine.