3

I am using Jenkins 1.552 configured with email-ext 2.25 plugin. My job should send an email with a file attached after each successful build. For that i am using the email plugin and i add the path of the the file i want to send in the attachment field. The mail is sent successfully but the file is not attached and i have this specific error :

ERROR: Error accessing files to attach: remote file operation failed: /../hudson2/workspace/MY_JOB at hudson.remoting.Channel@host

What should be the cause of this access problem ?

PS : My job is running on a ssh slave.

HobbitOfShire
  • 2,144
  • 5
  • 24
  • 41
  • Does that directory exist on the slave ? It will be relative to the base directory that you set up in the slave configuration. If it exists, does the Jenkins user have read access to it ? – gareth_bowles Mar 18 '14 at 15:44

1 Answers1

2

you will get the error because email-ext plugin uses ant script for attachment so it will only work with relative address.make sure your files to get attached should be under workspace of your job.

attachment pattern should be :**/foldername/*.txt (sample)

philant
  • 34,748
  • 11
  • 69
  • 112
prudviraj
  • 3,634
  • 2
  • 16
  • 22
  • @philant thanks for fromating my answer hope this answer works – prudviraj Jun 27 '14 at 07:46
  • Email was triggered for: Success Sending email for trigger: Success ERROR: Error accessing files to attach: remote file operation failed: /Users/Jenkins/Desktop/DevOps_ios_build/workspace/DevOps_ios_build_new at hudson.remoting.Channel@4af3ea66:JNLP4-connect connection from 49.248.36.74/49.248.36.74:49254: java.io.IOException: Expecting Ant GLOB pattern, but saw '/Users/Jenkins/Desktop/DevOps_ios_build/workspace/DevOps_ios_build_new/build/IPA-PatientPortal/*.ipa'. See http://ant.apache.org/manual/Types/fileset.html for syntax Sending email to: ashish.karpe@compumatrice.comFinished: SUCCESS – Ashish Karpe Nov 13 '17 at 13:59
  • I have given Path : ${WORKSPACE}/build/IPA-PatientPortal/*.ipa – Ashish Karpe Nov 13 '17 at 14:00
  • sorry it's : build/IPA-PatientPortal/*.ipa – Ashish Karpe Nov 13 '17 at 14:11
  • note : In my case jenkins master is ubuntu (aws ec2 instance) and slave is Mac laptop – Ashish Karpe Nov 13 '17 at 14:15
  • Is this issue from from Mac Laptop ie Jenkins slave ? Is there some configuration required to send mail (ipa attachment) from Jenkins slave as I have send mail manually from slave it's sending successfully – Ashish Karpe Nov 14 '17 at 07:07
  • Files in your workspace will be placed in the machine it was built, in this it might be your slave – prudviraj Nov 16 '17 at 09:41