chaostoolkit-kubernetes icon indicating copy to clipboard operation
chaostoolkit-kubernetes copied to clipboard

Failed to discover chaostoolkit-kubernetes

Open Xat59 opened this issue 4 years ago • 1 comments

First, I've successfully installed chaostoolkit and chaostoolkit-kubernetes from pip in my venv :

⇒  python3 -m venv chaostk
⇒  source chaostk/bin/activate
⇒  pip install chaostoolkit
⇒  pip install chaostoolkit-kubernetes

I am trying to use chaostoolkit-kubernetes on my k8s cluster, but I always get the following errors :

⇒  which chaos
~/venv/chaostk/bin/chaos
⇒  chaos --verbose discover chaostoolkit-kubernetes
[2020-10-28 11:05:33 DEBUG] [cli:74] ###############################################################################
[2020-10-28 11:05:33 DEBUG] [cli:75] Running command 'discover'
[2020-10-28 11:05:33 DEBUG] [cli:79] Using settings file '/home/xat/.chaostoolkit/settings.yaml'
[2020-10-28 11:05:33 DEBUG] [settings:26] The Chaos Toolkit settings file could not be found at '/home/xat/.chaostoolkit/settings.yaml'.
[2020-10-28 11:05:33 INFO] [package:22] Attempting to download and install package 'chaostoolkit-kubernetes'
[2020-10-28 11:05:34 DEBUG] [package:31] Requirement already up-to-date: chaostoolkit-kubernetes in /home/xat/venv/chaostk/lib/python3.8/site-packages (0.24.0)
    Requirement already satisfied, skipping upgrade: pyyaml in /home/xat/venv/chaostk/lib/python3.8/site-packages (from chaostoolkit-kubernetes) (5.3.1)
    Requirement already satisfied, skipping upgrade: chaostoolkit-lib>=0.20.0 in /home/xat/venv/chaostk/lib/python3.8/site-packages (from chaostoolkit-kubernetes) (1.15.0)
    Requirement already satisfied, skipping upgrade: dateparser in /home/xat/venv/chaostk/lib/python3.8/site-packages (from chaostoolkit-kubernetes) (0.7.6)
    Requirement already satisfied, skipping upgrade: kubernetes in /home/xat/venv/chaostk/lib/python3.8/site-packages (from chaostoolkit-kubernetes) (12.0.0)
    Requirement already satisfied, skipping upgrade: logzero in /home/xat/venv/chaostk/lib/python3.8/site-packages (from chaostoolkit-kubernetes) (1.5.0)
    Requirement already satisfied, skipping upgrade: requests>=2.21 in /home/xat/venv/chaostk/lib/python3.8/site-packages (from chaostoolkit-lib>=0.20.0->chaostoolkit-kubernetes) (2.24.0)
    Requirement already satisfied, skipping upgrade: tzlocal in /home/xat/venv/chaostk/lib/python3.8/site-packages (from dateparser->chaostoolkit-kubernetes) (2.1)
    Requirement already satisfied, skipping upgrade: regex!=2019.02.19 in /home/xat/venv/chaostk/lib/python3.8/site-packages (from dateparser->chaostoolkit-kubernetes) (2020.10.23)
    Requirement already satisfied, skipping upgrade: pytz in /home/xat/venv/chaostk/lib/python3.8/site-packages (from dateparser->chaostoolkit-kubernetes) (2020.1)
    Requirement already satisfied, skipping upgrade: python-dateutil in /home/xat/venv/chaostk/lib/python3.8/site-packages (from dateparser->chaostoolkit-kubernetes) (2.8.1)
    Requirement already satisfied, skipping upgrade: certifi>=14.05.14 in /home/xat/venv/chaostk/lib/python3.8/site-packages (from kubernetes->chaostoolkit-kubernetes) (2020.6.20)
    Requirement already satisfied, skipping upgrade: google-auth>=1.0.1 in /home/xat/venv/chaostk/lib/python3.8/site-packages (from kubernetes->chaostoolkit-kubernetes) (1.22.1)
    Requirement already satisfied, skipping upgrade: websocket-client!=0.40.0,!=0.41.*,!=0.42.*,>=0.32.0 in /home/xat/venv/chaostk/lib/python3.8/site-packages (from kubernetes->chaostoolkit-kubernetes) (0.57.0)
    Requirement already satisfied, skipping upgrade: requests-oauthlib in /home/xat/venv/chaostk/lib/python3.8/site-packages (from kubernetes->chaostoolkit-kubernetes) (1.3.0)
    Requirement already satisfied, skipping upgrade: setuptools>=21.0.0 in /home/xat/venv/chaostk/lib/python3.8/site-packages (from kubernetes->chaostoolkit-kubernetes) (41.6.0)
    Requirement already satisfied, skipping upgrade: urllib3>=1.24.2 in /home/xat/venv/chaostk/lib/python3.8/site-packages (from kubernetes->chaostoolkit-kubernetes) (1.25.11)
    Requirement already satisfied, skipping upgrade: six>=1.9.0 in /home/xat/venv/chaostk/lib/python3.8/site-packages (from kubernetes->chaostoolkit-kubernetes) (1.15.0)
    Requirement already satisfied, skipping upgrade: idna<3,>=2.5 in /home/xat/venv/chaostk/lib/python3.8/site-packages (from requests>=2.21->chaostoolkit-lib>=0.20.0->chaostoolkit-kubernetes) (2.10)
    Requirement already satisfied, skipping upgrade: chardet<4,>=3.0.2 in /home/xat/venv/chaostk/lib/python3.8/site-packages (from requests>=2.21->chaostoolkit-lib>=0.20.0->chaostoolkit-kubernetes) (3.0.4)
    Requirement already satisfied, skipping upgrade: pyasn1-modules>=0.2.1 in /home/xat/venv/chaostk/lib/python3.8/site-packages (from google-auth>=1.0.1->kubernetes->chaostoolkit-kubernetes) (0.2.8)
    Requirement already satisfied, skipping upgrade: cachetools<5.0,>=2.0.0 in /home/xat/venv/chaostk/lib/python3.8/site-packages (from google-auth>=1.0.1->kubernetes->chaostoolkit-kubernetes) (4.1.1)
    Requirement already satisfied, skipping upgrade: rsa<5,>=3.1.4; python_version >= "3.5" in /home/xat/venv/chaostk/lib/python3.8/site-packages (from google-auth>=1.0.1->kubernetes->chaostoolkit-kubernetes) (4.6)
    Requirement already satisfied, skipping upgrade: oauthlib>=3.0.0 in /home/xat/venv/chaostk/lib/python3.8/site-packages (from requests-oauthlib->kubernetes->chaostoolkit-kubernetes) (3.1.0)
    Requirement already satisfied, skipping upgrade: pyasn1<0.5.0,>=0.4.6 in /home/xat/venv/chaostk/lib/python3.8/site-packages (from pyasn1-modules>=0.2.1->google-auth>=1.0.1->kubernetes->chaostoolkit-kubernetes) (0.4.8)
    
