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

chore: Improve error messages #182

Open
Tracked by #148
fhennig opened this issue Jan 11, 2024 · 2 comments
Open
Tracked by #148

chore: Improve error messages #182

fhennig opened this issue Jan 11, 2024 · 2 comments

Comments

@fhennig
Copy link
Contributor

fhennig commented Jan 11, 2024

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 NickLarsenNZ changed the title Improve error messages when no Kubernetes cluster is found Improve error messages Jun 5, 2024
@NickLarsenNZ
Copy link
Member

NickLarsenNZ commented Jun 11, 2024

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 NickLarsenNZ changed the title Improve error messages chore: Improve error messages Jul 29, 2024
@NickLarsenNZ
Copy link
Member

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

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