Debugging Errors on Azure DevOps

by | Aug 22, 2021 | Azure DevOps

Home » Azure DevOps » Debugging Errors on Azure DevOps

Preface – This post is part of the SAP on Azure series.

Introduction

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:

Errors on Azure DevOps

You can click the error above to read more or simply download the log and explore later, as shown below:

Download log in Azure Devops

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:

Enable Debugging in Azure DevOps

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

 

Pipeline queues but never gets an agent

 

Pipeline fails to complete

References

Troubleshoot common errors in Azure DevOps CLI

DevOps: Common mistakes and how to avoid them

Troubleshoot connecting to a project

Troubleshoot pipeline runs

Review logs to diagnose pipeline issues

Author

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Author