Devops | Sasidharan | May 11th

Discussion in 'Web App and Programming' started by Sasidharan_2, May 11, 2019.

  1. Sasidharan_2

    Sasidharan_2 Customer
    Customer

    Joined:
    Mar 28, 2019
    Messages:
    20
    Likes Received:
    1
    Hi,

    Please use this to communicate with the Trainer and TA offline.
     
    #1
    sushil_23 likes this.
  2. Neha_170

    Neha_170 New Member

    Joined:
    May 2, 2019
    Messages:
    1
    Likes Received:
    0
    hi , where to find yesterday recording session
     
    #2
  3. UPASANA DHINGRA

    Joined:
    Apr 25, 2019
    Messages:
    9
    Likes Received:
    0
    hi

    i am getting below error on pushing the repo. Can you pls advise. If i try to use the fetch command as suggested by error, then also i am getting some error

    ubuntu@ip-172-31-20-149:~/project/localrepo$ git push -u ud1 master
    Username for 'https://github.com': udhingra
    Password for 'https://udhingra@github.com':
    To https://github.com/udhingra/learngit.git
    ! [rejected] master -> master (fetch first)
    error: failed to push some refs to 'https://github.com/udhingra/learngit.git'
    hint: Updates were rejected because the remote contains work that you do
    hint: not have locally. This is usually caused by another repository pushing
    hint: to the same ref. You may want to first integrate the remote changes
    hint: (e.g., 'git pull ...') before pushing again.
    hint: See the 'Note about fast-forwards' in 'git push --help' for details.



    ubuntu@ip-172-31-20-149:~/project/localrepo$ git fetch -u ud1 master
    From https://github.com/udhingra/learngit
    * branch master -> FETCH_HEAD
    ubuntu@ip-172-31-20-149:~/project/localrepo$ git push -u ud1 master
    Username for 'https://github.com': udhingra
    Password for 'https://udhingra@github.com':
    To https://github.com/udhingra/learngit.git
    ! [rejected] master -> master (non-fast-forward)
    error: failed to push some refs to 'https://github.com/udhingra/learngit.git'
    hint: Updates were rejected because the tip of your current branch is behind
    hint: its remote counterpart. Integrate the remote changes (e.g.
    hint: 'git pull ...') before pushing again.
    hint: See the 'Note about fast-forwards' in 'git push --help' for details.
     
    #3
  4. Swathi Shetty_1

    Swathi Shetty_1 Active Member

    Joined:
    Mar 22, 2019
    Messages:
    27
    Likes Received:
    2
    I have attached the screenshot below.Can anyone tell me what is the problem.I am trying to run the GeckoDriver program.it gives me this error
    Exception in thread "main" java.lang.Error: Unresolved compilation problem:

    Type mismatch: cannot convert from FirefoxDriver to WebDriver



    at com.simplilearn.Day2.oops.LaunchBrowser.main(LaunchBrowser.java:11)
     

    Attached Files:

    #4
  5. Shivi Agarwal_1

    Alumni

    Joined:
    Apr 30, 2019
    Messages:
    13
    Likes Received:
    0
    Hi Sasi

    while building the addressbook repository on my lab "build is being failed"
    please have a look and suggest where i am going wrong
     

    Attached Files:

    #5
  6. UPASANA DHINGRA

    Joined:
    Apr 25, 2019
    Messages:
    9
    Likes Received:
    0
    hi
    I am not able to push the local repo,i tried using both https url and ssh key ways. getting same error''....can you pls advise

    upload_2019-5-21_23-57-3.png

    upload_2019-5-21_23-56-46.png
     
    #6
  7. Sasidharan_2

    Sasidharan_2 Customer
    Customer

    Joined:
    Mar 28, 2019
    Messages:
    20
    Likes Received:
    1
    Recordings are available under Live Classes section.
     
    #7
  8. Sasidharan_2

    Sasidharan_2 Customer
    Customer

    Joined:
    Mar 28, 2019
    Messages:
    20
    Likes Received:
    1
    You should first attempt pull and then try pushing it to the repository. Assuming ud1 is your remote name.
    1) git pull ud1
    Now your local repo would have got the latest code base from remote and attempt push
    2) git push -u ud1 master
     
    #8
  9. Sasidharan_2

    Sasidharan_2 Customer
    Customer

    Joined:
    Mar 28, 2019
    Messages:
    20
    Likes Received:
    1
    Here you are trying to use ssh url for accessing git remote repository, ensure if the right public keys are added to your github account for authentication.
     
    #9
  10. Shivi Agarwal_1

    Alumni

    Joined:
    Apr 30, 2019
    Messages:
    13
    Likes Received:
    0
    Hi,

    I tried Poll SCM trigger in Jenkins and tried scheduling every minute. That worked. But when i tried using onhook git SCM Poll option, not giving a desired result. Tried pushing approx 5 files but at no point of time, it started polling.

    I just checked the option in Configure Project Step. have gone through the session's recording as well but did not get the idea on the issue. Can you please suggest on the steps again here to get the same working.

    I had looked for the same on internet. That was showing to register github server in jenkins through personal access token for git . Please guide what is personal access token and is it mandatory to register github server for enabling onhook Poll SCM trigger.
     
    #10
    Last edited: May 22, 2019
  11. Shivi Agarwal_1

    Alumni

    Joined:
    Apr 30, 2019
    Messages:
    13
    Likes Received:
    0
    Or GitHub hook trigger for GITScm polling has some issue since my jenkins is running on local machine and not directly accessible from Internet so github is not able to send PUSH info back to jenkins.I am so confused on this . Please advice.
     
    #11
  12. Shivi Agarwal_1

    Alumni

    Joined:
    Apr 30, 2019
    Messages:
    13
    Likes Received:
    0
    Hi

    Can you advice on email configuration (gmail) in jenkins. Have turned on the access from less secure apps. Still Google is preventing the access from jenkins console and i am getting authetication failer error. Snapshot enclosed.
     

    Attached Files:

    #12
    Last edited: May 23, 2019
  13. UPASANA DHINGRA

    Joined:
    Apr 25, 2019
    Messages:
    9
    Likes Received:
    0
    Hi,
    Hi Sasi

    Thanks for the reply.

    keys are added properly. Also https option is giving same error. Have attached two screenshots. Pls advise as i am not able to do further hands on due to this issue
     
    #13
  14. Shivi Agarwal_1

    Alumni

    Joined:
    Apr 30, 2019
    Messages:
    13
    Likes Received:
    0
    hi,
    Please resolve the maven build error on windows.. how will it work? upload_2019-5-24_8-52-57.png
     
    #14
  15. UPASANA DHINGRA

    Joined:
    Apr 25, 2019
    Messages:
    9
    Likes Received:
    0
    hi Sasi

    can you pls advise on above
     
    #15
  16. Sasidharan_2

    Sasidharan_2 Customer
    Customer

    Joined:
    Mar 28, 2019
    Messages:
    20
    Likes Received:
    1
    Please go through the recordings of lesson 3 by end of session there were two similar issues which was resolved...
     
    #16
  17. Sasidharan_2

    Sasidharan_2 Customer
    Customer

    Joined:
    Mar 28, 2019
    Messages:
    20
    Likes Received:
    1
    In this way you are using the maven installed in the system to achieve it please install maven with the command apt-get install maven.. The other way to achieve this is to set maven in global tool configuration and also use Invoke maven targets in add build step .. Please watch the session 4 recording this was been demonstrated.
     
    #17
  18. Sasidharan_2

    Sasidharan_2 Customer
    Customer

    Joined:
    Mar 28, 2019
    Messages:
    20
    Likes Received:
    1
    #18
  19. Sasidharan_2

    Sasidharan_2 Customer
    Customer

    Joined:
    Mar 28, 2019
    Messages:
    20
    Likes Received:
    1
    Hi Shivi,
    As per the screenshot attached it looks to be an authentication error .. Ensure you provide right password and the same error reflects in your screenshot too.
     
    #19
  20. Sasidharan_2

    Sasidharan_2 Customer
    Customer

    Joined:
    Mar 28, 2019
    Messages:
    20
    Likes Received:
    1
    It looks you have installed jre instead of jdk. I have given a overview and difference between these during the session. Please go through the recordings. To resolved this you had to install openjdk on your server.. If its an ubuntu servers the command would be below
    apt-get install openjdk-8-jdk
     
    #20
  21. Shivi Agarwal_1

    Alumni

    Joined:
    Apr 30, 2019
    Messages:
    13
    Likes Received:
    0
    Thats not the authentication error. As i mentioned in trail post that google prevented the sign on inspite of the fact that less secure apps feature is turned on. Snapshot enclosed.
     

    Attached Files:

    #21
  22. Shivi Agarwal_1

    Alumni

    Joined:
    Apr 30, 2019
    Messages:
    13
    Likes Received:
    0
    yep. resolved thanks.
     
    #22
  23. Shivi Agarwal_1

    Alumni

    Joined:
    Apr 30, 2019
    Messages:
    13
    Likes Received:
    0
    #23
  24. Shivi Agarwal_1

    Alumni

    Joined:
    Apr 30, 2019
    Messages:
    13
    Likes Received:
    0
    Hi Sasi,

    When i am trying compiling a project on jenkins slave node. Git repository is specified. Its giving "Error cloning remote repo 'origin'" is it because my slave node does not have Git installed on the machine. Kindly clarify.

    Note that my master is on windows and slave on ubuntu
     
    #24
  25. Sasidharan_2

    Sasidharan_2 Customer
    Customer

    Joined:
    Mar 28, 2019
    Messages:
    20
    Likes Received:
    1
    Git plugin needs the package to be installed on the base node that you target jobs on.
     
    #25
  26. Thirumalaivasan T

    Thirumalaivasan T New Member

    Joined:
    Mar 23, 2019
    Messages:
    1
    Likes Received:
    0
    Hi sashi,

    i want to spin up aws ec2 using jenkins (jenkins should start ec2 instance and install lamp stack and run)

    kindly suggest me how to do it.

    Thanks & Regards
    Thiru.T
     
    #26
  27. Shivi Agarwal_1

    Alumni

    Joined:
    Apr 30, 2019
    Messages:
    13
    Likes Received:
    0
    does that mean my base node needs every software to be installed which my build steps requires? Like Maven for maven build?
     
    #27
  28. Shivi Agarwal_1

    Alumni

    Joined:
    Apr 30, 2019
    Messages:
    13
    Likes Received:
    0
    Can i avoid/restrict cloning during build(jenkins) in case there is no change in the scm repository since last build?
     
    #28
  29. Sasidharan_2

    Sasidharan_2 Customer
    Customer

    Joined:
    Mar 28, 2019
    Messages:
    20
    Likes Received:
    1
    You need to install git on the slave node for this to work
     
    #29
  30. Sasidharan_2

    Sasidharan_2 Customer
    Customer

    Joined:
    Mar 28, 2019
    Messages:
    20
    Likes Received:
    1
    There are many ways to achieve this.. Bring up this question in today's session lets discuss...
     
    #30
  31. Shivi Agarwal_1

    Alumni

    Joined:
    Apr 30, 2019
    Messages:
    13
    Likes Received:
    0
    Hi Sasi,

    I created pipeline project.. is it possible if i can auto schedule the specific stages (in case of failure) to run again or if i can manually run the pipeline from a specific stage ? i don't see any option there .
     
    #31
  32. Shivi Agarwal_1

    Alumni

    Joined:
    Apr 30, 2019
    Messages:
    13
    Likes Received:
    0
    Requirent - is to call a sql procedure to run which accepts 3 parameter. 2 Paremeters can be hardcoded here and 1 parameter, i want to be fetched from environment variable. Please note that This 3rd variable wanting to be available from a list/array and will be changed for each call to the proc and i want jenkins to decide if it has available executor , fetch the 3rd variable from the defined list (Ofcourse which has not be run in this build) and build.

    Please guide on this.
     
    #32
  33. UPASANA DHINGRA

    Joined:
    Apr 25, 2019
    Messages:
    9
    Likes Received:
    0
    hi Sasi,

    I am getting below error while running a pipeline build job using groovy script, can you pls advise

    upload_2019-6-6_14-33-44.png
     
    #33
  34. UPASANA DHINGRA

    Joined:
    Apr 25, 2019
    Messages:
    9
    Likes Received:
    0
    hi Sasi

    Getting error on executing below cmds . Can you pls advise

    ansible all –a “uptime”.
    ansible all -m shell –a "uptime"

    upload_2019-6-7_0-3-23.png


    upload_2019-6-7_0-3-33.png
     
    #34
  35. UPASANA DHINGRA

    Joined:
    Apr 25, 2019
    Messages:
    9
    Likes Received:
    0
    hi Sasi,

    not able to start apache2. Getting below error. Can you pls advise

    upload_2019-6-7_14-22-17.png

    upload_2019-6-7_14-23-19.png
     

    Attached Files:

    #35
  36. Sasidharan_2

    Sasidharan_2 Customer
    Customer

    Joined:
    Mar 28, 2019
    Messages:
    20
    Likes Received:
    1
    This happens when the rpm db of application corrupts or when you try reinstall many times. So a clean uninstall rpm db refresh would solve this.
     
    #36
  37. Sasidharan_2

    Sasidharan_2 Customer
    Customer

    Joined:
    Mar 28, 2019
    Messages:
    20
    Likes Received:
    1
    Only Git is specified the URL is missing.
     
    #37
  38. Sasidharan_2

    Sasidharan_2 Customer
    Customer

    Joined:
    Mar 28, 2019
    Messages:
    20
    Likes Received:
    1
    Manually running a pipeline from specific stage is possible in build pipeline plugin.
    Scheduling/cron is possible on the entire job level not at stages, but during stages you can trigger pipeline jobs with parameter refer the below link.
    https://jenkins.io/doc/pipeline/ste...rigger/#-triggerremotejob- trigger remote job
     
    #38
  39. UPASANA DHINGRA

    Joined:
    Apr 25, 2019
    Messages:
    9
    Likes Received:
    0
    Getting below error now.

    upload_2019-6-8_19-22-22.png
     
    #39
  40. UPASANA DHINGRA

    Joined:
    Apr 25, 2019
    Messages:
    9
    Likes Received:
    0
    hi Sasi,

    not able to connect to mysql. Can you pls advise

    upload_2019-6-9_15-11-52.png


    upload_2019-6-9_15-12-12.png
     
    #40
  41. ELOUNDOU JOSEPH BAREL

    Joined:
    Apr 23, 2019
    Messages:
    1
    Likes Received:
    0
    Hi Sasi, i've an issue with the lab was facing internet issue while traveling to another country seem launch it several time unable to connect. Now having a message saying i've exceeded the access limit.
    upload_2019-6-9_9-37-48.png
     
    #41
  42. Kartikeya Sinha_1

    Joined:
    Mar 28, 2019
    Messages:
    12
    Likes Received:
    1
    Shivi Says:
    Hi Sasi,

    As conveyed during the session that i am trying to push docker image to hub using jenkins pipeline but both(docker/jenkins) installed on two different machine. As method suggested by you was giving me authorization issue, so i tried using shell in pipeline. Below is the code. Kindly confirm if this will have any drawbacks. However this was successful

    pipeline {
    environment {
    registry = 'agarwalshivi25/myjenproj1'
    registryCredential = 'mycredsdh'
    dockerImage = ''
    }
    agent {label 'slavenode'}
    stages {
    stage('Cloning Git') {
    steps {
    git 'https://github.com/SimplilearnDevOpsOfficial/DockerizeJenkins.git'
    }
    }
    stage('Building image') {
    steps{
    script {
    sh label: '', script: '''
    echo $WORKSPACE
    echo $BUILD_NUMBER
    echo 'agarwalshivi25/'"$JOB_NAME"":$BUILD_NUMBER"
    cd $WORKSPACE
    docker build -t $JOB_NAME .
    docker tag $JOB_NAME":latest" agarwalshivi25/"$JOB_NAME"":$BUILD_NUMBER"
    '''

    }
    }
    }
    stage('Pushing image') {
    steps{
    script {
    sh label: '', script: '''
    docker push agarwalshivi25/"$JOB_NAME"":$BUILD_NUMBER"
    '''

    }
    }
    }

    }
    }
     
    #42
  43. Sasidharan_2

    Sasidharan_2 Customer
    Customer

    Joined:
    Mar 28, 2019
    Messages:
    20
    Likes Received:
    1
    Please raise a support ticket to extend the lab hours.
     
    #43
  44. Sasidharan_2

    Sasidharan_2 Customer
    Customer

    Joined:
    Mar 28, 2019
    Messages:
    20
    Likes Received:
    1
    Code looks good. Hope you have taken care of installing git and docker in Jenkins agent node.
     
    #44
  45. Sasidharan_2

    Sasidharan_2 Customer
    Customer

    Joined:
    Mar 28, 2019
    Messages:
    20
    Likes Received:
    1
    Please validate the ip of the container .. Ensure 172.17.0.2 is your mysql container IP , if not use a docker inspect containername/ID to determine the right IP.
     
    #45

Share This Page