Weird ec2_elb_facts error

I’m running into a very odd problem with an ansible playbook that I’m running from Jenkins. The playbook executes the ec2_elb_facts module (without the names parameter). When it runs from my jenkins pipeline job, I get the following error:

TypeError: argument of type 'NoneType' is not iterable

The exact same playbook command (ie. copied and pasted from the jenkinsfile script) on the command line of the same jenkins server, and it worked fine.

Has anyone else experienced this issue? Any idea what the problem might be?

Thanks,
Guy

Whats the full trace?