Showing posts with label Troubleshooting. Show all posts
Showing posts with label Troubleshooting. Show all posts

Saturday, April 20, 2024

Fix for Jenkins slowness when Running in AWS EC2 instance | Jenkins Very Slow Upon Starting EC2 Instance after Stopping

Let's say that you have configured Jenkins in AWS EC2 instance and you are using AWS free tier and you are NOT using Elastic IP, so when ever you start EC2 instance after stopping, you would have noticed Jenkins UI is taking a lot of time to come up. You try to access any page in Jenkins, it will be really slow.

What is the root cause of the issue?

If you are using AWS free tier account and creating EC2 instance without using Elastic IP. If you are stopping EC2 instance and restarting EC2, this would have new IP after every restart, Jenkins was trying to use old IP address when you are trying to start Jenkins. Due to this issue, Jenkins will be very slow.

Pre-requisites:

There are two ways you can fix this issue:

First option using command line

Make changes in the xml file by logging into EC2 instance through command line using Git bash or any SSH tool.

Connect to Jenkins EC2 instance using Git bash or iTerm:

Navigate to Jenkins installation directory:

cd /var/lib/jenkins/

Modify jenkins.model.JenkinsLocationConfiguration.xml file by executing below command:

sudo nano jenkins.model.JenkinsLocationConfiguration.xml

Make sure you provide Jenkins current URL in below location and restart Jenkins.

sudo service jenkins restart

Now try accessing Jenkins through UI, it will be really performing well.

Second option is using Jenkins UI

Change public URL under Manage Jenkins->System

Change Jenkins URL to current Jenkins URL:

Click on Apply-> Save.

that's it. You will notice Jenkins is performing well now.

Watch steps in YouTube channel:

Monday, January 22, 2024

Errors during EC2 instance creating using Ansible playbook | Ansible playbook Execution Error during EC2 creation

No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV4Handler'] Check your credentials" 

If you are running into above issue when provisioning EC2 instance using Ansible playbook, please refer the fix below:


Fix:

Please refer the below page for the resolution with playbook.

https://www.coachdevops.com/2024/01/ansible-playbook-for-provisioning-new.html


Saturday, October 21, 2023

Fix for Kubernetes Deployment Error using helm chart | Error: kubernetes cluster unreachable: exec plugin: invalid apiversion "client.authentication.k8s.io/v1alpha1"

Error: kubernetes cluster unreachable: exec plugin: invalid apiversion "client.authentication.k8s.io/v1alpha1"

 

Root cause and fix:
Downgrading helm version to 3.8.2 would resolve the issue.

curl -L https://git.io/get_helm.sh | bash -s -- --version v3.8.2

Tuesday, May 9, 2023

Tuesday, April 4, 2023

SonarQube Server Cannot be reached Error Resolution | SonarQube Troubleshooting

How to Resolve SonarQube Server cannot be reached Error?

Pre-requisites:

Sonarqube was configured manually by downloading zip file. This instructions will not address for SonarQube that was configured by Docker compose.

Let's see how we can resolve the error:

Solution # 1
Your sonar.properties may not be setup correctly. It could be due to three different reasons: 1. verify below sonar.properties sudo vi /opt/sonarqube/conf/sonar.properties uncomment the below lines by removing # and add values highlighted yellow sonar.jdbc.username=sonar sonar.jdbc.password=password Next, uncomment the below line, removing # sonar.jdbc.url=jdbc:postgresql://localhost/sonarqube
Solution # 2

Make sure you have setup Postgres SQL correctly.
2. Switch to sql shell by entering psql Execute the below lines (one by one) ALTER USER sonar WITH ENCRYPTED password 'password'; CREATE DATABASE sonarqube OWNER sonar; GRANT ALL PRIVILEGES ON DATABASE sonarqube to sonar; \q type exit tom come out of postgresSQL.
Solution #3
3. Make sure you have setup sonarqube as a service properly. Execute the below command: sudo vi /etc/systemd/system/sonar.service # copy the below green highlighted commands in the above file [Unit] Description=SonarQube service After=syslog.target network.target [Service] Type=forking ExecStart=/opt/sonarqube/bin/linux-x86-64/sonar.sh start ExecStop=/opt/sonarqube/bin/linux-x86-64/sonar.sh stop User=root Group=root Restart=always [Install] WantedBy=multi-user.target




Wednesday, May 25, 2022

No such property: docker for class: groovy.lang.Binding | Jenkins Pipeline Error Docker Build | Jenkins docker pipeline error