[2020-10-28 11:05:34 INFO] [package:40] Package downloaded and installed in current environment
[2020-10-28 11:05:34 DEBUG] [cli:444] Failed to discover chaostoolkit-kubernetes
    Traceback (most recent call last):
      File "/home/xat/.local/lib/python3.8/site-packages/chaoslib/discovery/package.py", line 99, in get_importname_from_package
        dist = importlib_metadata.distribution(package_name)
      File "/usr/lib64/python3.8/importlib/metadata.py", line 504, in distribution
        return Distribution.from_name(distribution_name)
      File "/usr/lib64/python3.8/importlib/metadata.py", line 177, in from_name
        raise PackageNotFoundError(name)
    importlib.metadata.PackageNotFoundError: chaostoolkit-kubernetes
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/home/xat/.local/lib/python3.8/site-packages/chaostoolkit/cli.py", line 439, in discover
        discovery = disco(
      File "/home/xat/.local/lib/python3.8/site-packages/chaoslib/discovery/discover.py", line 33, in discover
        package = load_package(package_name)
      File "/home/xat/.local/lib/python3.8/site-packages/chaoslib/discovery/package.py", line 47, in load_package
        name = get_importname_from_package(package_name)
      File "/home/xat/.local/lib/python3.8/site-packages/chaoslib/discovery/package.py", line 101, in get_importname_from_package
        raise DiscoveryFailed(
    chaoslib.exceptions.DiscoveryFailed: Package chaostoolkit-kubernetes not found 
[2020-10-28 11:05:34 CRITICAL] [cli:445] Package chaostoolkit-kubernetes not found 

I also tried to run chaos discover chaostoolkit-aws that works well.

Thanks for the support.

Xat59 avatar Oct 28 '20 10:10 Xat59

Great catch! I'm curious if this is an ember-cli v2.12 issue (not ember v3.12 itself). I was using an early beta of ember v2.12 no problem but havent yet looked at upgrading ember-cli

toranb avatar Mar 20 '17 13:03 toranb

Maybe it has to do something with ember.js moving from bower to the npm module ember-source?

TimvdEijnden avatar Mar 20 '17 13:03 TimvdEijnden

@toranb I downgraded from ember-cli 2.12 to 2.11 and the error changed from could not find redux to:

TypeError: null is not an object (evaluating 'dataSources.includes')

RobbieTheWagner avatar Mar 20 '17 13:03 RobbieTheWagner

Wow not good - I'll need to dive in and likely chat with Stef or Robert on this one (sorry guys)

toranb avatar Mar 20 '17 13:03 toranb

Looks like it's related to treeForAddon in the shims. Thanks to @dbashford for finding this issue! https://github.com/ember-cli/ember-cli/issues/6826

RobbieTheWagner avatar Mar 20 '17 13:03 RobbieTheWagner

@TimvdEijnden looks like ember-cli v2.12 is not so friendly at the moment. Our good friend @rwwagner90 did create a new version of these shim addons that works as shown below

https://github.com/toranb/ember-redux-with-cli-twelv/commit/e5245660d366ab60ad0aab197dc0125cc5f6f4b0

an example app built with ember-cli v2.12 and ember-redux (the new shims) ^^

The problem we face now is that the new shims used to fix ember-cli v2.12 don't work for something older like ember-cli v2.8 (in my experience)

I think we need some time yet to work out if we can support both old/new ember-cli alike with ember-cli-node-assets ... or if not we may need to look at only supporting ember-cli 2.9+ or something else (as I don't want to revert back to ember-browserify if we can help it). Any other options worth considering - please let me know and sorry for the delay but I'd prefer to slow down and look at all the options if we can :)

toranb avatar Mar 21 '17 03:03 toranb

Thanks for the update, no rush! With the quick fix 👍 by @rwwagner90 we can move forward!

TimvdEijnden avatar Mar 21 '17 07:03 TimvdEijnden

Seems like the same issue as https://github.com/mike-north/ember-lodash/issues/89. Which was fixed by https://github.com/mike-north/ember-lodash/pull/93.

tldr; we make some optimizations when the addon directory does not contain any *.js files (which is also true of ember-redux-shim ), and avoid doing needless work. The solution is to add the following to ember-redux-shim's index.js:

  _shouldCompileJS: function() {
    return true;
  },

rwjblue avatar Mar 21 '17 11:03 rwjblue

Ember-cli 2.12.1 has been released which fixes this issue: https://github.com/ember-cli/ember-cli/releases/tag/v2.12.1

TimvdEijnden avatar Mar 22 '17 08:03 TimvdEijnden

Awesome! If all is well I'll close this issue 🙂

Thanks for reporting this so quickly! And thanks to @rwjblue for fixing it so quickly!

toranb avatar Mar 22 '17 12:03 toranb

Actually, after the installation of chaostoolkit-kubernetes pip package, I have closed the terminal. Then retried the discover command and it works.

Xat59 avatar Oct 28 '20 12:10 Xat59