Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting
Using Azure Pipelines, Team Project Name = MyPatientList, build definition = MyPatientList-CI, Build number: 31
Azure Pipelines:
Copy files task in Azure DevOps Pipelines produces an error when building cordova ios app. The build succeeds and when I check the sources directory I can locate the file but Copy Files task alwats fails to find the file. I am using a self hosted agent with system.debug variable set to true but cannot get any useful information from the log:
I have the following task configurations:
Source Folder:
$(Build.SourcesDirectory)
Contents:
*/.ipa
Target Folder:
$(Build.ArtifactStagingDirectory)
Output:
Unhandled: Failed find: ENOENT: no such file or directory, stat '/Users/ahmadkhudeish/build_agents/agent1/_work/1/s/platforms/ios/build/device/Patient List UAT.app'
What am I doing wrong here?
Any help appreciated, thanks
2018-12-11T05:08:50.6847750Z ##[debug] /Users/ahmadkhudeish/build_agents/agent1/_work/1/s/platforms/ios/PatientListUAT.xcarchive/dSYMs (directory)
2018-12-11T05:08:50.6847880Z ##[debug] /Users/ahmadkhudeish/build_agents/agent1/_work/1/s/platforms/ios/PatientListUAT.xcodeproj (directory)
2018-12-11T05:08:50.6848000Z ##[debug] /Users/ahmadkhudeish/build_agents/agent1/_work/1/s/platforms/ios/PatientListUAT.xcodeproj/project.pbxproj (file)
2018-12-11T05:08:50.6848120Z ##[debug] /Users/ahmadkhudeish/build_agents/agent1/_work/1/s/platforms/ios/PatientListUAT.xcworkspace (directory)
2018-12-11T05:08:50.6848240Z ##[debug] /Users/ahmadkhudeish/build_agents/agent1/_work/1/s/platforms/ios/PatientListUAT.xcworkspace/contents.xcworkspacedata (file)
2018-12-11T05:08:50.6848380Z ##[debug] /Users/ahmadkhudeish/build_agents/agent1/_work/1/s/platforms/ios/PatientListUAT.xcworkspace/xcshareddata (directory)
2018-12-11T05:08:50.6848510Z ##[debug] /Users/ahmadkhudeish/build_agents/agent1/_work/1/s/platforms/ios/PatientListUAT.xcworkspace/xcshareddata/xcschemes (directory)
2018-12-11T05:08:50.6848650Z ##[debug] /Users/ahmadkhudeish/build_agents/agent1/_work/1/s/platforms/ios/PatientListUAT.xcworkspace/xcshareddata/xcschemes/PatientListUAT.xcscheme (file)
2018-12-11T05:08:50.6848760Z ##[debug] /Users/ahmadkhudeish/build_agents/agent1/_work/1/s/platforms/ios/build (directory)
2018-12-11T05:08:50.6848880Z ##[debug] /Users/ahmadkhudeish/build_agents/agent1/_work/1/s/platforms/ios/build/device (directory)
2018-12-11T05:08:50.6848990Z ##[debug] /Users/ahmadkhudeish/build_agents/agent1/_work/1/s/platforms/ios/build/device/DistributionSummary.plist (file)
2018-12-11T05:08:50.6849110Z ##[debug] /Users/ahmadkhudeish/build_agents/agent1/_work/1/s/platforms/ios/build/device/ExportOptions.plist (file)
2018-12-11T05:08:50.6850000Z ##[debug] /Users/ahmadkhudeish/build_agents/agent1/_work/1/s/platforms/ios/build/device/Packaging.log (file)
2018-12-11T05:08:50.6850190Z ##[debug]task result: Failed
2018-12-11T05:08:50.6913670Z ##[error]Unhandled: Failed find: ENOENT: no such file or directory, stat '/Users/ahmadkhudeish/build_agents/agent1/_work/1/s/platforms/ios/build/device/PatientListUAT.app'
2018-12-11T05:08:50.6929720Z ##[debug]Processed: ##vso[task.issue type=error;]Unhandled: Failed find: ENOENT: no such file or directory, stat '/Users/ahmadkhudeish/build_agents/agent1/_work/1/s/platforms/ios/build/device/PatientListUAT.app'
2018-12-11T05:08:50.6953310Z ##[debug]Processed: ##vso[task.complete result=Failed;]Unhandled: Failed find: ENOENT: no such file or directory, stat '/Users/ahmadkhudeish/build_agents/agent1/_work/1/s/platforms/ios/build/device/PatientListUAT.app'
2018-12-11T05:08:50.6955180Z ##[section]Finishing: Copy Files to: $(Build.ArtifactStagingDirectory)
[Insert error from the logs here for a quick overview]
I have gotten around this issue by using a simple bash script to copy the file instead, I think the Copy Files task provided by Azure Pipelines is buggy.
I can confirm this issue when using Cordova builds on DevOps.
The solution is to insert a small bash script to remove the link (AppName).app in the output directory of the binaries before the "Copy Files" step.
The link is pointing to some directory which was created and deleted during the build.
Added a PR to address this.
@damccorm thanks for looking into this! We are running into this issue as well. Our work around was to delete the symlink files before calling CopyFiles.
Hey all, sorry for the delay on this. This should be fixed by https://github.com/microsoft/azure-pipelines-tasks/pull/9390 which should start rolling out next week
Hey all, sorry for the delay on this. This should be fixed by #9390 which should start rolling out next week
I'm still waiting for this fix. I can't find a workaround yet and I thought you'd have had the issue fixed and deployed already.
@ysodiqakanni could you share your logs from the failing build?
I think this should've been fixed, so I'm surprised to hear you're still encountering the issue
I still experience this issue.
Is it fixed yet?
@Tofalvy could you share your logs from the failing build?
I think this should've been fixed, so I'm surprised to hear you're still encountering the issue
Still affecting me. Here is my log:
2020-05-19T17:21:30.7421200Z ##[section]Starting: Copy Files to: /Users/runner/runners/2.168.2/work/1/a
2020-05-19T17:21:30.7431720Z ==============================================================================
2020-05-19T17:21:30.7432130Z Task : Copy files
2020-05-19T17:21:30.7432590Z Description : Copy files from a source folder to a target folder using patterns matching file paths (not folder paths)
2020-05-19T17:21:30.7433030Z Version : 2.164.0
2020-05-19T17:21:30.7433330Z Author : Microsoft Corporation
2020-05-19T17:21:30.7433800Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/copy-files
2020-05-19T17:21:30.7434450Z ==============================================================================
2020-05-19T17:21:30.9277700Z ##[error]Unhandled: Failed find: ENOENT: no such file or directory, stat '/Users/runner/runners/2.168.2/work/1/s/platforms/ios/build/device/[redacted].app'
2020-05-19T17:21:30.9303370Z ##[section]Finishing: Copy Files to: /Users/runner/runners/2.168.2/work/1/a
I can also confirm that manually deleting the *.app file/folder solves the problem.
I've also just run into this when running script tasks, npm ci (to install everything for build) and then npm ci --only=production
A delete task in between these removing node_modules solves the issue (even though npm ci should be removing it entirely anyway)
Also having this issue
Hosted
Agent: macOS-latest
Organization: dalgs
Project: Digital Workplace
Pipeline/Build#: winteropstoolkit-mobile/20200801.13
Starting: Copy build output to artifact staging
==============================================================================
Task : Copy files
Description : Copy files from a source folder to a target folder using patterns matching file paths (not folder paths)
Version : 2.164.2
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/copy-files
==============================================================================
##[error]Unhandled: Failed find: ENOENT: no such file or directory, stat '/Users/runner/work/1/s/platforms/ios/build/device/Winter Ops Mobile Toolkit.app'
Finishing: Copy build output to artifact staging
Also seeing this as well.
Hosted
Agent: Ubuntu and windows-latest
```
Finishing: Copy license and NuGet config
````
Same here.
Hosted, ubuntu-latest
- task: CopyFiles@2
displayName: Copy zip to staging area
inputs:
contents: 'build/**/**/*.zip'
targetFolder: '$(Build.ArtifactStagingDirectory)'
cleanTargetFolder: true
flattenFolders: true
And I get ##[error]Unhandled: Failed find: ENOENT: no such file or directory, stat '/home/vsts/work/1/s/node_modules/.bin/detect-libc'
I am also facing this issue .
Starting: CopyFiles
==============================================================================
Task : Copy files
Description : Copy files from a source folder to a target folder using patterns matching file paths (not folder paths)
Version : 2.164.2
Author : Microsoft Corporation
==============================================================================
##[error]Unhandled: Not found SourceFolder: /home/vsts/work/1/s/$(System.DefaultWorkingDirectry)
Hi everyone, we prepared a fix for this issue
@sarthak-sriw hmm, your issue looks different - looks like there's just a typo in the variable name 'System.DefaultWorkingDirectry' - should be 'System.DefaultWorkingDirectory', so it hasn't been replaced by variable value
I am still facing the issue: ##[error]Unhandled: Failed find: ENOENT: no such file or directory, stat '/Users/runner/work/1/s/platforms/ios/build/device/AppName.app'
steps:
- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
SourceFolder: '$(system.defaultworkingdirectory)/platforms/ios/build/device'
Contents: AppName.ipa
TargetFolder: '$(build.artifactstagingdirectory)'
@sergiuturus we prepared a fix for this issue but it will take some time (about 3 weeks) to roll it out - I'm going to remove 'awaiting deployment' label once it's rolled out
I think so. ls $(system.defaultworkingdirectory)/platforms/ios/build/device shows a list of files, including AppName.ipa
Is there any workaround for this issue?
@sergiuturus as a workaround at the moment - you can just set the path to ipa file more specifically - so it won't contain broken symlinks
Hi @ahmadkhudeish @sergiuturus we have rolled out the fix for this issue - I'm closing it at the moment, please feel free to reopen or let us know if this issue still actual for you.
Most helpful comment
Added a PR to address this.