microsoft / azure-devops-engineering-extensions

AzureDevOps marketplace extension that contains various engineering oriented Pipeline tasks
MIT License
19 stars 19 forks source link

File not found Issue and attach a file #49

Open seetuaccn opened 3 years ago

seetuaccn commented 3 years ago

Hi,

I added email report extension recently but I'm getting "File not found: '/home/vsts/work/_tasks/EmailReport_36fd41b1-8024-4ce9-a5a0-53c3e54ed105/1.1.8/Index.js'" error. Can you please help me here. Also, can you please let me know if I can attach any file with email notification with the same extensions. I'm getting default notification when my job gets failed/success so; do I need to setup smtp also to use this email extensions. Details screen shot is here -

============================================================================== Task : Email Report Description : Send rich email report for test results and for tasks in this stage Version : 1.1.8 Author : Microsoft Corporation Help : Sets 'EmailReportTask.EmailSent' variable to true if it sent email successfully. Learn More

[error]File not found: '/home/vsts/work/_tasks/EmailReport_36fd41b1-8024-4ce9-a5a0-53c3e54ed105/1.1.8/Index.js'

Finishing: EmailReport

fpaterour commented 3 years ago

Hi,

I added email report extension recently but I'm getting "File not found: '/home/vsts/work/_tasks/EmailReport_36fd41b1-8024-4ce9-a5a0-53c3e54ed105/1.1.8/Index.js'" error. Can you please help me here. Also, can you please let me know if I can attach any file with email notification with the same extensions. I'm getting default notification when my job gets failed/success so; do I need to setup smtp also to use this email extensions.

Hi,

I had the same error using a job running on an ubuntu-20.04 agent. It worked when using a windows-2019 agent.

I figured out that the task was searching for a file named Index.js and that one named index.js was present in the directory. This is probably due to how windows and linux deal with case. Windows is case insensitive when it comes to file names whereas linux is case sensitive so on linux the task couldn't find the correct file.

Mithras commented 3 years ago

I'm having the same issue. Using windows agent is not an option for me.

Mithras commented 3 years ago

Dirty workaround I came up with: Just add this Bash task before EmailReport task

  - bash: |
      cd /mnt/vss/_work/_tasks/EmailReport_36fd41b1-8024-4ce9-a5a0-53c3e54ed105/1.1.8
      cp ./index.js ./Index.js
      sed -i -e "s~\\\\\\\\~/~" ./htmlreport/HTMLReportCreator.js
      sed -i -e "s~\\\\\\\\~/~" ./model/helpers/LinkHelper.js
    displayName: EmailReport fix
    continueOnError: true

(you might need to fix cd <path> to match your EmailReport version)

calrom-jtejero commented 3 years ago

hi @Mithras seems you and me found and solved the same issue with the file.

my PR is here #51 but seems the repo owners are not reviewing this repo for a long time.

calrom-jtejero commented 3 years ago

cannot be bothered to wait for Microsoft to fix this one, I am using now my own extension: https://marketplace.visualstudio.com/items?itemName=calrom-jtejero.CalromEmailReportExtension

the code is in my fork: https://github.com/calrom-jtejero/azure-devops-engineering-extensions