DevOps Error Troubleshooting Guide

Troubleshoot common DevOps errors effortlessly. Get clear causes and step-by-step solutions for Git, Docker, Kubernetes, Jenkins, AWS, and Terraform

BLZR

CodeResource

DevOps

2842 Words [Mind Tax: 12:55m]

08 September 2026, 6:30:00 PM


1. Git Errors

fatal: not a git repository (or any of the parent directories): .git

Cause: The command is executed outside a Git repository or the repository is corrupted.

Solution:

  1. Verify you’re in the correct directory: pwd.
  2. Navigate to the repository: cd <repository-path>.
  3. If missing, reinitialize the repository: git init.

error: failed to push some refs

Cause: Local branch is out of sync with the remote branch.

Solution:

  1. Pull latest changes with rebase: git pull --rebase origin <branch>.
  2. Resolve conflicts if prompted, then commit and push.

Permission denied (publickey)

Cause: SSH key is missing or not recognized by the remote repository.

Solution:

  1. Generate a key pair: ssh-keygen -t rsa -b 4096.
  2. Add the private key to the agent: ssh-add ~/.ssh/id_rsa.
  3. Add the public key to the repository settings.

Merge conflict in [file]

Cause: Simultaneous changes to the same part of a file.

Solution:

  1. Open the conflicting file to resolve changes.
  2. Use markers like «««< and »»»> to identify conflicts.
  3. After resolution, commit: git add <file> && git commit.

Detached HEAD state

Cause: A specific commit is checked out instead of a branch.

Solution:

  1. Create a branch from the detached state: git checkout -b <new-branch>.
  2. Continue working or merge with another branch.

fatal: remote origin already exists

Cause: Adding a remote repository that already exists.

Solution:

  1. Update the existing remote: git remote set-url origin <new-URL>.

Large file exceeds limit

Cause: Attempt to push a file exceeding the repository limit (e.g., GitHub’s 100MB limit).

Solution:

  1. Use Git Large File Storage (LFS): git Ifs track "<file-pattern>".

Submodule update failed

Cause: Incorrect or inaccessible submodule configuration.

Solution:

  1. Update submodules: git submodule update --init --recursive.

fatal: cannot lock ref

Cause: A .lock file is preventing operations due to an interrupted process.

Solution:

  1. Remove the lock file: rm -f .git/index.lock.

Untracked files prevent switching branches

Cause: Untracked changes conflict with the branch switch.

Solution:

  1. Stash changes: git stash.
  2. Switch branches: git checkout <branch>.

2. Jenkins Errors

Jenkins service not starting

Cause: Corrupted configuration or missing Java installation.

Solution:

  1. Check logs: sudo journalctl -u jenkins.
  2. Verify Java installation: java -version.

Build stuck in the queue

Cause: No available executors or agents.

Solution:

  1. Ensure the Jenkins agent is running and connected.
  2. Increase executor count under “Manage Jenkins.”

Plugins fail to load

Cause: Outdated Jenkins version or missing dependencies.

Solution:

  1. Update Jenkins to the latest version.
  2. Reinstall failing plugins.

Pipeline script syntax error

Cause: Incorrect Groovy syntax.

Solution:

  1. Validate the script using the pipeline syntax generator.
  2. Debug syntax errors with Jenkins logs.

Build fails due to missing environment variables

Cause: Environment variables not set in the job configuration.

Solution:

  1. Define variables in “Build Environment” or as parameters.
  2. Use env.VARIABLE_NAME in the pipeline script.

Unauthorized webhook trigger

Cause: Incorrect webhook configuration or missing credentials.

Solution:

  1. Verify the webhook URL in the source control settings.
  2. Add proper credentials in Jenkins.

Job not found after restart

Cause: Corrupted job configurations.

Solution:

  1. Check for backups in /var/lib/jenkins/jobs.
  2. Recreate the job manually if backups are unavailable.

Out of disk space

Cause: Jenkins workspace consumes too much space.

Solution:

  1. Clean old builds: Manage Jenkins > Workspace Cleanup Plugin.
  2. Automate workspace cleanup post-build.

Build artifacts not archiving

Cause: Incorrect artifact path configuration.

Solution:

  1. Ensure correct file paths in “Archive the artifacts” step.

Node disconnected unexpectedly

Cause: Network or agent-side issues.

