Monday, August 6, 2018

Vagrant

Introduction

Vagrant provides easy to configure, reproducible, and portable work environments built on top of industry-standard technology and controlled by a single consistent workflow to help maximize the productivity and flexibility. A brief wave crest specific introductory presentation is also available. 

Details

One can follow the below procedure to get and use a vagrant based box.

Prerequisites 

  1. Download latest vagrant VM image from: \\10.10.10.8\software\Vagrant\Platform2.0_1.5  to your local machine.  One can refer to image version specific notes for more details. 
  2. Download prerequiste software to run vagrant. We need vagrant tool version 1.6.5 and Virtual Box version 4.3.18-96516-Win for this. These two softwares are also available at: \\10.10.10.8\software\Vagrant . After installing these two, one has to make sure these are present in PATH.
    E:>echo %PATH%
    C:\Program Files\Java\jdk1.6.0_23\bin;C:\Windows\system32;C:\Program Files\Code Collaborator Client;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Oracle\VirtualBox;E:\HashiCorp\Vagrant\bin
  3. Optional: Please install fastCopy tool to transfer the Vagrant Images quickly from network location to local working area. You can grab the installation file from: \\10.10.10.8\software\Vagrant\FastCopy211_x64.zip Usage and other details are at: http://ipmsg.org/tools/fastcopy.html.en

Creating Vagrant VM 

  • One has to create a work directory for vagrant in his/her code checkout area, specifically at his Platform directory. For example,

    If your code is present at E:\Code\PlatForm2.0, you directory structure would look like this after creating work area for vagrant.


  • One can follow the below steps to download/add, initialize, starting the box in windows command prompt. You can go to vagrant work area (e.g. E:\Code\Platform2.0\vagrantWorkArea) and execute the following. Let us assume you have downloaded vagrant image to your downloads directory. 
      $ vagrant box add {title} {DownlaodedImageLocation}

     Example,

    E:\Code\Platform2.0\vagrantWorkArea> vagrant box add myBox C:\\Users\\foo\\Downloads\\Platform2.0_1.1
     $ vagrant init {title}
    Example:
     E:\Code\Platform2.0\vagrantWorkArea> vagrant init myBox

  1. This will create a file entitled "Vagrantfile", which is a config file for VM.
     $ vagrant up
     In our example,

     E:\Code\Platform2.0\vagrantWorkArea> vagrant up
    Note:
    vagrant up may fail if you do not have localrepo directory in your home directory.
    So create one like /home/wcuser/localrepo in the home directory
    Example:
       E:\home\wcuser\localrepo

    (info)  One can use multiple VM boxes by creating different directories and repeat the steps mentioned above from each directory.
    When creating a new vagrant box with latest image,
    a) Please make sure you run the following commands at your windows command prompt from vagrant work area.
            1. vagrant box remove NAMEOFVM  E.g. vagrant box remove myVm
            2. vagrant destroy
    followed by
    b) Deleting your vagrant work directory contents in source code area.
    E.g. If your existing vagrant work area is at D:\Code\Platform2.0\VmWorkArea, please delete the contents (specifically a directory called .vagrant and a file called Vagrantfile)
    c) Giving a new name to your vagrant VM.  E.g.:  If you had givem myVm as your VM name, please choose a new one like myNewVm

Accessing Guest OS (VM) 
  • One can use putty to logon to this box with the following credentials.
    Username: wcuser / root
    Pass: wcuser /vagrant
    Host: localhost 
    port: 2222 
    Please refrain from using root user on Vagrant VM box. wcuser was given sudo access for almost all activities.

  • Database Details
     Db Schema: localpaycental
     UserName :  wcuser/root
     Pass: wcuser@123/wcuser@123
  • ekmi Details
     Instace Name: localekmi
(info)  If one is running multiple boxes on a given host machine, the port number for the second box will be 2200 or some thing like that. This will be shown when you run vagrant up command.

