Jenkins, From Zero To Hero Become a DevOps Jenkins Master
Source
jenkins/centos7/Dockerfile
Error
Step 2/7 : RUN yum -y install openssh-server ---> Running in 7e18f84a2754 CentOS Linux 8 - AppStream 391 B/s | 38 B 00:00 Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist ERROR: Service 'remote_host' failed to build: The command '/bin/sh -c yum -y install openssh-server' returned a non-zero code: 1
Solution
FROM centos:centos7
Remark
Related to new CentOS 8 Stream
Topic
Jenkins, From Zero To Hero Become a DevOps Jenkins Master
Make the script permanent outside of docker container by using volumes but remember to make it executable.
Topic
Jenkins, From Zero To Hero Become a DevOps Jenkins Master
Source
jenkins > docker-compose build
Error
/bin/sh: 1: python: not found ERROR: Service 'jenkins' failed to build: The command '/bin/sh -c curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python get-pip.py --user && python -m pip install --user ansible' returned a non-zero code: 127
Solution
# Dockerfile USER root RUN apt-get update && apt-get install -y python3 python3-pip RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ python3 get-pip.py --user && \ python3 -m pip install ansible
Remark
Tutorial videos based on Python 2 and outdated installing Ansible with pip commands.
Topic
GitLab, CI/CD Getting Started
Source
GitLab > (your project) > CI/CD > Pipelines
Error
Preparing environment Running on devops… ERROR: Job failed: prepare environment: exit status 1. Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information
Solution
Comment out last 3 lines /home/gitlab-runner/.bash_logout # ~/.bash_logout: executed by bash(1) when login shell exits. # when leaving the console clear the screen to increase privacy #if [ "$SHLVL" = 1 ]; then #[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q #fi
[AWS EC2] Instances (running) x API Error | Dedicated Hosts x API Error Instances x API Error | Key pairs x API Error $ terraform apply Error: Error launching source instance: UnauthorizedOperation: You are not authorized to perform this operation. Encoded authorization failure message: bgJ7KtftIXVield6dlQyqxtJ
Solution
Delete and re-create the (non-root) user and re-assign required permissions policies.
Remark
stackoverflow.com mentioned keys got revoked because AWS detected access key/secret key was exposed/ compromised.
Topic
AWS Application Load Balancer – 503 Service Temporarily Unavailable
Source
Terraform (main.tf) > AWS (EC2/ALB) > Browser
Error
http://terraform-asg-example-15464xxxxx.us-east-2.elb.amazonaws.com/ 503 Service Temporarily Unavailable
Solution
# Find aws_autoscaling_group resource and add this line in Terraform main.tf resource "aws_autoscaling_group" "example" { target_group_arns = [aws_lb_target_group.asg.arn] ... } [Manual fix] Go AWS EC2 > click Target Groups > click affected group > Register targets > Check Instance ID (e.g. EC2) > Include as pending below > Register pending targets
Go to browser and retry http://terraform-asg-example-15464xxxxx.us-east-2.elb.amazonaws.com/
Remark
The target group is created but contains no EC2 instances hence HTTP Error 503 is returned.
This post is not the end, for we will continue to add more troubleshooting guides as we continue our exploration with DevOps tools.