stackabletech / stackable-cockpit

Home of stackable-cockpit, stackablectl and stackable-cockpitd
https://docs.stackable.tech/management/stable/
Other
6 stars 2 forks source link

chore: Improve error messages #182

Open fhennig opened 7 months ago

fhennig commented 7 months ago

currently:

> stackablectl stack install trino-iceberg
An unrecoverable error occured: failed to execute stack (sub)command

Caused by these errors (recent errors listed first):
 1: failed to install stack
 2: stack resource requests error
 3: failed to create kube client
 4: failed to create Kubernetes client
 5: Failed to infer configuration
 6: failed to infer config
 7: failed to determine current context

This is a bit cryptic. it would be good to catch this error and print a more readable message like "could not connect to Kubernetes cluster" or "No Kubernetes configuration found" or something like that. Possibly with context information like "tried connecting to ..." or "tried reading file at ..."

NickLarsenNZ commented 2 months ago

This one is also cryptic...

❯ stackablectl \
--stack-file stackablectl-hive-postgres-minio-stack.yaml \
--release-file release.yaml \
stack install hive-hdfs-postgres
An unrecoverable error occured: failed to execute stack (sub)command

Caused by these errors (recent errors listed first):
 1: failed to build stack/release list
 2: failed to transfer the list file
 3: failed to read local file
 4: No such file or directory (os error 2)
