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
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:
- Verify you’re in the correct directory: pwd.
- Navigate to the repository:
cd <repository-path>. - 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:
- Pull latest changes with rebase:
git pull --rebase origin <branch>. - Resolve conflicts if prompted, then commit and push.
Permission denied (publickey)
Cause: SSH key is missing or not recognized by the remote repository.
Solution:
- Generate a key pair:
ssh-keygen -t rsa -b 4096. - Add the private key to the agent:
ssh-add ~/.ssh/id_rsa. - Add the public key to the repository settings.
Merge conflict in [file]
Cause: Simultaneous changes to the same part of a file.
Solution:
- Open the conflicting file to resolve changes.
- Use markers like «««< and »»»> to identify conflicts.
- After resolution, commit:
git add <file> && git commit.
Detached HEAD state
Cause: A specific commit is checked out instead of a branch.
Solution:
- Create a branch from the detached state:
git checkout -b <new-branch>. - Continue working or merge with another branch.
fatal: remote origin already exists
Cause: Adding a remote repository that already exists.
Solution:
- 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:
- Use Git Large File Storage (LFS):
git Ifs track "<file-pattern>".
Submodule update failed
Cause: Incorrect or inaccessible submodule configuration.
Solution:
- Update submodules:
git submodule update --init --recursive.
fatal: cannot lock ref
Cause: A .lock file is preventing operations due to an interrupted process.
Solution:
- Remove the lock file:
rm -f .git/index.lock.
Untracked files prevent switching branches
Cause: Untracked changes conflict with the branch switch.
Solution:
- Stash changes:
git stash. - Switch branches:
git checkout <branch>.
2. Jenkins Errors
Jenkins service not starting
Cause: Corrupted configuration or missing Java installation.
Solution:
- Check logs:
sudo journalctl -u jenkins. - Verify Java installation:
java -version.
Build stuck in the queue
Cause: No available executors or agents.
Solution:
- Ensure the Jenkins agent is running and connected.
- Increase executor count under “Manage Jenkins.”
Plugins fail to load
Cause: Outdated Jenkins version or missing dependencies.
Solution:
- Update Jenkins to the latest version.
- Reinstall failing plugins.
Pipeline script syntax error
Cause: Incorrect Groovy syntax.
Solution:
- Validate the script using the pipeline syntax generator.
- Debug syntax errors with Jenkins logs.
Build fails due to missing environment variables
Cause: Environment variables not set in the job configuration.
Solution:
- Define variables in “Build Environment” or as parameters.
- Use
env.VARIABLE_NAMEin the pipeline script.
Unauthorized webhook trigger
Cause: Incorrect webhook configuration or missing credentials.
Solution:
- Verify the webhook URL in the source control settings.
- Add proper credentials in Jenkins.
Job not found after restart
Cause: Corrupted job configurations.
Solution:
- Check for backups in
/var/lib/jenkins/jobs. - Recreate the job manually if backups are unavailable.
Out of disk space
Cause: Jenkins workspace consumes too much space.
Solution:
- Clean old builds: Manage Jenkins > Workspace Cleanup Plugin.
- Automate workspace cleanup post-build.
Build artifacts not archiving
Cause: Incorrect artifact path configuration.
Solution:
- Ensure correct file paths in “Archive the artifacts” step.
Node disconnected unexpectedly
Cause: Network or agent-side issues.
Solution:
- 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:
- Start the Docker service:
sudo systemctl start docker. - 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:
- Stop the conflicting container:
docker stop <container-id>. - Change the container’s port mapping.
No space left on device
Cause: Disk space is exhausted by Docker images and containers.
Solution:
- Remove unused resources: docker system prune -a.
ImagePullBackOff in Kubernetes
Cause: Invalid image tag or registry issues.
Solution:
- Verify the image name and registry credentials.
Permission denied on bind mount
Cause: Host directory permissions are restrictive.
Solution:
- 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:
- Verify the image name and tag.
- 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:
- Check container logs using
kubectl logs <pod-name>. - Fix the underlying issue causing the crash.
Node Not Ready
Cause: A Kubernetes node is unhealthy or cannot join the cluster.
Solution:
- Use kubectl get nodes to check node status.
- Restart the kubelet service and verify resource availability.
PersistentVolumeClaim Pending
Cause: No PersistentVolume matches the claim’s requirements.
Solution:
- Check storage class and create a matching PersistentVolume.
Pod is stuck in Pending state
Cause: Insufficient resources or unschedulable conditions.
Solution:
- Check node capacity:
kubectl describe pod <pod-name>. - Scale up resources or adjust pod resource requests.
RBAC: Access Denied
Cause: Role-based access control prevents the action.
Solution:
- Grant proper permissions using Role/ClusterRole and RoleBinding.
Service Unreachable
Cause: Service or ingress misconfiguration.
Solution:
- Verify Service type, selectors, and target port.
- Check the ingress rules if applicable.
Resource Quota Exceeded
Cause: The namespace has hit resource limits.
Solution:
- Increase the resource quota or optimize usage.
Evicted Pods
Cause: Nodes lack sufficient resources.
Solution:
- Check events with kubectl describe pod.
- Add resources or reschedule workloads.
Deployment Rollout Fails
Cause: Health checks fail for new pods.
Solution:
- Check logs and events of failed pods.
- Roll back using kubectl rollout undo.
5. Ansible Errors
Host unreachable
Cause: SSH connection fails.
Solution:
- Verify SSH keys and access.
- Ensure the inventory file has the correct IP addresses.
Syntax error in playbook
Cause: Incorrect YAML formatting.
Solution:
- Validate YAML with a linter or
ansible-playbook --syntax-check.
Undefined variable
Cause: Variable is not defined in the playbook or inventory.
Solution:
- Define the variable in
vars,group_vars, or the inventory file.
Command not found on target node
Cause: Required packages are missing.
Solution:
- Install missing packages using a task in the playbook.
Permission denied
Cause: User lacks required permissions on the target machine.
Solution:
- Use become: true in the playbook to execute as a superuser.
Module not found
Cause: The Ansible module is not installed.
Solution:
- Ensure Ansible and its dependencies are up-to-date.
Failed to find group_vars
Cause: Incorrect directory structure.
Solution:
- Place
group_varsandhost_varsin the same directory as the inventory file.
Playbook runs indefinitely
Cause: Task stuck in a loop or waiting for an unavailable service.
Solution:
- Add timeout options and validate tasks.
Handler not triggered
Cause: No task notifies the handler.
Solution:
- Add notify:
<handler-name>to the appropriate task.
Dynamic inventory script failure
Cause: Errors in the inventory script.
Solution:
- Debug the script manually or use
--listto validate.
6. Terraform Errors
Provider plugin not found
Cause: Missing or outdated provider plugin.
Solution:
- Run
terraform initto download required plugins.
State file lock error
Cause: Concurrent Terraform runs.
Solution:
- Unlock the state file:
terraform force-unlock <lock-id>.
Error acquiring the state lock
Cause: Network issues when using remote state.
Solution:
- Retry after ensuring stable connectivity.
Resource already exists
Cause: Attempting to create a resource that already exists.
Solution:
- Use
terraform importto manage existing resources.
Plan does not match changes
Cause: Drift in the state file.
Solution:
- Refresh state:
terraform refresh.
Invalid index in Terraform output
Cause: Incorrect usage of lists or maps.
Solution:
- Validate variable types and indices.
Module not found
Cause: Incorrect module path.
Solution:
- Ensure module paths are correct and run
terraform get.
Authentication failure
Cause: Missing or invalid credentials.
Solution:
- Set proper environment variables or credentials files.
Timeout waiting for resource
Cause: Resource creation takes too long.
Solution:
- Increase timeout settings in the resource block.
Remote backend configuration error
Cause: Incorrect backend configuration.
Solution:
- 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:
- Check prometheus.yml for scrape configurations.
- Ensure that target endpoints are reachable.
Prometheus not scraping data
Cause: Target endpoints are misconfigured or not reachable.
Solution:
- Verify the status of targets in the Prometheus Ul under Status > Targets.
- Fix any endpoint issues or configurations.
High cardinality in metrics
Cause: Too many unique label combinations in metrics.
Solution:
- Optimize label usage in your metric definitions.
- Use relabeling rules to filter out unnecessary labels.
Prometheus service not starting
Cause: Misconfiguration in prometheus.yml or insufficient resources.
Solution:
- Validate the configuration file:
promtool check config prometheus.yml. - Check system resources and allocate more CPU/memory if needed.
Query taking too long
Cause: Large datasets or inefficient queries.
Solution:
- Optimize your PromQL queries by limiting time ranges or labels.
- Enable query caching for better performance.
Prometheus out of storage space
Cause: Retention period or data volume exceeds available disk space.
Solution:
- Reduce the data retention period:
storage.tsdb.retention.time=<duration>. - Add more storage or clean old data manually.
Prometheus alert not firing
Cause: Misconfigured alert rules.
Solution:
- Validate alert rules using promtool check rules.
- 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:
- Increase memory allocation to the Prometheus server.
- Reduce the number of metrics being scraped by filtering them.
Scraped data is incomplete
Cause: Targets are partially down or network issues.
Solution:
- Check the health of scrape targets.
- Monitor network connections between Prometheus and endpoints.
Failed to reload configuration
Cause: Syntax errors in prometheus.yml.
Solution:
- Validate the configuration file with promtool.
- 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:
- Check node status:
curl -X GET <ES_HOST>/_cat/nodes. - Reallocate shards:
POST_cluster/reroute.
Elasticsearch: Java heap space error
Cause: Insufficient heap memory for Elasticsearch.
Solution:
- Increase heap size in jvm.options.
- 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:
- Validate the configuration:
logstash -t -f logstash.conf. - Fix the error based on logs.
Logstash: Connection refused to Elasticsearch
Cause: Incorrect Elasticsearch endpoint in Logstash configuration.
Solution:
- Update output
{ elasticsearch { hosts => ["<ES_HOST>"] }}.
Kibana: Kibana server is not ready yet
Cause: Elasticsearch cluster is not reachable.
Solution:
- Verify Elasticsearch connectivity.
- Restart Kibana after Elasticsearch is ready.
Index pattern not found in Kibana
Cause: No matching indices in Elasticsearch.
Solution:
- Ensure data is being sent to Elasticsearch.
- Recreate the index pattern in Kibana.
Logstash not processing logs
Cause: Input or filter misconfiguration.
Solution:
- Check input sources and logs for issues.
- Validate filters with small datasets.
Elasticsearch: Index not found
Cause: Querying an index that doesn’t exist.
Solution:
- Check available indices:
curl -X GET <ES_HOST>/_cat/indices.
Kibana: Dashboard is empty
Cause: Missing or misconfigured visualizations.
Solution:
- Verify data sources for visualizations.
- Check time filters on the dashboard.
Logstash: Filebeat logs not received
Cause: Incorrect Filebeat-to-Logstash configuration.
Solution:
- Check Filebeat
output.logstashconfiguration. - Ensure the correct port and protocol.
9. AWS DevOps Tools Errors
EC2: Instance not reachable
Cause: Incorrect security group or network ACL configuration.
Solution:
- Verify inbound rules for SSH/HTTP access.
- Check VPC and subnet configuration.
S3: Access Denied
Cause: Missing permissions for the S3 bucket.
Solution:
- Update bucket policies to allow access.
- Attach proper IAM roles or policies.
CodePipeline: Failed to deploy
Cause: Deployment stage error.
Solution:
- Check deployment logs for details.
- Verify IAM permissions for CodePipeline and CodeDeploy.
RDS: Cannot connect to the database
Cause: Firewall or networking issues.
Solution:
- Add the correct inbound rules to the RDS security group.
- Check database credentials.
CloudFormation: Stack creation failed
Cause: Misconfigured templates or resource dependencies.
Solution:
- Review the stack events for specific errors.
- Validate the template:
aws cloudformation validate-template.
IAM: Policy not authorized
Cause: Insufficient permissions in the policy.
Solution:
- Modify the policy to include the required actions.
ECS: Task failed to start
Cause: Resource limitations or misconfigured task definitions.
Solution:
- Check task logs in CloudWatch.
- Ensure sufficient memory and CPU allocation.
Lambda: Execution failed
Cause: Errors in the Lambda function code.
Solution:
- Review CloudWatch logs for detailed errors.
- Update the function code to fix issues.
Route 53: DNS record not resolving
Cause: Incorrect record type or misconfigured TTL.
Solution:
- Verify DNS records in the Route 53 console.
- Check domain delegation settings.
CloudWatch: Metrics not visible
Cause: Missing or misconfigured monitoring agents.
Solution:
- Ensure the CloudWatch agent is running.
- Verify configuration files.
10. Azure DevOps Tools Errors
Pipelines: Build agent unavailable
Cause: The agent is offline or misconfigured.
Solution:
- Restart the agent service.
- Verify agent registration in Azure DevOps.
Resource group deployment failed
Cause: Incorrect ARM template.
Solution:
- Validate the ARM template before deployment.
Release failed in Azure DevOps
Cause: Deployment script errors.
Solution:
- Check logs for failed tasks.
- Fix script errors and re-run.
Repos: Merge conflict during pull request
Cause: Simultaneous changes to the same files.
Solution:
- Resolve conflicts using the web editor or locally.
Pipeline YAML syntax error
Cause: Incorrect YAML configuration.
Solution:
- Use the Azure DevOps YAML validator.
Artifacts not found
Cause: Missing build artifacts in the pipeline.
Solution:
- Ensure the correct artifact paths are defined in the build stage.
Access denied to the Azure subscription
Cause: Missing role assignments.
Solution:
- Assign proper roles to the service principal.
Cannot connect to Azure Kubernetes Service (AKS)
Cause: Misconfigured kubeconfig or network rules.
Solution:
- Regenerate kubeconfig using the Azure CLI:
az aks get-credentials.
Boards: Work item cannot be updated
Cause: Permission issues.
Solution:
- Update user permissions in the project settings.
Failed to publish test results
Cause: Incorrect test result path.
Solution:
- 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:
- Ensure runners or agents are properly registered and running.
- Check tags and runner configurations to match the job requirements.
Build fails due to dependency issues
Cause: Missing, outdated, or incorrect dependencies.
Solution:
- Update dependency files like requirements.txt, package.json, or pom.xml.
- Cache dependencies to reduce build times and errors.
Environment variable not found
Cause: Undefined or incorrectly set environment variables.
Solution:
- Add the variable in the CI/CD tool’s settings.
- Use .env files or secret managers for sensitive variables.
Permission denied during deployment
Cause: User lacks required permissions on the target server.
Solution:
- Ensure proper SSH keys or access tokens are configured.
- Use a service account with deployment privileges.
Timeout in build or deployment stage
Cause: Long-running processes exceed the timeout threshold.
Solution:
- Optimize pipeline stages for efficiency.
- Increase timeout values in the pipeline configuration.
Pipeline fails only on specific branches
Cause: Branch-specific settings or missing configurations.
Solution:
- Verify branch-specific variables and scripts.
- 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:
- Check and update the image name and tag.
- Authenticate with the Docker registry using proper credentials.
Failed to upload artifacts
Cause: Incorrect artifact paths or permissions.
Solution:
- Validate the artifact paths defined in the pipeline.
- Ensure proper permissions to upload files to storage services.
Parallel jobs failing intermittently
Cause: Shared resources causing conflicts between parallel jobs.
Solution:
- Use isolation mechanisms like resource locks.
- Clean up shared resources after each job.
Webhook not triggering pipeline
Cause: Misconfigured webhook or restricted access.
Solution:
- Verify the webhook URL and payload.
- 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:
- Verify data source settings in Grafana.
- 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:
- Test PromQL queries in Prometheus before using them in Grafana.
- Check and fix Grafana queries for the correct metrics and labels.
Logs not visible in ELK Stack
Cause: Filebeat, Logstash, or Elasticsearch misconfiguration.
Solution:
- Check Filebeat logs for input/output errors.
- Validate Logstash pipeline and ensure Elasticsearch indices are configured correctly.
High load on monitoring servers
Cause: Excessive data ingestion or high cardinality metrics.
Solution:
- Optimize metrics collection by reducing labels and unnecessary data.
- Scale monitoring servers horizontally.
Alerts not firing in Prometheus
Cause: Incorrect alert rules or expression issues.
Solution:
- Verify and test alert rules in Prometheus.
- Use promtool to validate the alert configuration.
Outdated Grafana dashboards
Cause: Data caching or lack of auto-refresh.
Solution:
- Enable auto-refresh for dashboards.
- Clear cached data and reload the dashboard.
Log ingestion delay in ELK Stack
Cause: Network bottlenecks or overloaded Logstash instances.
Solution:
- Check network latency between Filebeat and Logstash.
- Scale Logstash horizontally or increase processing threads.
Scraped data is incomplete
Cause: Partial scrape failures due to unreachable targets.
Solution:
- Verify target status in Prometheus under Status > Targets.
- Fix any issues with endpoints or networking.
Too many false-positive alerts
Cause: Overly sensitive alert thresholds.
Solution:
- Adjust alert thresholds to reduce noise.
- Use deadband or hysteresis to filter transient anomalies.
Dashboard panels showing no data
Cause: Incorrect queries or invalid time range.
Solution:
- Verify the query syntax and metrics used in the panels.
- Ensure the selected time range matches the data availability.