Building artifacts using gradle

         Download gradle-1.10
         Append gradle's /bin folder path to environment PATH variable
         cd to the SVN check out folder (ex: D://Platform2.0)
         Run the gradle build command: $ gradle -x test buildAll

    Installing middlewares and gems

         Connect to vagrant using putty as wcuser
         Update the installation in vagrant box
                  Run the command: ./automation/opstools/copysoftware.sh
                  Install gems : $ ./automation/opstools/setupgems.sh
                  Installs binaries: cd /home/wcuser/automation/tools and /usr/local/bin/thor middlewaremgmt:software LocalVagrantplatform2.0

Note : In the new vagrant image, synced_folders are not included by default. If you are not able to see files under automation folder add these lines to _Vagrantfile files
          config.vm.synced_folder "/home/wcuser/localrepo", "/home/wcuser/localrepo"
          config.vm.synced_folder "./../devtools/automation", "/home/wcuser/automation"
          config.vm.synced_folder "../orchestration/httpd", "/home/wcuser/httpd"
Restart vagrant using ( vagrant halt -f and vagrant up) commands

Deployment of artifacts 
One has to pick any one of the below methods to update database and deploy the artifacts. Method A is a brief one where as Method B is in detail of each and every step.
Method A

  $  dos2unix /home/wcuser/automation/tools/localEnvUp.sh
  $  sh /home/wcuser/automation/tools/localEnvUp.sh
(Please enter 'wcuser' as password for wcuser during execution)

           Method B
  • One time activity:   $rm -f /opt/redis-2.6.7/bin/redis.pid (when you bring vagrant up for the first time)
  • To update DB, one can use below command
  $  cd /home/wcuser/automation/tools
  $  dos2unix dbinitupdate.rb
  $  dos2unix profiles/*
    $   New dbupdate  (./dbinitupdate.rb  LocalVagrantplatform20 5.2.1.58676 jdbc:mysql://localhost:3306/ false migrate all)
  $ Old dbupdate ( ./executeFlyway.sh jdbc:mysql://localhost:3306/ false migrate LocalVagrantplatform20 (for migration) )
  • To deploy, one can use the following commands
  $  cd /home/wcuser/automation/tools

  $  dos2unix profiles/*

  $  ruby platformDeployment.rb ymlFilename versionNumber ( ruby  platformDeployment.rb LocalVagrantplatform20 5.2.1.58676)
  $  ./provision.sh LocalVagrantplatform20 local remote appinit        (Enter 'wcuser' as password if asks)
 


This step (i.e. deployment of artifacts) needs to repeated every time you bring the VM up  or would like to deploy latest assets
Running Java Batch Job (Optional)
 One can run java batch jobs using the following steps.
  $  dos2unix /home/wcuser/automation/tools/localEnvBatchInit.sh  
  $  sh /home/wcuser/automation/tools/localEnvBatchInit.sh
(tick)    It will take few minutes to bring the application up after deployment. Please wait for 10 minutes or so to access the following services.
       Restart httpd
        $ sudo cp httpd-static/*  /etc/httpd/conf.d/
        $ /etc/init.d/httpd restart
switch between branch and trunk
$ ln -s trunk/ httpd-static
$ unlink httpd-static
$ ln -s Branch/ httpd-static
Hot Deployment
The idea is to use the existing services from local vagrant VM with local tomcat (on windows). Please follow the below steps.
      Step1: Stop mysql windows service which is running on your work station (laptop or desktop) and make it's starting mode is as manual.                    
       Step2: Modify existing vagrant file in your vagrant work area to map VM's MySql port (3306) ,DE port (7186) and MasterDataService(MDS) port to the same port in host.
                       Add below two lines in vagrant file
            config.vm.network :forwarded_port, guest: 3306, host: 3306
                       config.vm.network :forwarded_port, guest: 7186, host: 7186
                       config.vm.network :forwarded_port, guest: 8085, host: 8085
                       and reload the vagrant box.
       Step3: Start local tomcat (on Windows) on port#9090.
After this, bring Vagrant VM up followed by the following command. (It selectively brings all services up except tomcat)
    sh /home/wcuser/automation/tools/localMiddlewareUp.sh   localWindowsIPAddress 
Accessing Services
  • In our example,

     E:\Code\Platform2.0\vagrantWorkArea> vagrant halt -f 
  •  E:\Code\Platform2.0\vagrantWorkArea> vagrant up 

  •  
           VM Suspend & Resume
  • $ vagrant suspend  #Saves VM state where it is.
  • $  vagrant resume #VM resumes from from where it was saved by suspend command..

  • A suspend effectively saves the exact point-in-time state of the machine, so that when you resume it later, it begins running immediately from that point, rather than doing a full boot.


  • Running Smoke Tests
           A separate document is available for this.

Additional Information

Sharing data between Host and Guest 
  • To transfer data between host and guest machines, one has to keep the files in the created work folder. These will appear automatically in /vagrant directory from guest OS.  
            For example, on Host
E:\Code\Platform2.0\vagrantWorkArea> dir
 Directory of E:\workarea
07/03/2013  01:59 PM    <DIR>          .
07/03/2013  01:59 PM    <DIR>          ..
07/03/2013  01:07 PM    <DIR>          .vagrant
07/03/2013  01:59 PM    <DIR>          dataToBeCopied
07/03/2013  01:06 PM             4,454 Vagrantfile
    The equivalent directory in guest looks like
[wcuser@localhost ~]$ ls -al /vagrant
total 13
drwxrwxrwx   1 vagrant vagrant 4096 Jul  3 08:29 .
dr-xr-xr-x. 23 root    root    4096 Jul  3 07:39 ..
drwxrwxrwx   1 vagrant vagrant    0 Jul  3 08:29 dataToBeCopied
drwxrwxrwx   1 vagrant vagrant    0 Jul  3 07:37 .vagrant
-rwxrwxrwx   1 vagrant vagrant 4454 Jul  3 07:36 Vagrantfile
Port Forwarding
      Forwarded ports allow anyone to access a port on one's host machine and have all data forwarded to a port on the guest machine.
For example: If the guest machine is running a web server listening on port 80, one can make a forwarded port mapping to port 8080 (or anything) on one's host machine. One can then open browser to localhost:8080 and browse the website, while all actual network data is being sent to the guest.
By default, the following forwarded port mapping is configured in given vagrant box.
GuestHost
80808080
80208020
91609160
6161661616
63796379
12341234
443443
33063307
80858085

(info)  Note
:  One can change the existing port mapping in the corresponding Vagrantfile of that box, which is present in the work area. One has to modify the mapping line which looks like the following and reload the vagrant box.
    config.vm.network :forwarded_port, guest: 8080, host: 8080  
To reload a vagrant box,one can issue the following from work-area directory.
         shutdown the box using vagrant halt -f command and bring it up using the command: vagrant up
Updating Softwares in Vagrant Box
             See Here
        Disabling Password Prompt 
            See Here 
        Configure Mail Client (postfix)
           See Here 
        Add JCE Support
        Add Card Number generation key sets to Redis
Troubleshooting Issues

Troubleshooting FAQs

  • I have an issue with port#443 while mapping. How to solve this issue?
    You can check which service is holding up that port by using netstat -tuplen command at the command prompt. You may close that to relieve that port. Perhaps, Skype might be the culprit.
    • One has to un-check the alternative ports of incoming connections in Skype. As port# 443 will be used by Vagrant tool.
      Navigation Steps: Tools –> Options  --> Advanced --> Connection
  • I have an issue with port#ABCD during/after mapping. How to solve this issue?
    You can change the existing port mapping by changing it in the Vagrantfile which is present in your vagrant work area. One has to modify the mapping line which looks like the following and reload the vagrant box.
    config.vm.network :forwarded_port, guest: 8080, host: 8080  
    To reload a vagrant box,one can issue the following from work-area directory.
    • shutdown the box using vagrant halt -f command and
    • bring it up using the command: vagrant up

      For some reason, if that port is not available on host machine, you can follow the below steps to debug the issue.
    1. You can check if a given process listens on mentioned port with netstat command first. E.g.  netstat -tuplen  on guest machine. [i.e. VM]
    2. Then, when you do vagrant up, vagrant tool shows list of ports it has mapped like the following.
      [default] Forwarding ports... 
      [default] -- 22 => 2222 (adapter 1) 
      [default] -- 8000 => 8888 (adapter 1)
      This is the place to check whether your mapping got configured or not.
    3. If that does not work, to get a verbose debug info from vagrant, please do the following at your windows command prompt. This will print verbose information at the command prompt.

      $ set VAGRANT_LOG=info
      $ vagrant up 
    4. If still problem persists, firewall might be the culprit. Although firewall is disabled on vagrant images, if you enable it for some reason, you have to add an exception to this port in firewall as shown below.
                            As root, do
      $ /sbin/iptables -I INPUT -p tcp --dport 4444 --syn -j ACCEPT
      /sbin/service iptables save
      /sbin/service iptables restart
  • I want to turn off the default port mapping for a port (say port#8080), which bundled with vagrant image. How can I do it?   
    You can do that by changing the vagrant configuration file which bundled with the image. Go to C:\Users\foo\.vagrant.d\boxes\image\virtualbox\include\_Vagrantfile. Replace foo with your userid. Then, you can change the existing port mapping in that file and reload the vagrant box.
    config.vm.network :forwarded_port, guest: 8080, host: 8080  
    To reload a vagrant box,one can issue the following from work-area directory.
    • shutdown the box using vagrant halt -f command and
    • bring it up using the command: vagrant up
     
  • How can I cut down the size of my vagrant box? 

    Please inspect the culprit using
     the following command and clean the unwanted directories appropriately.
    sudo du -sh /* | sort -nr
    If that does not solve the issue, you can run the the following command as wcuser.
    sudo dd if=/dev/zero of=/tmp/ZEROS bs=1M ; sudo rm -f /tmp/ZEROS
  • I can not access vagrant database instance from work station? 
    By default, vagrant based VM's database listening port is mapped to 3307. So, use the following to access it. 
      Db Schema: localpaycentral
      UserName :  wcuser/root
      Pass: wcuser@123/wcuser@123

      Port : 3307
  • I can not create a new database schema as wcuser in VM. It throw an error like 'failed: " " command on localhost'. How to solve that?
    One can grant root like access to normal user on mysql using below steps.
    $ mysql -uroot -pwcuser@123
    mysql> GRANT ALL PRIVILEGES ON *.* TO 'wcuser'@'localhost' IDENTIFIED BY  'wcuser@123' WITH GRANT OPTION;
    mysql> flush privileges;
    mysql> quit;
     
  • Activiti Db is not getting created when I bring local environment up. How to correct it?
    Since activiti database instance creation is one time deployment activity, by default the creation option is disabled. So, one has to activate this option before bringing local environment up. So, please follow the below steps.
            Step1: Open this file:  /home/wcuser/automation/tools/profiles/deployinstanceLocalVagrantplatform20.yml
      
Step2: Go to dbservices section and change active filed from false to true.

 Before
dbservices:
  - name: activiti
    version: 5.12.1
    active: false
    ip: localhost

 After
dbservices:
  - name: activiti
    version: 5.12.1
    active: true
    ip: localhost

        Step3: After saving that file, go ahead with local environment up command. (i.e., sh /home/wcuser/automation/tools/localEnvUp.sh)
        Step4:  (warning)  Once it is done, please change active filed value to false from true
  • There is a run time error "MySQLSyntaxErrorException: Access denied for user 'wcuser'@'localhost' to database 'activitidb'"  while the application is being up. How to solve that?
    One can grant root like access to normal user on mysql using below steps.
    $ mysql -uroot -pwcuser@123
    mysql> GRANT ALL PRIVILEGES ON *.* TO 'wcuser'@'localhost' IDENTIFIED BY  'wcuser@123' WITH GRANT OPTION;
    mysql> flush privileges;
    mysql> quit;
    This has to be followed by bringing environment up again (i.e. using sh /home/wcuser/automation/tools/localEnvUp.sh)
  • When I run localEnvUp.sh command, I ran in to an error, which looks like "/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require': cannot load such file -- mysql (LoadError)". How can I stop that error?
    Please run the following command at your VM's command prompt as wcuser.
    $ sudo yum -y install mysql55-devel ; sudo gem install mysql
    (or)
    $ yum install mysql-devel gcc make; gem install mysql -- --with-mysql-config=/usr/bin/mysql_config


    Now, you can bring the environment up again (i.e. using sh /home/wcuser/automation/tools/localEnvUp.sh)
  • Do I need to run appinit command every time to re-deploy latest artifacts? 
    Yes    
  • Redis service is not running. Also it is not coming up when I run appinit command as well? What should i do? 
    Due to improper shutdown of vm instance, redis pid file will be present. During the next start up call of redis, it creates problems. So, please delete it using 
    $rm -f /opt/redis-2.6.7/bin/redis.pid

    Now, you can go ahead with sh /home/wcuser/automation/tools/localEnvUp.sh command to bring all services up. 
  • How can I install percona tool in my vagrant image?
    Please run the following command at your UNIX command prompt by logging in as wcuser in to your vagrant VM box. 
    $dos2unix /home/wcuser/automation/tools/installPercona.sh; sh /home/wcuser/automation/tools/installPercona.sh;
  • vagrant up hangs at "Waiting for VM to boot. This can take a few minutes". How to get rid of this? 
     Please enable the Virtualization (VT/VT-d) option in your motherboard's BIOS. It is present in the Security -> Virtualization menu.  You may have to update your BIOS software by contacting IT if that option is  not present.
     If that BIOS option does not work for some reason, a way to find the actual culprit is to print vagrant's debug information using the following command and act accordingly. 
    $ set VAGRANT_LOG=info
    $ vagrant upThis will print a verbose information at the command prompt. One can inspect it and get to know the root cause.
  • There is permissions issue while dealing with shared folders between Host and Guest machine for wcuser account. Is there something I can do about? 
    Yes, while sharing the fodlers itself, you can set user specific permissions explicitly on that shared folder as well in Vagrantfile.

    For example, if you have some issue automation and localrepo directories, please add the following two lines below the line   # config.vm.synced_folder "../data", "/vagrant_data"
    in  Vagrantfile which is present in your vagrant work area and reload the vagrant box. 

    config.vm.synced_folder "/home/wcuser/localrepo", "/home/wcuser/localrepo", :owner=> 'wcuser', :group=>'wcuser'
    config.vm.synced_folder "./../devtools/automation", "/home/wcuser/automation", :owner=> 'wcuser', :group=>'wcuser'
         To reaload the VM, please do the following at your windows command prompt from vagrant work area.
  • sh localEnvUp.sh throws an error related to https-static-1.0.tgz. The error looks like "/usr/local/lib/ruby/1.9.1/fileutils.rb:1515:in `stat': No such file or directory - /home/wcuser/localrepo/httpd-static-1.0.tgz (Errno: ENOENT)". What went wrong here? 
     When you do a gradle cleanrepo, gradle removes all the artifacts. When you do gradle build next time, it will not build httpd-static unless you make some change in that. Automation scripts reports missing of that component here. So, if you see this error after gradle cleanrepo, please build this component explicitly, using gradle P --rerun-tasks  command. This will bring httpd-static-1.0.tgz back in local repo. It should solve this error. 
  • Default VM is consuming 2G of total RAM. Is is possible to restrict my VM to use 1G instead? 
    Yes, it is possible. In your vagrant work area, you should be able to find VM's config file called Vagrantfile.  You can change the existing memory value mapping by uncommenting three lines. Check the below table.This step has to be followed by reloading of  the vagrant box.

Before the change   
    # config.vm.provider :virtualbox do |vb|
  #   # Don't boot with headless mode
  #   vb.gui = true
  #
  #   # Use VBoxManage to customize the VM. For example to change memory:
  #   vb.customize ["modifyvm", :id, "--memory", "1024"]
  # end
  #

 After the change
   config.vm.provider :virtualbox do |vb|
  #   # Don't boot with headless mode
  #   vb.gui = true
  #
  #   # Use VBoxManage to customize the VM. For example to change memory:
     vb.customize ["modifyvm", :id, "--memory", "1024"]
   end
  #

To reload a vagrant box,one can issue the following from work-area directory.
  • shutdown the box using vagrant halt -f command and
  • bring it up using the command: vagrant up

References

Connect to vagrant using putty as wcuser
Update the installation in vagrant box
  • Run the command: ./automation/opstools/copysoftware.sh
  • Install gems : ./automation/opstools/setupgems.sh
  • Installs binaries: cd /home/wcuser/automation/tools and /usr/local/bin/thor middlewaremgmt:software LocalVagrantplatform2.0

Monday, July 9, 2018

Troubleshooting Tips



Did the cron run

  1. In /var/log/cron{.1,.2 etc} you will find entried like the one below  -- it tellu that as wcuser the cron job was run at that time and it trigerred the script /opt/WaveCrest etc
  2. We traced this from May 6th onwards – on each day we had entries close to midnight and  21:30 hours.  
  3. So looks like the linux cron did its job of triggering the scripts
  4. So mallik is going to check why the application gave the error – and does the application have a tracing mechanism whcy says “ the script got triggered on this data and time” – so for now we need to trouble shoot the app script and see why there was an exception ,  it does not seem like a OS failed to trigger to cron job

/var/log/cron.1:May  8 21:40:01 wcapp3 crond[12394]: (root) CMD (/usr/lib64/sa/sa1 1 1)
/var/log/cron.1:May  8 21:40:01 wcapp3 crond[12395]: (wcuser) CMD (/opt/WaveCrest/scripts/ach/metabank/return/return_master.sh)
/var/log/cron.1:May  8 21:45:01 wcapp3 crond[12488]: (wcuser) CMD (/opt/WaveCrest/scripts/ach/metabank/mt_settle/mt_settle_master.sh)
/var/log/cron.1:May  8 21:45:01 wcapp3 crond[12487]: (root) CMD (date >> /root/date.txt)
/var/log/cron.1:May  8 21:50:01 wcapp3 crond[12588]: (wcuser) CMD (/opt/WaveCrest/scripts/ach/metabank/load_settle/load_settle_master.sh)
/var/log/cron.1:May  8 21:50:01 wcapp3 crond[12587]: (root) CMD (date >> /root/date.txt)
/var/log/cron.1:May  8 21:54:01 wcapp3 crond[12659]: (root) CMD (date >> /root/date.txt)
/var/log/cron.1:May  8 21:55:01 wcapp3 crond[12666]: (wcuser) CMD (/opt/WaveCrest/scripts/ach/metabank/mt_failed_email/email_master.sh)
/var/log/cron.1:May  8 22:00:01 wcapp3 crond[12712]: (root) CMD (date >> /root/date.txt)
/var/log/cron.1:May  8 22:00:01 wcapp3 crond[12713]: (wcuser) CMD (/opt/WaveCrest/scripts/ach/metabank/mt_settle_email/email_master.sh)



/var/log/cron.1:May  8 22:00:01 wcapp3 crond[12713]: (wcuser) CMD (/opt/WaveCrest/scripts/ach/metabank/mt_settle_email/email_master.sh)

Artifactory Internal Errors

  1. Some time while running the build and it is trying to deploy a new dependency – artifactory gives internal errors saying it cannot save the resource (HTTP 500)
  2. Please login to artifactory directly and see if typing the URL on the brpwser (the one which gave the error) behaves in the same way.
  3. (green star)  Please restart artifactory to solve the problem.

Debugging sql queries

  1. To enable general log :  set GLOBAL general_log=ON ;
  2. To check the path of general log : show variables like '%general_log_file' ;
    Show Variables
    mysql> show variables like '%general_log_file' ;
    +------------------+-------------------------------+
    | Variable_name    | Value                         |
    +------------------+-------------------------------+
    | general_log_file | /var/lib/mysql/newtonvm20.log |
    +------------------+-------------------------------+
    1 row in set (0.00 sec)
  3. Navigate to the path in step 2, you can check the sql queries

Local platform installation and apache forbidden errors

If you get error like below 
Forbidden
You don't have permission to access /v2/tpl/index.html on this server.
Reason IS :  you don't have write permssion on /home/wcuserChange to 755 /home/wcuser  using  chmod 755 /home/wcuser – you need super user permission



Swagger : 500  Internal Server Error

Problem:
Encountered when loading accessing REST API docs from Swagger.
Quick Fix:
The folder by the name jsonapi has a folder by the name .svn and is trying to read the contents.
Delete the folder and reload the page.

Reload
If deleting the folder doesn't fix the problem,
Refresh apisandbox and Restart tomcat and reload the swagger page.

 Redis connection issues on vargrant
Symptoms:
1. org.springframework.dao.DataAccessResourceFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:101)

2. when I tried to restart - it is saying /opt/redis-2.6.7/utils/redis_init_script start
/opt/redis-2.6.7/utils/../bin/redis.pid exists, process is already running or crashed
Cause:
vagrant up itself as vagrant box got corrupted

Solution:
Try this -- i removed pid manually and started the redis successfully
Worstcase -- my redis error is resolved only after removing the existing vagrant box and again re-adding the box

Curl command to test FIS

Here is the trace of curl command from my laptop.
Enter host password for user 'WCa2aTest':
* About to connect() to a2atest.wildcardsystems.com port 443 (#0)
*   Trying 156.55.165.26... connected
* Connected to a2atest.wildcardsystems.com (156.55.165.26) port 443 (#0)
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Request CERT (13):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using RC4-MD5
* Server certificate:
*        subject: C=US; ST=Florida; L=Jacksonville; O=Fidelity National Information Services; OU=FIS - Prepaid; CN=a2atest.wildcardsystems.com
*        start date: 2013-03-11 00:00:00 GMT
*        expire date: 2014-03-12 23:59:59 GMT
*        subjectAltName: a2atest.wildcardsystems.com matched
*        issuer: C=US; O=VeriSign, Inc.; OU=VeriSign Trust Network; OU=Terms of use at https://www.verisign.com/rpa (c)10; CN=VeriSign Class 3 Secure Server CA - G3
*        SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
* Server auth using Basic with user 'WCa2aTest'
> GET /a2a/documentation/toc.htm HTTP/1.1
> Authorization: Basic V0NhMmFUZXN0OldheXZLcmVzdDM5ODI=
> User-Agent: curl/7.21.4 (i386-pc-win32) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: a2atest.wildcardsystems.com
> Accept: */*
>
< HTTP/1.1 403 Forbidden
< Date: Thu, 30 Jan 2014 03:10:57 GMT
< Content-Length: 1913
< Content-Type: text/html
< Server: WWW Server/1.1
< X-Powered-By: ASP.NET

LinkageError when starting Wallet/Admin in Windows

Should you face some error like below
"java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/catalina/loader/WebappClassLoader) previously initiated loading for a different type with name "javax/servlet/FilterChain"
Possible Reasons :  There is some conflict in the classes being loaded. On my IDE, I had Groovy plugin installed and there was a version mismatch between some jars. So, I tried uninstalling the plugins and tomcat was up successfully.
I was running Jdk_1.6


Skip to end of metadata
Go to start of metadata

Tomcat threads

All the threads in a threaddump marked as "http-"  are your potential tomcat managed server threads for request processing – 
1. Out of all the threads with http – you can see many classes of them
a. Threads processing requests actively
b. Threads idle in the pool - -something like a socketRead etc and waiting to process future requests
c. Also there will be some which are there for handling persistent socket connections between apache and tomcat – I think the ajp or the http type connections
d. Also there may be difference in thread handling when u use blocking socket vs non-blokcing (different connectors I think)

Tomcat threads vs Threads in the Threads dump

Actually you can do this – take a thread dump at the JVM level
You OS level thread count that you are reporting will be close to that and will consist of the following
1. Currently used tomcat threads (in the thread dump grep for thread names starting with http-“
2. All the frameworks internally used start their own threads – for example bone and c3po connection pool have their owne threads
3. Internal JVM gc threads
4. Other app threads
5. Etc
So the sum will reflect all these


Skip to end of metadata
Go to start of metadata
Issue 1: Checksum error while committing a file:

Whenever you try to check-in a file and encountered the checksum issue, there are two ways to resolve it.
  1. Remove the original file from main repository (you need BCM help to remove) and add your latest changes as a new file.
    Or
    You can go to the mentioned file: ...\.svn\text-base\MasterPropsDao.java.svn-base file and make it sync with your latest file.
  2. clean up the project
  3. commit changes




Skip to end of metadata
Go to start of metadata
We can use the tool "Tattletale" for generating the following dependencies and  reports, so that it would help us to analyse the application and make us to take decision in keeping the correct JARs as part of the War file.

Dependencies

Reports

Steps to Install and generate the reports:

  1. Download the zip file from below location :
    http://www.mastertheboss.com/jboss-application-server/216-jboss-client-jar.htm
  2. Unzip the above zip file and CD to the unzip directory.
  3. Run the below command to generate the reports
    java -Xmx512m  -jar jboss-tattletale.jar  /home/wcuser/O2-Cashier/webapps/cashier/WEB-INF/lib/ /tmp/output
  4. Open the index.html file in output folder to view the reports/results.


Skip to end of metadata
Go to start of metadata
http://prefetch.net/blog/index.php/2006/10/28/dumping-http-requests-and-reponses-to-the-apache-error-log/
To enable the module, you will first need to load the module with “LoadModule” directive. Once the module is configured to load, you can add the “DumpIOInput On” directive to to dump incoming data, and “DumpIOOutput On” to dump data sent by Apache
mod_dumpio allows for the logging of all input received by Apache and/or all output sent by Apache to be logged (dumped) to the error.log file.
The data logging is done right after SSL decoding (for input) and right before SSL encoding (for output). As can be expected, this can produce extreme volumes of data, and should only be used when debugging problems.

Changes to /etc/httpd/conf/httpd.conf

Load module DUMP IO
------------------------
LoadModule dumpio_module modules/mod_dumpio.so

Changes to /etc/httpd/conf.d/httpd_*.conf

Enable logging add to virutal host 
------------------------------------
DumpIOOutput On
DumpIOInput On
 DumpIOLogLevel debug
How to Check for loaded module
-----------------------------------------------
apachectl -t -D DUMP_MODULES | grep dump

Be Careful in Enabling this particular level of logging. This particular log level churned out logs of 265 Gigs and the server stopped responding.
Log level Warning
[wcuserro@plapp1 logs]$ ls -alh
total 264G
drwxrwxr-x 2 wcuser wcuser 4.0K Oct 26 09:13 .
drwxrwxr-x 14 wcuser wcuser 4.0K Dec 1 13:37 ..
-rwxrwxr-x 1 wcuser wcuser 864K Dec 3 12:35 httpd-static-access.log
-rwxrwxr-x 1 wcuser wcuser 264G Dec 3 12:13 httpd-static-error.log
-rwxrwxr-x 1 wcuser wcuser 804K Dec 3 12:35 httpd-static_ssl_request_log
-rwxrwxr-x 1 wcuser wcuser 3.4M Dec 3 12:35 rewrite.log
[wcuserro@plapp1 logs]$ less httpd-static-error.log
[wcuserro@plapp1 logs]$

Security Certificates

  1. Cryptography Basics Understand Key Concepts : Encryption, decryption, hashing, and digital signatures. Key terms: confidentiality, inte...