This issue can arise because there are illegal characters ( \ / : * ? ” < > | ) in the session name for which you are generating. The issue can also occur if there is a problem with the template.
Rename the session removing any illegal characters. Also run the ‘Verify Template’ routine on the template (in Add-ins) and correct any invalid tags