Puppet agent error 500

Hi. when trying to execute a manifest to receive a file from the foreman server, an error occurs:

Error: could not retrieve catalog from remote server: Error 500 on server: Server Error: Evaluation Error: Error while evaluating a resource Statement: Evaluation Error: Error while evaluation a Function call, couls not find any files from /etc/puppetlabs/puppet/...... 

moreover, when executing manifests that do not require downloading files from the server to the client, everything works fine.

Expected outcome:

successful completion of tasks for file synchronization
Foreman and Proxy versions:
foreman 3.4.1
Foreman and Proxy plugin versions:

Distribution and version:

Other relevant data:

I forgot to tell you, this error happens almost instantly,

I solved the problem, it was with the rights to the files folder