No classes or missing classes in static analysis

Is the controller service down or disconnected?

See Controller for more details

Is the viper service down?

Check the service status: sudo service vf-viper-<instance_name> status

In Sudoless installation:

[inst. dir]/opt/vfunction/viper/instances/default/bin/vf-viper-<instance_name> status

Example:

sudo service vf-viper-default status

Is viper configured correctly?

  • Check the path under viper in /etc/sysconfig/vfunction/installation/instances/{instance-name}/installation.yaml The path should be the exact location where the binaries exist

To apply the changes in installation.yaml, run /opt/vfunction/controller-installation/upgrade.sh

  • In the vFunction web-UI, open the Configure Parameters (Analysis Page) and ensure the Classes to include is set correctly

Is the right version of binaries provided to Viper?

If you get a notification that classes found in the dynamic analysis (putting aside auto generated classes), it might be that viper is using a version of the binaries that doesn’t match the version used for learning by the agent.

Check the path under viper in /etc/sysconfig/vfunction/installation/instances/{instance-name}/installation.yaml and make sure you have the correct version of binaries that match the version deployed for learning.

If needed copy the correct version of the binaries to the path and restart viper - the static data will be updated automatically.

Is the correct controller selected for the app?

The server supports getting static data from a single controler per app. If multiple controllers are configured for the app, one of them is selected randomly. This can cause inconsistencies between dynamic and static analysis as well as missing classes.

So it is recommended to select a single controller during the analysis phase and ensure viper is configured correctly for that controller.

Selecting a controller can be done in the Learning page (Select Controllers action)

Once you select the right controller, re-run the analysis to refresh the static data (no need to do Learning again)

Setting debug mode for viper (static analysis) and getting the logs

If there are missing classes in the analysis or other issues in the static analysis, then it could be useful to obtain a debugging log for viper to diagnose the issue

  1. View the viper log: /var/log/vfunction/instances/default/vfviper.log to see if there is some useful information there. If needed, proceed to turn on debug mode and re-run viper

Note: In sudoless installation the log is under the vfunction installation dir.

  1. If you are using vFunction controller version 2.3 or newer:
  • Edit the installation.yaml file of the controller (/etc/sysconfig/vfunction/installation/instances//installation.yaml in sudo installation)
  • Add the lines:
viper:
  debug_mode: true

Note: make sure to have two spaces to indent debug_mode:true line

  • Run upgrade.sh (/opt/vfunction/controller-installation/upgrade.sh in sudo installation)
  1. If your controller version is lower than 2.3:
  • If you have a sudo installation edit the file: /etc/init.d/vf-viper-{{instance_name}} (e.g. do: sudo vi /etc/init.d/vf-viper-default)

  • If you have a sudoless installation edit the file: [install dir]/etc/sysconfig/vfunction/viper/instances/default/vf-viper

  • Add debug flags to VF_VIPER_JVM_PARAMS: -Dlogging.level.com.vfunction.resrepo=DEBUG -Dlogging.level.org.springframework.web.filter.CommonsRequestLoggingFilter=DEBUG -DmaxLogLength=10000000

Example:

export VF_VIPER_JVM_PARAMS="-Xms300m -Xmx3g -Xss50m -Djava.io.tmpdir=$VF_VIPER_TEMP_DIR -Dlogs_dir=$VF_LOG_DIR -Dlogging.level.com.vfunction.resrepo=DEBUG -Dlogging.level.org.springframework.web.filter.CommonsRequestLoggingFilter=DEBUG -DmaxLogLength=10000000"

Doing an upgrade to the install will override the debug flags (you need to restart viper explicitly instead, on the other hand it is an easy way to turn off the debug flags)

  • Restart the viper service, e.g., do a command like:

Sudo installation:

sudo service vf-viper-default restart

Sudoless installation:

[install dir]/opt/vfunction/viper/instances/default/bin/vf-viper restart
  1. Go to the vFunction web ui and make a change (e.g. to a config param) to rerun the analysis
  2. View the viper log again (see #1 above)

Deleting compile time analysis data and restarting clean

To delete all data and restart viper do:

  1. Clean data
rm -rf /opt/vfunction/viper/instances/default/viper-data/cda$*
  1. Restart the controller:
bash /opt/vfunction/controller-installation/upgrade.sh