Solution:

  1. Verify agent logs and network connectivity.

3. Docker Errors

Cannot connect to the Docker daemon

Cause: Docker service is not running or user lacks permissions.

Solution:

  1. Start the Docker service: sudo systemctl start docker.
  2. Add the user to the Docker group: sudo usermod -aG docker $USER.

Port is already in use

Cause: Another process is bound to the same port.

Solution:

  1. Stop the conflicting container: docker stop <container-id>.
  2. Change the container’s port mapping.

No space left on device

Cause: Disk space is exhausted by Docker images and containers.

Solution:

  1. Remove unused resources: docker system prune -a.

ImagePullBackOff in Kubernetes

Cause: Invalid image tag or registry issues.

Solution:

  1. Verify the image name and registry credentials.

Permission denied on bind mount

Cause: Host directory permissions are restrictive.

Solution:

  1. Update directory permissions: chmod 777 <directory>.

4. Kubernetes Errors

ImagePullBackOff

Cause: The Kubernetes node cannot pull the specified container image due to an invalid image name, tag, or lack of access.

Solution:

  1. Verify the image name and tag.
  2. If the image is private, check the ImagePullSecret or use kubectl create secret.

CrashLoopBackOff

Cause: The container crashes repeatedly, often due to application-level errors.

Solution:

  1. Check container logs using kubectl logs <pod-name>.
  2. Fix the underlying issue causing the crash.

Node Not Ready

Cause: A Kubernetes node is unhealthy or cannot join the cluster.

Solution:

  1. Use kubectl get nodes to check node status.
  2. Restart the kubelet service and verify resource availability.

PersistentVolumeClaim Pending

Cause: No PersistentVolume matches the claim’s requirements.

Solution:

  1. Check storage class and create a matching PersistentVolume.

Pod is stuck in Pending state

Cause: Insufficient resources or unschedulable conditions.

Solution:

  1. Check node capacity: kubectl describe pod <pod-name>.
  2. Scale up resources or adjust pod resource requests.

RBAC: Access Denied

Cause: Role-based access control prevents the action.

Solution:

  1. Grant proper permissions using Role/ClusterRole and RoleBinding.

Service Unreachable

Cause: Service or ingress misconfiguration.

Solution:

  1. Verify Service type, selectors, and target port.
  2. Check the ingress rules if applicable.

Resource Quota Exceeded

Cause: The namespace has hit resource limits.

Solution:

  1. Increase the resource quota or optimize usage.

Evicted Pods

Cause: Nodes lack sufficient resources.

Solution:

  1. Check events with kubectl describe pod.
  2. Add resources or reschedule workloads.

Deployment Rollout Fails

Cause: Health checks fail for new pods.

Solution:

  1. Check logs and events of failed pods.
  2. Roll back using kubectl rollout undo.

5. Ansible Errors

Host unreachable

Cause: SSH connection fails.

Solution:

  1. Verify SSH keys and access.
  2. Ensure the inventory file has the correct IP addresses.

Syntax error in playbook

Cause: Incorrect YAML formatting.

Solution:

  1. Validate YAML with a linter or ansible-playbook --syntax-check.

Undefined variable

Cause: Variable is not defined in the playbook or inventory.

Solution:

  1. Define the variable in vars, group_vars, or the inventory file.

Command not found on target node

Cause: Required packages are missing.

Solution:

  1. Install missing packages using a task in the playbook.

Permission denied

Cause: User lacks required permissions on the target machine.

Solution:

  1. Use become: true in the playbook to execute as a superuser.

Module not found

Cause: The Ansible module is not installed.

Solution:

  1. Ensure Ansible and its dependencies are up-to-date.

Failed to find group_vars

Cause: Incorrect directory structure.

Solution:

  1. Place group_vars and host_vars in the same directory as the inventory file.

Playbook runs indefinitely

Cause: Task stuck in a loop or waiting for an unavailable service.

Solution:

  1. Add timeout options and validate tasks.

Handler not triggered

Cause: No task notifies the handler.

Solution:

  1. Add notify: <handler-name> to the appropriate task.

Dynamic inventory script failure

Cause: Errors in the inventory script.

Solution:

  1. Debug the script manually or use --list to validate.

6. Terraform Errors

Provider plugin not found

Cause: Missing or outdated provider plugin.