Jenkins Pipeline Error: 

groovy.lang.MissingPropertyException: No such property: docker for class: groovy.lang.Binding.

We most likely encountered the same issue, in order to fix it, install Docker Pipeline plugin in Jenkins:

Root Cause and Fix:

Jenkins need to have Docker Pipeline plug-in to perform Docker builds.

Jenkins > Manage Jenkins > Manage Plugins > Available tab

Search for Docker Pipeline install it, restart Jenkins and you are ready to go.


Friday, May 20, 2022

How to check whether my user data passing to EC2 instance is working | AWS EC2 bootstrap script log

The cloud-init output log file (/var/log/cloud-init-output.log) captures console output so it is easy to debug your scripts following a launch if the instance does not behave the way you intended.

Check the Logs in EC2 instance

Login to EC2 instance, and type the below command:

tail -f /var/log/cloud-init-output.log

This will give the output of bootstrap execution

Saturday, October 9, 2021

Certificate verification failed: The certificate is NOT trusted | Jenkins installation Error Fix | Jenkins Installation on Ubuntu 18.0.4 | Jenkins Installation on Ubuntu 20.0.4

If you try to install Jenkins on Ubuntu 18.0.4/20.0.4 instance, you may experience this problem.

Running sudo apt-get update on my AWS EC2 Ubuntu 18.04.01 LTS instance fails because Certificate verification failed: The certificate is NOT trusted.

Err:6 https://pkg.jenkins.io/debian-stable binary/ Release


Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate.  Could not handshake: Error in the certificate verification. [IP: 199.232.66.133 443]

Fix for the above error

You need to install certificates to overcome this error:

sudo apt install ca-certificates

sudo apt-get update

Now try installing Jenkins

sudo apt install jenkins -y



Thursday, August 19, 2021

stderr: remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead | Fix for this issue | How to Create Personal Access Token in GitHub?

How to Create Personal Access Token in GitHub?

Fix for Support for password authentication was removed on August 13, 2021

How to Fix for the above error by creating Personal Access Token:GitHub removed password authentication support from August 13, 2021 instead it recommends to use either OAuth or Personal Access Token.

Create Personal Access Token in GitHub

Go to GitHub.com--> Settings

Go to Developer Settings 
Go to Personal Access tokens --> Generate new token
Enter name for the token, choose no expiration if you don't want your token to expire.


Select repo and click generate token

Now copy the token and use this as password.

Watch here on how to do this on YouTube Channel:

Wednesday, November 18, 2020

ERROR: Can't construct a java object for tag:yaml - Kubernetes Jenkins Deployment issue

ERROR: Can't construct a java object for tag:yaml.org,2002:io.kubernetes.client.openapi.models.V1Deployment; exception=Class not found: io.kubernetes.client.openapi.models.V1Deployment

 in 'reader', line 1, column 1:
    apiVersion: apps/v1
 

Caused by: hudson.remoting.ProxyException: org.yaml.snakeyaml.error.YAMLException: Class not found: io.kubernetes.client.openapi.models.V1Deployment at org.yaml.snakeyaml.constructor.Constructor.getClassForNode(Constructor.java:664) at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.getConstructor(Constructor.java:322) at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:331) ... 30 more

Fix/Workaround:
Try the deployment in Jenkins slave node instead of deploying from Jenkins Master.

Monday, December 31, 2018

Can not run elasticsearch as root sonarqube Error - SonarQube Elasticsearch do not run as root

When you tried to configure SonarQube, you may experience the below error:

2018.10.15 17:32:13 ERROR es[][o.e.b.Bootstrap] Exception
java.lang.RuntimeException: can not run elasticsearch as root

at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:106) 

SonarQube does not support being run as root user, so we need to create regular user like sonar and give privilege to that use.

Fix for the above issue:
create a user called sonar by executing below command:
sudo useradd sonar

sudo chown -R sonar:sonar sonar-install-folder/


Edit the sonar.sh start script and change the #RUN_AS_USER to be RUN_AS_USER=sonar

sudo vi /opt/sonarqube/bin/linux-x86-64/sonar.sh


Change 
RUN_AS_USER=sonar
now start the server 
sudo sh /opt/sonarqube/bin/linux-x86-64/sonar.sh start

This should fix that issue.

🚀 Live AI-Enabled DevSecOps & Cloud Engineering Bootcamp – Sep 2026

Live AI-Enabled DevSecOps & Cloud Engineering Bootcamp from Coach AK - Sep 2026 Schedule