Preface – This post is part of the SAP on Azure series.
Table of Contents
Azure DevOps is a powerful version management tool. Its CI/CD pipeline keeps the work in flow without interruption. But sometimes, even Azure DevOps ends with errors. These error can be categorized as follows:
- Build Definition based errors: It means the error is in the Pipeline build.
- Release Definition based errors: It means the error is in pipeline release.
- Build Artifacts based errors (Error in code): It means the error is in the code. Sometimes the code is converted successfully into build artifacts (or drop files), but generates error during deployment.
- Deployment environment generated errors: It means the error is generated by external deployment environment. The error may be in pipeline configuration or the build code.
Debugging and Troubleshooting Errors on Azure DevOps
All the debugging and troubleshooting Errors on Azure DevOps starts from log. Once the deployment fails, you can see error directly in the console as shown below:
You can click the error above to read more or simply download the log and explore later, as shown below:
You can further turn debugging mode on, and run pipeline again, and then download logs for debugging. To turn the debugging mode on, you need to enable system diagnostics as shown below:
In case something went wrong, then the environment too returns log for analysis. For example, in case deployments in SAP Environment fails, they give cloud foundry commands to download the logs, something like this:
-> cf deploy -i f450e444-8632-11ea-abb3-eeee0a8f6ba7 -a monitor Updating application "uiDeployer"... Application "uiDeployer" attributes are not modified and will not be updated Uploading application "uiDeployer"... Content of application "uiDeployer" is not changed - upload will be skipped. Starting application "uiDeployer"... Application "uiDeployer" started Application "uiDeployer" executed Stopping application "uiDeployer"... Deleting discontinued configuration entries for application "uiDeployer"... Service key "onboarding-workflow-credentials" for service "workflow" already exists Uploading content module "onboarding" in target service "workflow"... Deploying content module "onboarding" in target service "workflow"... Skipping deletion of services, because the command line option "--delete-services" is not specified. Process finished. Use "cf dmol -i f450e444-8632-11ea-abb3-eeee0a8f6ba7" to download the logs of the process.
Then, you can use terminal/command prompt to download the logs using the command as mentioned above. This will only work, once you login into their environment using the CLI.
Now, you have successfully downloaded the log and you need to identify the issue so that you can troubleshoot, you can follow below steps to do the same:
- Download the log
- Identify the type of error, as discussed in the introduction
- In case it is a pipeline error, check where exactly it failed. If it failed during build extract, you can simply try redeployment. If security files or YAML has issues, then you need to Google and identify the fix of the same. If the pipeline itself has error like “Deployment YAML file is not found”, then again you need to check if you are providing the right configuration in the YAML or Release pipeline or not
- In case it is an error related to the code, then identify if it is a part of Frontend, Backend or Database, then accordingly assign the bug to respective developer
- In case it is an error related to the environment, then check if the environment configuration is correct or not, download the log provided by the environment to identify the root cause. In case, you are still unable to fix environment based error, then raise a ticket to respective Admin team
Common Errors on Azure DevOps
Pipeline won’t trigger
- UI settings override YAML trigger setting
- Pull request triggers not supported with Azure Repos
- Branch filters misconfigured in CI and PR triggers
- Scheduled trigger time zone conversions
- UI settings override YAML scheduled triggers
Pipeline queues but never gets an agent
- Parallel job limits – no available agents or you have hit your free limits
- Can’t access Azure Key Vault behind firewall from Azure DevOps
- You don’t have enough concurrency
- Your job may be waiting for approval
- All available agents are in use
- Demands that don’t match the capabilities of an agent
- Check Azure DevOps status for a service degradation
Pipeline fails to complete
- Job time-out
- Issues downloading code
- My pipeline is failing on a command-line step such as MSBUILD
- File or folder in use errors
- Intermittent or inconsistent MSBuild failures
- Process stops responding
- Line endings for multiple platforms
- Variables having ‘ (single quote) appended
- Service Connection related issues