Solution:

  1. Run terraform init to download required plugins.

State file lock error

Cause: Concurrent Terraform runs.

Solution:

  1. Unlock the state file: terraform force-unlock <lock-id>.

Error acquiring the state lock

Cause: Network issues when using remote state.

Solution:

  1. Retry after ensuring stable connectivity.

Resource already exists

Cause: Attempting to create a resource that already exists.

Solution:

  1. Use terraform import to manage existing resources.

Plan does not match changes

Cause: Drift in the state file.

Solution:

  1. Refresh state: terraform refresh.

Invalid index in Terraform output

Cause: Incorrect usage of lists or maps.

Solution:

  1. Validate variable types and indices.

Module not found

Cause: Incorrect module path.

Solution:

  1. Ensure module paths are correct and run terraform get.

Authentication failure

Cause: Missing or invalid credentials.

Solution:

  1. Set proper environment variables or credentials files.

Timeout waiting for resource

Cause: Resource creation takes too long.

Solution:

  1. Increase timeout settings in the resource block.

Remote backend configuration error

Cause: Incorrect backend configuration.

Solution:

  1. Check and fix the backend block in the Terraform configuration.

7. Prometheus Errors

No targets found

Cause: Prometheus is not configured to scrape any endpoints.

Solution:

  1. Check prometheus.yml for scrape configurations.
  2. Ensure that target endpoints are reachable.

Prometheus not scraping data

Cause: Target endpoints are misconfigured or not reachable.

Solution:

  1. Verify the status of targets in the Prometheus Ul under Status > Targets.
  2. Fix any endpoint issues or configurations.

High cardinality in metrics

Cause: Too many unique label combinations in metrics.

Solution:

  1. Optimize label usage in your metric definitions.
  2. Use relabeling rules to filter out unnecessary labels.

Prometheus service not starting

Cause: Misconfiguration in prometheus.yml or insufficient resources.

Solution:

  1. Validate the configuration file: promtool check config prometheus.yml.
  2. Check system resources and allocate more CPU/memory if needed.

Query taking too long

Cause: Large datasets or inefficient queries.

Solution:

  1. Optimize your PromQL queries by limiting time ranges or labels.
  2. Enable query caching for better performance.

Prometheus out of storage space

Cause: Retention period or data volume exceeds available disk space.

Solution:

  1. Reduce the data retention period: storage.tsdb.retention.time=<duration>.
  2. Add more storage or clean old data manually.

Prometheus alert not firing

Cause: Misconfigured alert rules.

Solution:

  1. Validate alert rules using promtool check rules.
  2. Ensure the alert expression is correct and matches expected data.

Prometheus crash due to OOM (Out of Memory)

Cause: Too many metrics or insufficient memory allocation.

Solution:

  1. Increase memory allocation to the Prometheus server.
  2. Reduce the number of metrics being scraped by filtering them.

Scraped data is incomplete

Cause: Targets are partially down or network issues.

Solution:

  1. Check the health of scrape targets.
  2. Monitor network connections between Prometheus and endpoints.

Failed to reload configuration

Cause: Syntax errors in prometheus.yml.

Solution:

  1. Validate the configuration file with promtool.
  2. Fix any syntax issues before reloading.

8. ELK Stack Errors (Elasticsearch, Logstash, and Kibana)

Elasticsearch: Cluster health is red

Cause: Some nodes or shards are unavailable.

Solution:

  1. Check node status: curl -X GET <ES_HOST>/_cat/nodes.
  2. Reallocate shards: POST_cluster/reroute.

Elasticsearch: Java heap space error

Cause: Insufficient heap memory for Elasticsearch.

Solution:

  1. Increase heap size in jvm.options.
  2. Use Xms and Xmx values not exceeding 50% of available memory.

Logstash: Pipeline aborted due to error

Cause: Syntax error or incorrect configuration in logstash.conf.

Solution:

  1. Validate the configuration: logstash -t -f logstash.conf.
  2. Fix the error based on logs.

Logstash: Connection refused to Elasticsearch

Cause: Incorrect Elasticsearch endpoint in Logstash configuration.

Solution:

  1. Update output { elasticsearch { hosts => ["<ES_HOST>"] }}.

Kibana: Kibana server is not ready yet

Cause: Elasticsearch cluster is not reachable.

