Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERROR] scenario: scenarios/pvc_scenario.yaml failed with exception: <class 'UnboundLocalError'> file: /root/kraken/kraken/pvc/pvc_scenario.py line: 141 #195

Open
mallilinux1980 opened this issue Jul 18, 2024 · 5 comments

Comments

@mallilinux1980
Copy link

scenarios/pvc_scenario.yaml failed with exception: <class 'UnboundLocalError'>

podman run -it --rm --name=disk --net=host --env-host=true -v $KUBECONFIG:/root/.kube/config -v $SCENARIO:/root/kraken/scenarios/pvc_scenario.yaml -d krkn-hub:pvc-scenarios

2024-07-17 02:25:10,381 [INFO] Starting kraken
2024-07-17 02:25:10,390 [INFO] Initializing client to talk to the Kubernetes cluster
2024-07-17 02:25:10,390 [INFO] Generated a uuid for the run: 232d86a6-04ad-4d5e-b5de-8187b0f8a239
2024-07-17 02:25:20,834 [INFO] Fetching cluster info
2024-07-17 02:25:22,498 [INFO] Cluster version is 4.12.32
2024-07-17 02:25:22,498 [INFO] Server URL: https://<abc.com>:6443
2024-07-17 02:25:22,499 [INFO] Daemon mode not enabled, will run through 1 iterations

2024-07-17 02:25:22,499 [INFO] Executing scenarios for iteration 0
2024-07-17 02:25:22,499 [INFO] Running PVC scenario
2024-07-17 02:25:22,501 [INFO] Input params:
pvc_name: ''
pod_name: 'virt-launcher-rodan-223249-137'
namespace: 'virtualmachines'
target_fill_percentage: '75%'
duration: '60s'
2024-07-17 02:25:43,240 [INFO] Volume name: os-disk
2024-07-17 02:25:43,241 [INFO] PVC name: rodan-223249-137-os
2024-07-17 02:25:43,241 [ERROR] scenario: scenarios/pvc_scenario.yaml failed with exception: <class 'UnboundLocalError'> file: /root/kraken/kraken/pvc/pvc_scenario.py line: 141

$ cat scenarios/pvc_scenario.yaml
pvc_scenario:
pvc_name:
pod_name: virt-launcher-rodan-223249-137
namespace: virtualmachines
fill_percentage: 75
duration: 60

@mallilinux1980
Copy link
Author

anyway to get it fixed?

@tsebastiani
Copy link
Contributor

Hi @mallilinux1980, sorry for the late response. I'm afraid that you're not running the scenario as suggested in the documentation, infact you're trying to mount the yaml config file as a volume instead of exposing the requested parameters as environment variables.
I've just tested the scenario with this syntax:
podman run --name=pvc --net=host --env-host=true -v $(pwd)/kubeconfig:/home/krkn/.kube/config:Z -e POD_NAME=elasticsearch-master-0 -e NAMESPACE=default -e FILL_PERCENTAGE=65 -e DURATION=60 quay.io/krkn-chaos/krkn-hub:pvc-scenarios and works perfectly fine!

Please let us know if you have further questions or issues running krkn-hub scenario, you can also reach out directly on slack https://kubernetes.slack.com, #krkn channel.

@mallilinux1980
Copy link
Author

mallilinux1980 commented Jul 29, 2024

