zowe / zowe-cli-db2-plugin

DB2 Plugin for the Zowe CLI
Eclipse Public License 2.0
8 stars 14 forks source link

Plugin becomes unusable after an update of @zowe/cli #76

Closed FALLAI-Denis closed 1 year ago

FALLAI-Denis commented 3 years ago

When updating @zowe/cli by npm, a validation phase of the Zowe plugins is triggered. Validating the @zowe/db2-for-zowe-cli plugin triggers error messages:

_____ 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 function glob (pattern, options, cb) {
  if (typeof options === 'function') cb = options, options = {}
  if (!options) options = {}

  if (options.sync) {
    if (cb)
      throw new TypeError('callback provided to sync glob')
    return globSync(pattern, options)
  }

  return new Glob(pattern, options, cb)
}: Could not locate the bindings file. Tried:
 → C:\Users\userid\.zowe\plugins\installed\node_modules\@zowe\db2-for-zowe-cli\node_modules\ibm_db\build\odbc_bindings.node
 → C:\Users\userid\.zowe\plugins\installed\node_modules\@zowe\db2-for-zowe-cli\node_modules\ibm_db\build\Debug\odbc_bindings.node
 → C:\Users\userid\.zowe\plugins\installed\node_modules\@zowe\db2-for-zowe-cli\node_modules\ibm_db\build\Release\odbc_bindings.node
 → C:\Users\userid\.zowe\plugins\installed\node_modules\@zowe\db2-for-zowe-cli\node_modules\ibm_db\out\Debug\odbc_bindings.node
 → C:\Users\userid\.zowe\plugins\installed\node_modules\@zowe\db2-for-zowe-cli\node_modules\ibm_db\Debug\odbc_bindings.node
 → C:\Users\userid\.zowe\plugins\installed\node_modules\@zowe\db2-for-zowe-cli\node_modules\ibm_db\out\Release\odbc_bindings.node
 → C:\Users\userid\.zowe\plugins\installed\node_modules\@zowe\db2-for-zowe-cli\node_modules\ibm_db\Release\odbc_bindings.node
 → C:\Users\userid\.zowe\plugins\installed\node_modules\@zowe\db2-for-zowe-cli\node_modules\ibm_db\build\default\odbc_bindings.node
 → C:\Users\userid\.zowe\plugins\installed\node_modules\@zowe\db2-for-zowe-cli\node_modules\ibm_db\compiled\12.16.2\win32\x64\odbc_bindings.node
 → C:\Users\userid\.zowe\plugins\installed\node_modules\@zowe\db2-for-zowe-cli\node_modules\ibm_db\addon-build\release\install-root\odbc_bindings.node
 → C:\Users\userid\.zowe\plugins\installed\node_modules\@zowe\db2-for-zowe-cli\node_modules\ibm_db\addon-build\debug\install-root\odbc_bindings.node
 → C:\Users\userid\.zowe\plugins\installed\node_modules\@zowe\db2-for-zowe-cli\node_modules\ibm_db\addon-build\default\install-root\odbc_bindings.node
 → C:\Users\userid\.zowe\plugins\installed\node_modules\@zowe\db2-for-zowe-cli\node_modules\ibm_db\lib\binding\node-v72-win32-x64\odbc_bindings.node

This plugin has command errors. No plugin commands will be available.

Actions:

Strange ?

This is not the first time that the @zowe/db2-for-zowe-cli plugin become unusable and requires a complete uninstall / reinstallation.

FALLAI-Denis commented 3 years ago

I think the problem comes from the fact that the ODBC driver needed to install the plugin no longer exists at the location referenced at the time of the first installation.

Apparently, the installation process rebuilds part of the plugin, which in fact poses problems when changing the version of npm: during validation, the plugin detects a version inconsistency on npm.

connorpekovic commented 2 years ago

Hi Denis!

I'm fairly young and new to the Zowe project, so I haven't looked at the code base yet. May I ask, how exactly did you uninstall for the @zowe/db2-for-zowe-cli? I entered npm uninstall --global @zowe/db2-for-zowe-cli and npm uninstall @zowe/db2-for-zowe-cli way down below and the output says up to date.

I need to give you the proper amount of context, so before I entered the following commands I went nuclear and:

Then I install the Zowe CLI from scratch:

db2-for-zowe-plugin-install-3

Where I differ from you must be how I uninstall the Db2 package. If you are confused too, give me a confused emoji 😕

Like a good neighbor, Connor

t1m0thyj commented 2 years ago

@connorpekovic Have you downloaded the ODBC driver before installing the DB2 plugin from a TGZ, as documented here? https://docs.zowe.org/stable/user-guide/cli-db2plugin#installing-from-a-local-package

connorpekovic commented 2 years ago

@t1m0thyj I have not, working on that now, thanks.

zFernand0 commented 1 year ago

Hey @connorpekovic, Did the issue go away after downloading the ODBC driver before installing? If so, can we close this issue?

connorpekovic commented 1 year ago

Please close the issue. Sadly, I'm not with the organizing that runs on Z anymore.