Even with -l debug I cannot see where the error comes from ``` ❯ stackablectl -l debug \ --stack-file stackablectl-hive-postgres-minio-stack.yaml \ --release-file release.yaml \ stack install hive-hdfs-postgres DEBUG Add Helm repos at src/cli/mod.rs:137 in add_helm_repos with self: Cli { log_level: Some(Level(Debug)), no_cache: false, offline: false, files: CommonFileArgs { demo_files: [], stack_files: ["stackablectl-hive-postgres-minio-stack.yaml"], release_files: ["release.yaml"] }, repos: CommonRepoArgs { helm_repo_stable: "https://repo.stackable.tech/repository/helm-stable/", helm_repo_test: "https://repo.stackable.tech/repository/helm-test/", helm_repo_dev: "https://repo.stackable.tech/repository/helm-dev/" }, subcommand: Stack(StackArgs { subcommand: Install(StackInstallArgs { stack_name: "hive-hdfs-postgres", skip_release: false, stack_parameters: [], parameters: [], local_cluster: CommonClusterArgs { cluster_type: None, cluster_name: "stackable-data-platform", cluster_nodes: 2, cluster_cp_nodes: 1 }, namespaces: CommonNamespaceArgs { operator_namespace: "stackable-operators", product_namespace: "default" } }) }) } in run with self: Cli { log_level: Some(Level(Debug)), no_cache: false, offline: false, files: CommonFileArgs { demo_files: [], stack_files: ["stackablectl-hive-postgres-minio-stack.yaml"], release_files: ["release.yaml"] }, repos: CommonRepoArgs { helm_repo_stable: "https://repo.stackable.tech/repository/helm-stable/", helm_repo_test: "https://repo.stackable.tech/repository/helm-test/", helm_repo_dev: "https://repo.stackable.tech/repository/helm-dev/" }, subcommand: Stack(StackArgs { subcommand: Install(StackInstallArgs { stack_name: "hive-hdfs-postgres", skip_release: false, stack_parameters: [], parameters: [], local_cluster: CommonClusterArgs { cluster_type: None, cluster_name: "stackable-data-platform", cluster_nodes: 2, cluster_cp_nodes: 1 }, namespaces: CommonNamespaceArgs { operator_namespace: "stackable-operators", product_namespace: "default" } }) }) } DEBUG Add Helm repo at src/helm.rs:383 in add_repo with repository_name: "stackable-stable", repository_url: "https://repo.stackable.tech/repository/helm-stable/" in add_helm_repos with self: Cli { log_level: Some(Level(Debug)), no_cache: false, offline: false, files: CommonFileArgs { demo_files: [], stack_files: ["stackablectl-hive-postgres-minio-stack.yaml"], release_files: ["release.yaml"] }, repos: CommonRepoArgs { helm_repo_stable: "https://repo.stackable.tech/repository/helm-stable/", helm_repo_test: "https://repo.stackable.tech/repository/helm-test/", helm_repo_dev: "https://repo.stackable.tech/repository/helm-dev/" }, subcommand: Stack(StackArgs { subcommand: Install(StackInstallArgs { stack_name: "hive-hdfs-postgres", skip_release: false, stack_parameters: [], parameters: [], local_cluster: CommonClusterArgs { cluster_type: None, cluster_name: "stackable-data-platform", cluster_nodes: 2, cluster_cp_nodes: 1 }, namespaces: CommonNamespaceArgs { operator_namespace: "stackable-operators", product_namespace: "default" } }) }) } in run with self: Cli { log_level: Some(Level(Debug)), no_cache: false, offline: false, files: CommonFileArgs { demo_files: [], stack_files: ["stackablectl-hive-postgres-minio-stack.yaml"], release_files: ["release.yaml"] }, repos: CommonRepoArgs { helm_repo_stable: "https://repo.stackable.tech/repository/helm-stable/", helm_repo_test: "https://repo.stackable.tech/repository/helm-test/", helm_repo_dev: "https://repo.stackable.tech/repository/helm-dev/" }, subcommand: Stack(StackArgs { subcommand: Install(StackInstallArgs { stack_name: "hive-hdfs-postgres", skip_release: false, stack_parameters: [], parameters: [], local_cluster: CommonClusterArgs { cluster_type: None, cluster_name: "stackable-data-platform", cluster_nodes: 2, cluster_cp_nodes: 1 }, namespaces: CommonNamespaceArgs { operator_namespace: "stackable-operators", product_namespace: "default" } }) }) } DEBUG Add Helm repo at src/helm.rs:383 in add_repo with repository_name: "stackable-test", repository_url: "https://repo.stackable.tech/repository/helm-test/" in add_helm_repos with self: Cli { log_level: Some(Level(Debug)), no_cache: false, offline: false, files: CommonFileArgs { demo_files: [], stack_files: ["stackablectl-hive-postgres-minio-stack.yaml"], release_files: ["release.yaml"] }, repos: CommonRepoArgs { helm_repo_stable: "https://repo.stackable.tech/repository/helm-stable/", helm_repo_test: "https://repo.stackable.tech/repository/helm-test/", helm_repo_dev: "https://repo.stackable.tech/repository/helm-dev/" }, subcommand: Stack(StackArgs { subcommand: Install(StackInstallArgs { stack_name: "hive-hdfs-postgres", skip_release: false, stack_parameters: [], parameters: [], local_cluster: CommonClusterArgs { cluster_type: None, cluster_name: "stackable-data-platform", cluster_nodes: 2, cluster_cp_nodes: 1 }, namespaces: CommonNamespaceArgs { operator_namespace: "stackable-operators", product_namespace: "default" } }) }) } in run with self: Cli { log_level: Some(Level(Debug)), no_cache: false, offline: false, files: CommonFileArgs { demo_files: [], stack_files: ["stackablectl-hive-postgres-minio-stack.yaml"], release_files: ["release.yaml"] }, repos: CommonRepoArgs { helm_repo_stable: "https://repo.stackable.tech/repository/helm-stable/", helm_repo_test: "https://repo.stackable.tech/repository/helm-test/", helm_repo_dev: "https://repo.stackable.tech/repository/helm-dev/" }, subcommand: Stack(StackArgs { subcommand: Install(StackInstallArgs { stack_name: "hive-hdfs-postgres", skip_release: false, stack_parameters: [], parameters: [], local_cluster: CommonClusterArgs { cluster_type: None, cluster_name: "stackable-data-platform", cluster_nodes: 2, cluster_cp_nodes: 1 }, namespaces: CommonNamespaceArgs { operator_namespace: "stackable-operators", product_namespace: "default" } }) }) } DEBUG Add Helm repo at src/helm.rs:383 in add_repo with repository_name: "stackable-dev", repository_url: "https://repo.stackable.tech/repository/helm-dev/" in add_helm_repos with self: Cli { log_level: Some(Level(Debug)), no_cache: false, offline: false, files: CommonFileArgs { demo_files: [], stack_files: ["stackablectl-hive-postgres-minio-stack.yaml"], release_files: ["release.yaml"] }, repos: CommonRepoArgs { helm_repo_stable: "https://repo.stackable.tech/repository/helm-stable/", helm_repo_test: "https://repo.stackable.tech/repository/helm-test/", helm_repo_dev: "https://repo.stackable.tech/repository/helm-dev/" }, subcommand: Stack(StackArgs { subcommand: Install(StackInstallArgs { stack_name: "hive-hdfs-postgres", skip_release: false, stack_parameters: [], parameters: [], local_cluster: CommonClusterArgs { cluster_type: None, cluster_name: "stackable-data-platform", cluster_nodes: 2, cluster_cp_nodes: 1 }, namespaces: CommonNamespaceArgs { operator_namespace: "stackable-operators", product_namespace: "default" } }) }) } in run with self: Cli { log_level: Some(Level(Debug)), no_cache: false, offline: false, files: CommonFileArgs { demo_files: [], stack_files: ["stackablectl-hive-postgres-minio-stack.yaml"], release_files: ["release.yaml"] }, repos: CommonRepoArgs { helm_repo_stable: "https://repo.stackable.tech/repository/helm-stable/", helm_repo_test: "https://repo.stackable.tech/repository/helm-test/", helm_repo_dev: "https://repo.stackable.tech/repository/helm-dev/" }, subcommand: Stack(StackArgs { subcommand: Install(StackInstallArgs { stack_name: "hive-hdfs-postgres", skip_release: false, stack_parameters: [], parameters: [], local_cluster: CommonClusterArgs { cluster_type: None, cluster_name: "stackable-data-platform", cluster_nodes: 2, cluster_cp_nodes: 1 }, namespaces: CommonNamespaceArgs { operator_namespace: "stackable-operators", product_namespace: "default" } }) }) } DEBUG Handle stack args at src/cmds/stack.rs:140 in run with self: Cli { log_level: Some(Level(Debug)), no_cache: false, offline: false, files: CommonFileArgs { demo_files: [], stack_files: ["stackablectl-hive-postgres-minio-stack.yaml"], release_files: ["release.yaml"] }, repos: CommonRepoArgs { helm_repo_stable: "https://repo.stackable.tech/repository/helm-stable/", helm_repo_test: "https://repo.stackable.tech/repository/helm-test/", helm_repo_dev: "https://repo.stackable.tech/repository/helm-dev/" }, subcommand: Stack(StackArgs { subcommand: Install(StackInstallArgs { stack_name: "hive-hdfs-postgres", skip_release: false, stack_parameters: [], parameters: [], local_cluster: CommonClusterArgs { cluster_type: None, cluster_name: "stackable-data-platform", cluster_nodes: 2, cluster_cp_nodes: 1 }, namespaces: CommonNamespaceArgs { operator_namespace: "stackable-operators", product_namespace: "default" } }) }) } An unrecoverable error occured: failed to execute stack (sub)command Caused by these errors (recent errors listed first): 1: failed to build stack/release list 2: failed to transfer the list file 3: failed to read local file 4: No such file or directory (os error 2) ```

Edit: I know which filename was wrong. It just should be instantly obvious in the error message

NickLarsenNZ commented 3 weeks ago

Adding another on behalf of @xeniape

xenia@tuxedo:~/Downloads/tmp$ stackablectl demo in data-lakehouse-iceberg-trino-spark
An unrecoverable error occured: demo command error

Caused by these errors (recent errors listed first):
 1: failed to install demo "data-lakehouse-iceberg-trino-spark"
 2: failed to install stack
 3: failed to install stack manifests
 4: failed to deploy manifests using the kube client
 5: failed to patch/create Kubernetes object
 6: ApiError
 7: Apply failed with 1 conflict