Solution:

  1. Verify Elasticsearch connectivity.
  2. Restart Kibana after Elasticsearch is ready.

Index pattern not found in Kibana

Cause: No matching indices in Elasticsearch.

Solution:

  1. Ensure data is being sent to Elasticsearch.
  2. Recreate the index pattern in Kibana.

Logstash not processing logs

Cause: Input or filter misconfiguration.

Solution:

  1. Check input sources and logs for issues.
  2. Validate filters with small datasets.

Elasticsearch: Index not found

Cause: Querying an index that doesn’t exist.

Solution:

  1. Check available indices: curl -X GET <ES_HOST>/_cat/indices.

Kibana: Dashboard is empty

Cause: Missing or misconfigured visualizations.

Solution:

  1. Verify data sources for visualizations.
  2. Check time filters on the dashboard.

Logstash: Filebeat logs not received

Cause: Incorrect Filebeat-to-Logstash configuration.

Solution:

  1. Check Filebeat output.logstash configuration.
  2. Ensure the correct port and protocol.

9. AWS DevOps Tools Errors

EC2: Instance not reachable

Cause: Incorrect security group or network ACL configuration.

Solution:

  1. Verify inbound rules for SSH/HTTP access.
  2. Check VPC and subnet configuration.

S3: Access Denied

Cause: Missing permissions for the S3 bucket.

Solution:

  1. Update bucket policies to allow access.
  2. Attach proper IAM roles or policies.

CodePipeline: Failed to deploy

Cause: Deployment stage error.

Solution:

  1. Check deployment logs for details.
  2. Verify IAM permissions for CodePipeline and CodeDeploy.

RDS: Cannot connect to the database

Cause: Firewall or networking issues.

Solution:

  1. Add the correct inbound rules to the RDS security group.
  2. Check database credentials.

CloudFormation: Stack creation failed

Cause: Misconfigured templates or resource dependencies.

Solution:

  1. Review the stack events for specific errors.
  2. Validate the template: aws cloudformation validate-template.

IAM: Policy not authorized

Cause: Insufficient permissions in the policy.

Solution:

  1. Modify the policy to include the required actions.

ECS: Task failed to start

Cause: Resource limitations or misconfigured task definitions.

Solution:

  1. Check task logs in CloudWatch.
  2. Ensure sufficient memory and CPU allocation.

Lambda: Execution failed

Cause: Errors in the Lambda function code.

Solution:

  1. Review CloudWatch logs for detailed errors.
  2. Update the function code to fix issues.

Route 53: DNS record not resolving

Cause: Incorrect record type or misconfigured TTL.

Solution:

  1. Verify DNS records in the Route 53 console.
  2. Check domain delegation settings.

CloudWatch: Metrics not visible

Cause: Missing or misconfigured monitoring agents.

Solution:

  1. Ensure the CloudWatch agent is running.
  2. Verify configuration files.

10. Azure DevOps Tools Errors

Pipelines: Build agent unavailable

Cause: The agent is offline or misconfigured.

Solution:

  1. Restart the agent service.
  2. Verify agent registration in Azure DevOps.

Resource group deployment failed

Cause: Incorrect ARM template.

Solution:

  1. Validate the ARM template before deployment.

Release failed in Azure DevOps

Cause: Deployment script errors.

Solution:

  1. Check logs for failed tasks.
  2. Fix script errors and re-run.

Repos: Merge conflict during pull request

Cause: Simultaneous changes to the same files.

Solution:

  1. Resolve conflicts using the web editor or locally.

Pipeline YAML syntax error

Cause: Incorrect YAML configuration.

Solution:

  1. Use the Azure DevOps YAML validator.

Artifacts not found

Cause: Missing build artifacts in the pipeline.

Solution:

  1. Ensure the correct artifact paths are defined in the build stage.

Access denied to the Azure subscription

Cause: Missing role assignments.

Solution:

  1. Assign proper roles to the service principal.

Cannot connect to Azure Kubernetes Service (AKS)

Cause: Misconfigured kubeconfig or network rules.

Solution:

  1. Regenerate kubeconfig using the Azure CLI: az aks get-credentials.

Boards: Work item cannot be updated

Cause: Permission issues.

Solution:

  1. Update user permissions in the project settings.

Failed to publish test results

Cause: Incorrect test result path.