re-tried but same error.
$ podman run --name=disk --net=host --env-host=true -v /tmp/.kube/kubeconfig-42:/home/krkn/.kube/config -e POD_NAME=virt-launcher-d12472-064 -e NAMESPACE=virtualmachines -e FILL_PERCENTAGE=65 -e DURATION=60 quay.io/krkn-chaos/krkn-hub:pvc-scenarios

  • source /home/krkn/main_env.sh
    ++ export CERBERUS_ENABLED=False
    ++ CERBERUS_ENABLED=False
    ++ export CERBERUS_URL=http://0.0.0.0:8080
    ++ CERBERUS_URL=http://0.0.0.0:8080
    ++ export DISTRIBUTION=openshift
    ++ DISTRIBUTION=openshift
    ++ export KRKN_KUBE_CONFIG=/home/krkn/.kube/config
    ++ KRKN_KUBE_CONFIG=/home/krkn/.kube/config
    ++ export WAIT_DURATION=60
    ++ WAIT_DURATION=60
    ++ export ITERATIONS=1
    ++ ITERATIONS=1
    ++ export DAEMON_MODE=False
    ++ DAEMON_MODE=False
    ++ export RETRY_WAIT=120
    ++ RETRY_WAIT=120
    ++ export PUBLISH_KRAKEN_STATUS=False
    ++ PUBLISH_KRAKEN_STATUS=False
    ++ export SIGNAL_ADDRESS=0.0.0.0
    ++ SIGNAL_ADDRESS=0.0.0.0
    ++ export PORT=8081
    ++ PORT=8081
    ++ export SIGNAL_STATE=RUN
    ++ SIGNAL_STATE=RUN
    ++ export DEPLOY_DASHBOARDS=False
    ++ DEPLOY_DASHBOARDS=False
    ++ export CAPTURE_METRICS=False
    ++ CAPTURE_METRICS=False
    ++ export ENABLE_ALERTS=False
    ++ ENABLE_ALERTS=False
    ++ export ALERTS_PATH=config/alerts.yaml
    ++ ALERTS_PATH=config/alerts.yaml
    ++ export ES_SERVER=http://0.0.0.0:9200
    ++ ES_SERVER=http://0.0.0.0:9200
    ++ export CHECK_CRITICAL_ALERTS=False
    ++ CHECK_CRITICAL_ALERTS=False
    ++ export KUBE_BURNER_URL=https://github.com/cloud-bulldozer/kube-burner/releases/download/v1.7.0/kube-burner-1.7.0-Linux-x86_64.tar.gz
    ++ KUBE_BURNER_URL=https://github.com/cloud-bulldozer/kube-burner/releases/download/v1.7.0/kube-burner-1.7.0-Linux-x86_64.tar.gz
    ++ export TELEMETRY_ENABLED=False
    ++ TELEMETRY_ENABLED=False
    ++ export TELEMETRY_API_URL=https://ulnmf9xv7j.execute-api.us-west-2.amazonaws.com/production
    ++ TELEMETRY_API_URL=https://ulnmf9xv7j.execute-api.us-west-2.amazonaws.com/production
    ++ export TELEMETRY_USERNAME=redhat-chaos
    ++ TELEMETRY_USERNAME=redhat-chaos
    ++ export TELEMETRY_PASSWORD=
    ++ TELEMETRY_PASSWORD=
    ++ export TELEMETRY_PROMETHEUS_BACKUP=True
    ++ TELEMETRY_PROMETHEUS_BACKUP=True
    ++ export TELEMTRY_FULL_PROMETHEUS_BACKUP=False
    ++ TELEMTRY_FULL_PROMETHEUS_BACKUP=False
    ++ export TELEMETRY_BACKUP_THREADS=5
    ++ TELEMETRY_BACKUP_THREADS=5
    ++ export TELEMETRY_ARCHIVE_PATH=/tmp
    ++ TELEMETRY_ARCHIVE_PATH=/tmp
    ++ export TELEMETRY_MAX_RETRIES=0
    ++ TELEMETRY_MAX_RETRIES=0
    ++ export TELEMETRY_RUN_TAG=chaos
    ++ TELEMETRY_RUN_TAG=chaos
    ++ export TELEMETRY_GROUP=default
    ++ TELEMETRY_GROUP=default
    ++ export TELEMETRY_ARCHIVE_SIZE=1000
    ++ TELEMETRY_ARCHIVE_SIZE=1000
    ++ export TELEMETRY_LOGS_BACKUP=False
    ++ TELEMETRY_LOGS_BACKUP=False
    ++ export 'TELEMETRY_FILTER_PATTERN=["(\w{3}\s\d{1,2}\s\d{2}:\d{2}:\d{2}\.\d+).+","kinit (\d+/\d+/\d+\s\d{2}:\d{2}:\d{2})\s+","(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z).+"]'
    ++ TELEMETRY_FILTER_PATTERN='["(\w{3}\s\d{1,2}\s\d{2}:\d{2}:\d{2}\.\d+).+","kinit (\d+/\d+/\d+\s\d{2}:\d{2}:\d{2})\s+","(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z).+"]'
    ++ export TELEMETRY_CLI_PATH=
    ++ TELEMETRY_CLI_PATH=
    ++ export TELEMETRY_EVENTS_BACKUP=True
    ++ TELEMETRY_EVENTS_BACKUP=True
    ++ export ELASTIC_SERVER=
    ++ ELASTIC_SERVER=
    ++ export ELASTIC_INDEX=
    ++ ELASTIC_INDEX=
    ++ export KUBECONFIG=/home/krkn/.kube/config
    ++ KUBECONFIG=/home/krkn/.kube/config
  • source /home/krkn/env.sh
    ++ export PVC_NAME=
    ++ PVC_NAME=
    ++ export POD_NAME=virt-launcher-d12472-064
    ++ POD_NAME=virt-launcher-d12472-064
    ++ export NAMESPACE=virtualmachines
    ++ NAMESPACE=virtualmachines
    ++ export FILL_PERCENTAGE=65
    ++ FILL_PERCENTAGE=65
    ++ export DURATION=60
    ++ DURATION=60
    ++ export SCENARIO_TYPE=pvc_scenarios
    ++ SCENARIO_TYPE=pvc_scenarios
    ++ export SCENARIO_FILE=scenarios/pvc_scenario.yaml
    ++ SCENARIO_FILE=scenarios/pvc_scenario.yaml
  • ls -la /home/krkn/.kube
    total 8
    drwxr-xr-x. 2 krkn krkn 20 Jul 29 08:39 .
    drwxr-xr-x. 4 krkn krkn 20 Jul 23 10:35 ..
    -r--r--r--. 1 root root 4266 Jun 28 03:10 config
  • source /home/krkn/common_run.sh
  • checks
  • check_oc
  • log 'Checking if OpenShift client is installed'
    ++ date +%d-%m-%YT%H:%M:%S
    29-07-2024T08:39:53 Checking if OpenShift client is installed
  • echo -e '\033[1m29-07-2024T08:39:53 Checking if OpenShift client is installed\033[0m'
  • which oc
  • alias
  • eval declare -f
    ++ declare -f
  • /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot oc
    /bin/oc
  • check_kubectl
  • log 'Checking if kubernetes client is installed'
    ++ date +%d-%m-%YT%H:%M:%S
    29-07-2024T08:39:53 Checking if kubernetes client is installed
  • echo -e '\033[1m29-07-2024T08:39:53 Checking if kubernetes client is installed\033[0m'
  • which kubectl
  • alias
  • eval declare -f
    ++ declare -f
  • /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot kubectl
    /bin/kubectl
  • check_cluster_version
  • kubectl version
    Client Version: v1.30.3
    Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
    Server Version: v1.25.12+26bab08
    WARNING: version difference between client (1.30) and server (1.25) exceeds the supported minor version skew of +/-1
  • kubectl get clusterversion
    NAME VERSION AVAILABLE PROGRESSING SINCE STATUS
    version 4.12.32 True False 118d Cluster version is 4.12.32
  • set_kubernetes_platform
  • kubectl get clusterversion
    NAME VERSION AVAILABLE PROGRESSING SINCE STATUS
    version 4.12.32 True False 118d Cluster version is 4.12.32
  • config_setup
  • envsubst
  • envsubst
  • envsubst
  • cd /home/krkn/kraken
  • python3.9 run_kraken.py --config config/config.yaml
    2024-07-29 08:40:03,395 [INFO] Starting kraken
    2024-07-29 08:40:03,405 [INFO] Initializing client to talk to the Kubernetes cluster
    2024-07-29 08:40:03,405 [INFO] Generated a uuid for the run: 34e63afe-163a-4b78-90de-9761a23a7f98
    2024-07-29 08:40:22,105 [INFO] Fetching cluster info
    2024-07-29 08:40:23,823 [INFO] Cluster version is 4.12.32
    2024-07-29 08:40:23,824 [INFO] Server URL: https://xyz:6443
    2024-07-29 08:40:23,824 [INFO] Daemon mode not enabled, will run through 1 iterations

2024-07-29 08:40:23,824 [INFO] Executing scenarios for iteration 0
2024-07-29 08:40:23,824 [INFO] Running PVC scenario
2024-07-29 08:40:23,827 [INFO] Input params:
pvc_name: ''
pod_name: 'virt-launcher-d12472-064'
namespace: 'virtualmachines'
target_fill_percentage: '65%'
duration: '60s'
2024-07-29 08:40:45,544 [INFO] Volume name: os-disk
2024-07-29 08:40:45,544 [INFO] PVC name: d12472-064-os
2024-07-29 08:40:45,544 [ERROR] scenario: scenarios/pvc_scenario.yaml failed with exception: <class 'UnboundLocalError'> file: /home/krkn/kraken/kraken/pvc/pvc_scenario.py line: 141

@tsebastiani
Copy link
Contributor

did you try to clear your local image cache (just in case)?

@tsebastiani tsebastiani reopened this Jul 29, 2024
@mallilinux1980
Copy link
Author

yes but no luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants