Issue to install the DB2 Plugin
search cancel

Issue to install the DB2 Plugin

book

Article ID: 401399

calendar_today

Updated On:

Products

Zowe

Issue/Introduction

You tried to install the DB2 plugins from the zowe-cli-plugins-version package and encountered this error :


_____ Validation results for plugin '@zowe/db2-for-zowe-cli' _____

*** CmdError: Failed to combine command definitions. Reason = Encountered an error loading one of the files (cli/call/Call.definition.js) that matched the provided command module glob for the glob **/cli/*/*.definition!(.d).*s: Could not locate the bindings file. 
 
This plugin has command errors. No plugin commands will be available.

Environment

Windows O/S

 Zowe CLI (7.29.10)

db2-for-zowe-cli 

Cause

IBM introduced an error in their DB2 ODBC install script.That install script worked in past versions of the install script. IBM corrected the problem in the latest version of their install script. However, Zowe CLI 7.29.10 uses the version of the IBM ODBC install script that has the problem.

Resolution

You do NOT have to compile the ODBC driver. You can force the ODBC installer script to do the right thing by setting an additional environment variable.

  • Download compatible version of the DB2 ODBC driver (for example for DB2 version 12, download ODBC_CLI v12.1  ) 
  • Disconnect your laptop from your network during the Zowe installation to ensure that you retrieve nothing from the internet.
  • Install the same self-contained bundle  for example :(2.18.2) of Zowe CLI (7.29.10) and db2-for-zowe-cli 

You should be able to install the db2-for-zowe-cli plugin again.

  • Follow the same Zowe instructions for installing the "IBM® Db2® Database Plug-in for 
    Zowe CLI"  but add one more step.
  • There is a step in the instructions that tells you to set the IBM_DB_INSTALLER_URL. Continue to do that step, for example:

set IBM_DB_INSTALLER_URL=C:\odbc_cli

  • Immediately after that step, also set a second environment variable. Type the command exactly as below. The value of the variable is a period (.). This second environment variable was not needed in earlier versions of IBM's DB2 ODBC driver install script. It will not be needed after Zowe upgrades to newer versions of the DB2 ODBC driver install script. However, for the current release, the following, second environment variable is needed to make the DB2 ODBC driver install script do the right thing.

set npm_config_clidriver=.

  • Complete the remainder of Zowe's documented instructions.

Note the syntax for setting up the environment variables are different, for example, 

Using powershell

$env:IBM_DB_INSTALLER_URL="fullPathToZip"
$env:npm_config_clidriver="."

Using bash:

export IBM_DB_INSTALLER_URL="fullPathToZip"
export npm_config_cli_driver="."

By taking these actions, the installation of the DB2 plugin will complete successfully and will display the following results:

> zowe plugins install db2-for-zowe-cli.tgz
Plug-ins within the Imperative CLI Framework can legitimately gain
control of the zowe CLI application during the execution of every command.
Install 3rd party plug-ins at your own risk.

Registry = https://registry.npmjs.org/

_______________________________________________________________
Installed plugin name = '@zowe/db2-for-zowe-cli'

_____ Validation results for plugin '@zowe/db2-for-zowe-cli' _____
This plugin was successfully validated. Enjoy the plugin.

 

> zowe plugins list

Installed plugins:

 -- pluginName: @zowe/db2-for-zowe-cli
 -- package: @zowe/db2-for-zowe-cli
 -- version: 5.0.13
 -- registry: https://registry.npmjs.org/

 

Use the following command to check if the plug-in was installed successfully:

zowe plugins validate
zowe db2 --help

If there are errors, manually run the driver install script: 

For windows, replace "<zoweHomeDir>" with your Zowe CLI home directory (for example "C:\Users\User\.zowe").

cd <zoweHomeDir>\plugins\installed\lib\node_modules\@zowe\db2-for-zowe-cli\node_modules\ibm_db
node installer\driverInstall.js

For Linux/Mac, replace "<zoweHomeDir>" with your Zowe CLI home directory (for example "~/.zowe").

cd <zoweHomeDir>/plugins/installed/lib/node_modules/@zowe/db2-for-zowe-cli/node_modules/ibm_db
node installer/driverInstall.js