Solution:

  1. Verify the test result files in the pipeline logs.

11. CI/CD Pipeline Errors

Pipeline stuck in pending state

Cause: No available runners or agents.

Solution:

  1. Ensure runners or agents are properly registered and running.
  2. Check tags and runner configurations to match the job requirements.

Build fails due to dependency issues

Cause: Missing, outdated, or incorrect dependencies.

Solution:

  1. Update dependency files like requirements.txt, package.json, or pom.xml.
  2. Cache dependencies to reduce build times and errors.

Environment variable not found

Cause: Undefined or incorrectly set environment variables.

Solution:

  1. Add the variable in the CI/CD tool’s settings.
  2. Use .env files or secret managers for sensitive variables.

Permission denied during deployment

Cause: User lacks required permissions on the target server.

Solution:

  1. Ensure proper SSH keys or access tokens are configured.
  2. Use a service account with deployment privileges.

Timeout in build or deployment stage

Cause: Long-running processes exceed the timeout threshold.

Solution:

  1. Optimize pipeline stages for efficiency.
  2. Increase timeout values in the pipeline configuration.

Pipeline fails only on specific branches

Cause: Branch-specific settings or missing configurations.

Solution:

  1. Verify branch-specific variables and scripts.
  2. Use conditional logic to apply configurations only for certain branches.

Docker image not found in the pipeline

Cause: Incorrect image name, tag, or lack of authentication.

Solution:

  1. Check and update the image name and tag.
  2. Authenticate with the Docker registry using proper credentials.

Failed to upload artifacts

Cause: Incorrect artifact paths or permissions.

Solution:

  1. Validate the artifact paths defined in the pipeline.
  2. Ensure proper permissions to upload files to storage services.

Parallel jobs failing intermittently

Cause: Shared resources causing conflicts between parallel jobs.

Solution:

  1. Use isolation mechanisms like resource locks.
  2. Clean up shared resources after each job.

Webhook not triggering pipeline

Cause: Misconfigured webhook or restricted access.

Solution:

  1. Verify the webhook URL and payload.
  2. Check firewall or network restrictions blocking the webhook.

12. Monitoring Tools Errors

Metrics not visible in Grafana

Cause: Incorrect data source configuration or no metrics collected.

Solution:

  1. Verify data source settings in Grafana.
  2. Check Prometheus targets or other metrics sources for proper data collection.

Prometheus data missing from dashboards

Cause: Misconfigured PromQL queries or data source issues.

Solution:

  1. Test PromQL queries in Prometheus before using them in Grafana.
  2. Check and fix Grafana queries for the correct metrics and labels.

Logs not visible in ELK Stack

Cause: Filebeat, Logstash, or Elasticsearch misconfiguration.

Solution:

  1. Check Filebeat logs for input/output errors.
  2. Validate Logstash pipeline and ensure Elasticsearch indices are configured correctly.

High load on monitoring servers

Cause: Excessive data ingestion or high cardinality metrics.

Solution:

  1. Optimize metrics collection by reducing labels and unnecessary data.
  2. Scale monitoring servers horizontally.

Alerts not firing in Prometheus

Cause: Incorrect alert rules or expression issues.

Solution:

  1. Verify and test alert rules in Prometheus.
  2. Use promtool to validate the alert configuration.

Outdated Grafana dashboards

Cause: Data caching or lack of auto-refresh.

Solution:

  1. Enable auto-refresh for dashboards.
  2. Clear cached data and reload the dashboard.

Log ingestion delay in ELK Stack

Cause: Network bottlenecks or overloaded Logstash instances.

Solution:

  1. Check network latency between Filebeat and Logstash.
  2. Scale Logstash horizontally or increase processing threads.

Scraped data is incomplete

Cause: Partial scrape failures due to unreachable targets.

Solution:

  1. Verify target status in Prometheus under Status > Targets.
  2. Fix any issues with endpoints or networking.

Too many false-positive alerts

Cause: Overly sensitive alert thresholds.

Solution:

  1. Adjust alert thresholds to reduce noise.
  2. Use deadband or hysteresis to filter transient anomalies.

Dashboard panels showing no data

Cause: Incorrect queries or invalid time range.

Solution:

  1. Verify the query syntax and metrics used in the panels.
  2. Ensure the selected time range matches the data availability.