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

[BUG] - Nebari-CLI returns an error when using DigitalOcean initialization #1840

Closed
ericmjl opened this issue Jun 21, 2023 · 8 comments · Fixed by #1842
Closed

[BUG] - Nebari-CLI returns an error when using DigitalOcean initialization #1840

ericmjl opened this issue Jun 21, 2023 · 8 comments · Fixed by #1842
Labels
area: nebari-cli needs: investigation 🔍 Someone in the team needs to find the root cause and replicate this bug provider: Digital Ocean type: bug 🐛 Something isn't working

Comments

@ericmjl
Copy link

ericmjl commented Jun 21, 2023

Describe the bug

Running the guided initialization results in an error. I have verified that I copied and pasted my token, ID, and access keys correctly.

Expected behavior

I expected the guided init to work without encountering the issues described above.

OS and architecture in which you are running Nebari

macOS Ventura 13.2.1 (22D68), M1 MacBook Air

How to Reproduce the problem?

nebari init --guided-init

        Welcome to the Guided Init wizard!

You will be asked a few questions to generate your nebari-config.yaml. For more details, refer to the Nebari docs:

        https://nebari.dev/docs/



 🪴  Nebari runs on a Kubernetes cluster: Where do you want this Kubernetes cluster deployed? is where you want this Kubernetes cluster deployed. For more details, refer to
the Nebari docs:

        https://nebari.dev/docs/get-started/deploy


        ❗️ local requires Docker and Kubernetes running on your local machine. Currently only available on Linux OS.
        ❗️ existing refers to an existing Kubernetes cluster that Nebari can be deployed on.

   Where would you like to deploy your Nebari cluster? do
Unable to locate your Digital Ocean credentials, refer to this guide on how to generate them:

        https://docs.digitalocean.com/reference/api/create-personal-access-token


Paste your DIGITALOCEAN_TOKEN:
Paste your SPACES_ACCESS_KEY_ID:
Paste your SPACES_SECRET_ACCESS_KEY:
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Users/ericmjl/anaconda/bin/nebari:10 in <module>                                                │
│                                                                                                  │
│    7                                                                                             │
│    8 if __name__ == '__main__':                                                                  │
│    9 │   sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])                       │
│ ❱ 10 │   sys.exit(app())                                                                         │
│   11                                                                                             │
│                                                                                                  │
│ ╭─────────────────────────────────────── locals ────────────────────────────────────────╮        │
│ │ __annotations__ = {}                                                                  │        │
│ │    __builtins__ = <module 'builtins' (built-in)>                                      │        │
│ │      __cached__ = None                                                                │        │
│ │         __doc__ = None                                                                │        │
│ │        __file__ = '/Users/ericmjl/anaconda/bin/nebari'                                │        │
│ │      __loader__ = <_frozen_importlib_external.SourceFileLoader object at 0x100afcca0> │        │
│ │        __name__ = '__main__'                                                          │        │
│ │     __package__ = None                                                                │        │
│ │        __spec__ = None                                                                │        │
│ │             app = <typer.main.Typer object at 0x100bf06a0>                            │        │
│ │              re = <module 're' from '/Users/ericmjl/anaconda/lib/python3.9/re.py'>    │        │
│ │             sys = <module 'sys' (built-in)>                                           │        │
│ ╰───────────────────────────────────────────────────────────────────────────────────────╯        │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/typer/main.py:328 in __call__                │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/typer/main.py:311 in __call__                │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/click/core.py:1130 in __call__               │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/typer/core.py:778 in main                    │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/typer/core.py:216 in _main                   │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/click/core.py:1655 in invoke                 │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/click/core.py:920 in make_context            │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/click/core.py:1378 in parse_args             │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/click/core.py:2360 in handle_parse_result    │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/click/core.py:2322 in process_value          │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/typer/main.py:988 in wrapper                 │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/nebari/cli/init.py:338 in guided_init_wizard │
│                                                                                                  │
│   335 │   │   ).unsafe_ask()                                                                     │
│   336 │   │                                                                                      │
│   337 │   │   if not disable_checks:                                                             │
│ ❱ 338 │   │   │   check_cloud_provider_creds(ctx, cloud_provider=inputs.cloud_provider)          │
│   339 │   │                                                                                      │
│   340 │   │   # specific context needed when `check_project_name` is called                      │
│   341 │   │   ctx.params["cloud_provider"] = inputs.cloud_provider                               │
│                                                                                                  │
│ ╭────────────────────────── locals ───────────────────────────╮                                  │
│ │            ctx = <click.core.Context object at 0x105371e50> │                                  │
│ │ disable_checks = False                                      │                                  │
│ │    guided_init = True                                       │                                  │
│ │         inputs = InitInputs(                                │                                  │
│ │                  │   cloud_provider='do',                   │                                  │
│ │                  │   project_name='',                       │                                  │
│ │                  │   domain_name='',                        │                                  │
│ │                  │   namespace='dev',                       │                                  │
│ │                  │   auth_provider='password',              │                                  │
│ │                  │   auth_auto_provision=False,             │                                  │
│ │                  │   repository=None,                       │                                  │
│ │                  │   repository_auto_provision=False,       │                                  │
│ │                  │   ci_provider=None,                      │                                  │
│ │                  │   terraform_state='remote',              │                                  │
│ │                  │   kubernetes_version=None,               │                                  │
│ │                  │   ssl_cert_email=None,                   │                                  │
│ │                  │   disable_prompt=False                   │                                  │
│ │                  )                                          │                                  │
│ │          qmark = '  '                                       │                                  │
│ ╰─────────────────────────────────────────────────────────────╯                                  │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/nebari/cli/init.py:163 in                    │
│ check_cloud_provider_creds                                                                       │
│                                                                                                  │
│   160 │   │   │   hide_input=True,                                                               │
│   161 │   │   )                                                                                  │
│   162 │   │   os.environ["AWS_ACCESS_KEY_ID"] = os.getenv("SPACES_ACCESS_KEY_ID")                │
│ ❱ 163 │   │   os.environ["AWS_SECRET_ACCESS_KEY"] = os.getenv("AWS_SECRET_ACCESS_KEY")           │
│   164 │                                                                                          │
│   165 │   # AZURE                                                                                │
│   166 │   elif cloud_provider == ProviderEnum.azure.value.lower() and (                          │
│                                                                                                  │
│ ╭────────────────────────── locals ───────────────────────────╮                                  │
│ │ cloud_provider = 'do'                                       │                                  │
│ │            ctx = <click.core.Context object at 0x105371e50> │                                  │
│ ╰─────────────────────────────────────────────────────────────╯                                  │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/os.py:684 in __setitem__                                   │
│                                                                                                  │
│    681 │                                                                                         │
│    682 │   def __setitem__(self, key, value):                                                    │
│    683 │   │   key = self.encodekey(key)                                                         │
│ ❱  684 │   │   value = self.encodevalue(value)                                                   │
│    685 │   │   putenv(key, value)                                                                │
│    686 │   │   self._data[key] = value                                                           │
│    687                                                                                           │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │   key = b'AWS_SECRET_ACCESS_KEY'                                                             │ │
│ │  self = environ({                                                                            │ │
│ │         │   'COLORTERM': 'truecolor',                                                        │ │
│ │         │   'COMMAND_MODE': 'unix2003',                                                      │ │
│ │         │   'HOME': '/Users/ericmjl',                                                        │ │
│ │         │   'LANG': 'en_US.UTF-8',                                                           │ │
│ │         │   'LOGNAME': 'ericmjl',                                                            │ │
│ │         │   'PATH':                                                                          │ │
│ │         '/Users/ericmjl/.fly/bin:/Users/ericmjl/anaconda/bin:/Users/ericmjl/anaconda/cond'+… │ │
│ │         │   'PWD': '/Users/ericmjl/github/incubator/nebari-deploy',                          │ │
│ │         │   'SHELL': '/bin/zsh',                                                             │ │
│ │         │   'SHLVL': '2',                                                                    │ │
│ │         │   'SSH_AUTH_SOCK': '/private/tmp/com.apple.launchd.bmvzCZVRSy/Listeners',          │ │
│ │         │   ... +47                                                                          │ │
│ │         })                                                                                   │ │
│ │ value = None                                                                                 │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/os.py:756 in encode                                        │
│                                                                                                  │
│    753 │   │   encoding = sys.getfilesystemencoding()                                            │
│    754 │   │   def encode(value):                                                                │
│    755 │   │   │   if not isinstance(value, str):                                                │
│ ❱  756 │   │   │   │   raise TypeError("str expected, not %s" % type(value).__name__)            │
│    757 │   │   │   return value.encode(encoding, 'surrogateescape')                              │
│    758 │   │   def decode(value):                                                                │
│    759 │   │   │   return value.decode(encoding, 'surrogateescape')                              │
│                                                                                                  │
│ ╭────── locals ──────╮                                                                           │
│ │ encoding = 'utf-8' │                                                                           │
│ │    value = None    │                                                                           │
│ ╰────────────────────╯                                                                           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: str expected, not NoneType

Command output

Please see above error trace.

Versions and dependencies used.

$ mamba --version
mamba 0.14.1
conda 4.10.3
$ conda list | grep nebari
nebari                    2023.5.1           pyhd8ed1ab_0    conda-forge

Compute environment

None

Integrations

No response

Anything else?

I would label this low priority. I'm mostly test-driving this for personal use.

Tasks

No tasks being tracked yet.
@ericmjl ericmjl added needs: triage 🚦 Someone needs to have a look at this issue and triage type: bug 🐛 Something isn't working labels Jun 21, 2023
@ericmjl
Copy link
Author

ericmjl commented Jun 22, 2023

Update: Digging through the stack trace, it appears that I have to set the AWS_SECRET_ACCESS_KEY value even though I chose DigitalOcean as the cloud provider.

I did that and set the AWS_SECRET_ACCESS_KEY to some random string and was able to get past the error reported above. This feels like a bug, and probably should be fixed in the CLI.

However, progressing through the rest of the init lets me reach the next error:

$ nebari init --guided-init

        Welcome to the Guided Init wizard!

You will be asked a few questions to generate your nebari-config.yaml. For more details, refer to the Nebari docs:

        https://nebari.dev/docs/



 🪴  Nebari runs on a Kubernetes cluster: Where do you want this Kubernetes cluster deployed? is where you want this Kubernetes cluster deployed. For more details, refer to
the Nebari docs:

        https://nebari.dev/docs/get-started/deploy


        ❗️ local requires Docker and Kubernetes running on your local machine. Currently only available on Linux OS.
        ❗️ existing refers to an existing Kubernetes cluster that Nebari can be deployed on.

   Where would you like to deploy your Nebari cluster? do
Unable to locate your Digital Ocean credentials, refer to this guide on how to generate them:

        https://docs.digitalocean.com/reference/api/create-personal-access-token


Paste your DIGITALOCEAN_TOKEN:
Paste your SPACES_ACCESS_KEY_ID:
Paste your SPACES_SECRET_ACCESS_KEY:

 🪴  Next, give your Nebari instance a project name. This name is what your Kubernetes cluster will be referred to as.

        The project name must adhere to the following requirements:
        - Letters from A to Z (upper and lower case) and numbers
        - Maximum accepted length of the name string is 16 characters


   What project name would you like to use? test


 🪴  Great! Now you need to provide a valid domain name (i.e. the URL) to access your Nebri instance. This should be a domain that you own.


   What domain name would you like to use? ericmjl.com


 🪴  Nebari comes with Keycloak, an open-source identity and access management tool. This is how users and permissions are managed on the platform. To connect Keycloak with
an identity provider, you can select one now.


        ❗️ password is the default option and is not connected to any external identity provider.

   What authentication provider would you like? password


 🪴  This next section is optional but recommended. If you wish to adopt a GitOps approach to managing this platform, we will walk you through a set of questions to get that
setup. With this setup, Nebari will use GitHub Actions workflows (or GitLab equivalent) to automatically handle the future deployments of your infrastructure.


   Would you like to adopt a GitOps approach to managing Nebari? No


 🪴  This next section is optional but recommended. If you want your Nebari domain to use a Let's Encrypt SSL certificate, all we need is an email address from you.


   Would you like to add a Let's Encrypt SSL certificate to your domain? Yes
   Which email address should Let's Encrypt associate the certificate with? ericmajinglong@gmail.com


 🪴  This next section is optional and includes advanced configuration changes to the Terraform state, Kubernetes Namespace and Kubernetes version.
 ⚠️  caution is advised!


   Would you like to make advanced configuration changes? No
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Users/ericmjl/anaconda/bin/nebari:10 in <module>                                                │
│                                                                                                  │
│    7                                                                                             │
│    8 if __name__ == '__main__':                                                                  │
│    9 │   sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])                       │
│ ❱ 10 │   sys.exit(app())                                                                         │
│   11                                                                                             │
│                                                                                                  │
│ ╭─────────────────────────────────────── locals ────────────────────────────────────────╮        │
│ │ __annotations__ = {}                                                                  │        │
│ │    __builtins__ = <module 'builtins' (built-in)>                                      │        │
│ │      __cached__ = None                                                                │        │
│ │         __doc__ = None                                                                │        │
│ │        __file__ = '/Users/ericmjl/anaconda/bin/nebari'                                │        │
│ │      __loader__ = <_frozen_importlib_external.SourceFileLoader object at 0x104774ca0> │        │
│ │        __name__ = '__main__'                                                          │        │
│ │     __package__ = None                                                                │        │
│ │        __spec__ = None                                                                │        │
│ │             app = <typer.main.Typer object at 0x1048687c0>                            │        │
│ │              re = <module 're' from '/Users/ericmjl/anaconda/lib/python3.9/re.py'>    │        │
│ │             sys = <module 'sys' (built-in)>                                           │        │
│ ╰───────────────────────────────────────────────────────────────────────────────────────╯        │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/typer/main.py:328 in __call__                │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/typer/main.py:311 in __call__                │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/click/core.py:1130 in __call__               │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/typer/core.py:778 in main                    │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/typer/core.py:216 in _main                   │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/click/core.py:1655 in invoke                 │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/click/core.py:920 in make_context            │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/click/core.py:1378 in parse_args             │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/click/core.py:2360 in handle_parse_result    │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/click/core.py:2322 in process_value          │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/typer/main.py:988 in wrapper                 │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/nebari/cli/init.py:526 in guided_init_wizard │
│                                                                                                  │
│   523 │   │   │   │   qmark=qmark,                                                               │
│   524 │   │   │   ).unsafe_ask()                                                                 │
│   525 │   │                                                                                      │
│ ❱ 526 │   │   handle_init(inputs)                                                                │
│   527 │   │                                                                                      │
│   528 │   │   rich.print(                                                                        │
│   529 │   │   │   (                                                                              │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │             ctx = <click.core.Context object at 0x108fe8e80>                                 │ │
│ │  disable_checks = False                                                                      │ │
│ │     guided_init = True                                                                       │ │
│ │          inputs = InitInputs(                                                                │ │
│ │                   │   cloud_provider='do',                                                   │ │
│ │                   │   project_name='test',                                                   │ │
│ │                   │   domain_name='ericmjl.com',                                             │ │
│ │                   │   namespace='dev',                                                       │ │
│ │                   │   auth_provider='password',                                              │ │
│ │                   │   auth_auto_provision=False,                                             │ │
│ │                   │   repository=None,                                                       │ │
│ │                   │   repository_auto_provision=False,                                       │ │
│ │                   │   ci_provider=None,                                                      │ │
│ │                   │   terraform_state='remote',                                              │ │
│ │                   │   kubernetes_version=None,                                               │ │
│ │                   │   ssl_cert_email='ericmajinglong@gmail.com',                             │ │
│ │                   │   disable_prompt=False                                                   │ │
│ │                   )                                                                          │ │
│ │ name_guidelines = '\n        The project name must adhere to the following requirements:\n   │ │
│ │                   - L'+132                                                                   │ │
│ │           qmark = '  '                                                                       │ │
│ │        ssl_cert = True                                                                       │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/nebari/cli/init.py:67 in handle_init         │
│                                                                                                  │
│    64 │   if inputs.kubernetes_version == "latest":                                              │
│    65 │   │   inputs.kubernetes_version = None                                                   │
│    66 │                                                                                          │
│ ❱  67 │   config = render_config(                                                                │
│    68 │   │   cloud_provider=inputs.cloud_provider,                                              │
│    69 │   │   project_name=inputs.project_name,                                                  │
│    70 │   │   nebari_domain=inputs.domain_name,                                                  │
│                                                                                                  │
│ ╭──────────────────────── locals ─────────────────────────╮                                      │
│ │ inputs = InitInputs(                                    │                                      │
│ │          │   cloud_provider='do',                       │                                      │
│ │          │   project_name='test',                       │                                      │
│ │          │   domain_name='ericmjl.com',                 │                                      │
│ │          │   namespace='dev',                           │                                      │
│ │          │   auth_provider='password',                  │                                      │
│ │          │   auth_auto_provision=False,                 │                                      │
│ │          │   repository=None,                           │                                      │
│ │          │   repository_auto_provision=False,           │                                      │
│ │          │   ci_provider=None,                          │                                      │
│ │          │   terraform_state='remote',                  │                                      │
│ │          │   kubernetes_version=None,                   │                                      │
│ │          │   ssl_cert_email='ericmajinglong@gmail.com', │                                      │
│ │          │   disable_prompt=False                       │                                      │
│ │          )                                              │                                      │
│ ╰─────────────────────────────────────────────────────────╯                                      │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/nebari/initialize.py:415 in render_config    │
│                                                                                                  │
│   412 │   │   │   "hub_subtitle"                                                                 │
│   413 │   │   ] = f"{WELCOME_HEADER_TEXT} on Digital Ocean"                                      │
│   414 │   │   config["digital_ocean"] = DIGITAL_OCEAN.copy()                                     │
│ ❱ 415 │   │   set_kubernetes_version(config, kubernetes_version, cloud_provider)                 │
│   416 │                                                                                          │
│   417 │   elif cloud_provider == "gcp":                                                          │
│   418 │   │   config["theme"]["jupyterhub"][                                                     │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │       auth_auto_provision = False                                                            │ │
│ │             auth_provider = 'password'                                                       │ │
│ │               ci_provider = None                                                             │ │
│ │            cloud_provider = 'do'                                                             │ │
│ │                    config = {                                                                │ │
│ │                             │   'project_name': 'test',                                      │ │
│ │                             │   'provider': 'do',                                            │ │
│ │                             │   'domain': 'ericmjl.com',                                     │ │
│ │                             │   'certificate': {'type': 'self-signed'},                      │ │
│ │                             │   'security': {                                                │ │
│ │                             │   │   'authentication': {'type': 'password'},                  │ │
│ │                             │   │   'keycloak': {                                            │ │
│ │                             │   │   │   'initial_root_password': 'yrfCCOLl0z5i1MJd'          │ │
│ │                             │   │   }                                                        │ │
│ │                             │   },                                                           │ │
│ │                             │   'default_images': {                                          │ │
│ │                             │   │   'jupyterhub':                                            │ │
│ │                             'quay.io/nebari/nebari-jupyterhub:2023.5.1',                     │ │
│ │                             │   │   'jupyterlab':                                            │ │
│ │                             'quay.io/nebari/nebari-jupyterlab:2023.5.1',                     │ │
│ │                             │   │   'dask_worker':                                           │ │
│ │                             'quay.io/nebari/nebari-dask-worker:2023.5.1'                     │ │
│ │                             │   },                                                           │ │
│ │                             │   'storage': {                                                 │ │
│ │                             │   │   'conda_store': '200Gi',                                  │ │
│ │                             │   │   'shared_filesystem': '200Gi'                             │ │
│ │                             │   },                                                           │ │
│ │                             │   'theme': {                                                   │ │
│ │                             │   │   'jupyterhub': {                                          │ │
│ │                             │   │   │   'hub_title': 'Nebari - test',                        │ │
│ │                             │   │   │   'hub_subtitle': 'Your open source data science       │ │
│ │                             platform, hosted on Digital Ocean',                              │ │
│ │                             │   │   │   'welcome': 'Welcome! Learn about Nebari\'s features  │ │
│ │                             and configurations in <a href="https://ww'+191,                  │ │
│ │                             │   │   │   'logo':                                              │ │
│ │                             'https://raw.githubusercontent.com/nebari-dev/nebari-design/mai… │ │
│ │                             │   │   │   'display_version': True                              │ │
│ │                             │   │   }                                                        │ │
│ │                             │   },                                                           │ │
│ │                             │   'helm_extensions': [],                                       │ │
│ │                             │   'monitoring': {'enabled': True},                             │ │
│ │                             │   ... +7                                                       │ │
│ │                             }                                                                │ │
│ │          default_password = 'yrfCCOLl0z5i1MJd'                                               │ │
│ │ default_password_filename = '/var/folders/lb/fzbrctwd2klcrwsg63vzqj0r0000gn/T/NEBARI_DEFAUL… │ │
│ │            disable_prompt = False                                                            │ │
│ │                         f = <_io.TextIOWrapper                                               │ │
│ │                             name='/var/folders/lb/fzbrctwd2klcrwsg63vzqj0r0000gn/T/NEBARI_D… │ │
│ │                             mode='w' encoding='UTF-8'>                                       │ │
│ │        kubernetes_version = None                                                             │ │
│ │                 namespace = 'dev'                                                            │ │
│ │             nebari_domain = 'ericmjl.com'                                                    │ │
│ │              project_name = 'test'                                                           │ │
│ │                repository = None                                                             │ │
│ │ repository_auto_provision = False                                                            │ │
│ │            ssl_cert_email = 'ericmajinglong@gmail.com'                                       │ │
│ │           terraform_state = 'remote'                                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/nebari/utils.py:268 in                       │
│ set_kubernetes_version                                                                           │
│                                                                                                  │
│   265 │   │   │   # grab oldest version                                                          │
│   266 │   │   │   cloud_config["kubernetes_version"] = k8s_versions[0]                           │
│   267 │                                                                                          │
│ ❱ 268 │   return _check_and_set_kubernetes_version()                                             │
│   269                                                                                            │
│   270                                                                                            │
│   271 @contextlib.contextmanager                                                                 │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ _check_and_set_kubernetes_version = <function                                                │ │
│ │                                     set_kubernetes_version.<locals>._check_and_set_kubernet… │ │
│ │                                     at 0x10992ef70>                                          │ │
│ │                _raise_value_error = <function                                                │ │
│ │                                     set_kubernetes_version.<locals>._raise_value_error at    │ │
│ │                                     0x1098368b0>                                             │ │
│ │                      cloud_config = {                                                        │ │
│ │                                     │   'region': 'nyc3',                                    │ │
│ │                                     │   'kubernetes_version': 'PLACEHOLDER',                 │ │
│ │                                     │   'node_groups': {                                     │ │
│ │                                     │   │   'general': {                                     │ │
│ │                                     │   │   │   'instance': 'g-8vcpu-32gb',                  │ │
│ │                                     │   │   │   'min_nodes': 1,                              │ │
│ │                                     │   │   │   'max_nodes': 1                               │ │
│ │                                     │   │   },                                               │ │
│ │                                     │   │   'user': {                                        │ │
│ │                                     │   │   │   'instance': 'g-4vcpu-16gb',                  │ │
│ │                                     │   │   │   'min_nodes': 1,                              │ │
│ │                                     │   │   │   'max_nodes': 5                               │ │
│ │                                     │   │   },                                               │ │
│ │                                     │   │   'worker': {                                      │ │
│ │                                     │   │   │   'instance': 'g-4vcpu-16gb',                  │ │
│ │                                     │   │   │   'min_nodes': 1,                              │ │
│ │                                     │   │   │   'max_nodes': 5                               │ │
│ │                                     │   │   }                                                │ │
│ │                                     │   }                                                    │ │
│ │                                     }                                                        │ │
│ │                   cloud_full_name = 'digital_ocean'                                          │ │
│ │                    cloud_provider = 'do'                                                     │ │
│ │               cloud_provider_dict = {                                                        │ │
│ │                                     │   'aws': {                                             │ │
│ │                                     │   │   'full_name': 'amazon_web_services',              │ │
│ │                                     │   │   'k8s_version_checker_func':                      │ │
│ │                                     <functools._lru_cache_wrapper object at 0x108321ae0>     │ │
│ │                                     │   },                                                   │ │
│ │                                     │   'azure': {                                           │ │
│ │                                     │   │   'full_name': 'azure',                            │ │
│ │                                     │   │   'k8s_version_checker_func':                      │ │
│ │                                     <functools._lru_cache_wrapper object at 0x10862f900>     │ │
│ │                                     │   },                                                   │ │
│ │                                     │   'do': {                                              │ │
│ │                                     │   │   'full_name': 'digital_ocean',                    │ │
│ │                                     │   │   'k8s_version_checker_func': <function            │ │
│ │                                     kubernetes_versions at 0x108669820>                      │ │
│ │                                     │   },                                                   │ │
│ │                                     │   'gcp': {                                             │ │
│ │                                     │   │   'full_name': 'google_cloud_platform',            │ │
│ │                                     │   │   'k8s_version_checker_func':                      │ │
│ │                                     <functools._lru_cache_wrapper object at 0x10862fb80>     │ │
│ │                                     │   }                                                    │ │
│ │                                     }                                                        │ │
│ │                            config = {                                                        │ │
│ │                                     │   'project_name': 'test',                              │ │
│ │                                     │   'provider': 'do',                                    │ │
│ │                                     │   'domain': 'ericmjl.com',                             │ │
│ │                                     │   'certificate': {'type': 'self-signed'},              │ │
│ │                                     │   'security': {                                        │ │
│ │                                     │   │   'authentication': {'type': 'password'},          │ │
│ │                                     │   │   'keycloak': {                                    │ │
│ │                                     │   │   │   'initial_root_password': 'yrfCCOLl0z5i1MJd'  │ │
│ │                                     │   │   }                                                │ │
│ │                                     │   },                                                   │ │
│ │                                     │   'default_images': {                                  │ │
│ │                                     │   │   'jupyterhub':                                    │ │
│ │                                     'quay.io/nebari/nebari-jupyterhub:2023.5.1',             │ │
│ │                                     │   │   'jupyterlab':                                    │ │
│ │                                     'quay.io/nebari/nebari-jupyterlab:2023.5.1',             │ │
│ │                                     │   │   'dask_worker':                                   │ │
│ │                                     'quay.io/nebari/nebari-dask-worker:2023.5.1'             │ │
│ │                                     │   },                                                   │ │
│ │                                     │   'storage': {                                         │ │
│ │                                     │   │   'conda_store': '200Gi',                          │ │
│ │                                     │   │   'shared_filesystem': '200Gi'                     │ │
│ │                                     │   },                                                   │ │
│ │                                     │   'theme': {                                           │ │
│ │                                     │   │   'jupyterhub': {                                  │ │
│ │                                     │   │   │   'hub_title': 'Nebari - test',                │ │
│ │                                     │   │   │   'hub_subtitle': 'Your open source data       │ │
│ │                                     science platform, hosted on Digital Ocean',              │ │
│ │                                     │   │   │   'welcome': 'Welcome! Learn about Nebari\'s   │ │
│ │                                     features and configurations in <a href="https://ww'+191, │ │
│ │                                     │   │   │   'logo':                                      │ │
│ │                                     'https://raw.githubusercontent.com/nebari-dev/nebari-de… │ │
│ │                                     │   │   │   'display_version': True                      │ │
│ │                                     │   │   }                                                │ │
│ │                                     │   },                                                   │ │
│ │                                     │   'helm_extensions': [],                               │ │
│ │                                     │   'monitoring': {'enabled': True},                     │ │
│ │                                     │   ... +7                                               │ │
│ │                                     }                                                        │ │
│ │                              func = <function kubernetes_versions at 0x108669820>            │ │
│ │               grab_latest_version = True                                                     │ │
│ │                kubernetes_version = None                                                     │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /Users/ericmjl/anaconda/lib/python3.9/site-packages/nebari/utils.py:263 in                       │
│ _check_and_set_kubernetes_version                                                                │
│                                                                                                  │
│   260 │   │   │   else:                                                                          │
│   261 │   │   │   │   _raise_value_error(cloud_provider, k8s_versions)                           │
│   262 │   │   elif grab_latest_version:                                                          │
│ ❱ 263 │   │   │   cloud_config["kubernetes_version"] = k8s_versions[-1]                          │
│   264 │   │   else:                                                                              │
│   265 │   │   │   # grab oldest version                                                          │
│   266 │   │   │   cloud_config["kubernetes_version"] = k8s_versions[0]                           │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │  _raise_value_error = <function set_kubernetes_version.<locals>._raise_value_error at        │ │
│ │                       0x1098368b0>                                                           │ │
│ │        cloud_config = {                                                                      │ │
│ │                       │   'region': 'nyc3',                                                  │ │
│ │                       │   'kubernetes_version': 'PLACEHOLDER',                               │ │
│ │                       │   'node_groups': {                                                   │ │
│ │                       │   │   'general': {                                                   │ │
│ │                       │   │   │   'instance': 'g-8vcpu-32gb',                                │ │
│ │                       │   │   │   'min_nodes': 1,                                            │ │
│ │                       │   │   │   'max_nodes': 1                                             │ │
│ │                       │   │   },                                                             │ │
│ │                       │   │   'user': {                                                      │ │
│ │                       │   │   │   'instance': 'g-4vcpu-16gb',                                │ │
│ │                       │   │   │   'min_nodes': 1,                                            │ │
│ │                       │   │   │   'max_nodes': 5                                             │ │
│ │                       │   │   },                                                             │ │
│ │                       │   │   'worker': {                                                    │ │
│ │                       │   │   │   'instance': 'g-4vcpu-16gb',                                │ │
│ │                       │   │   │   'min_nodes': 1,                                            │ │
│ │                       │   │   │   'max_nodes': 5                                             │ │
│ │                       │   │   }                                                              │ │
│ │                       │   }                                                                  │ │
│ │                       }                                                                      │ │
│ │      cloud_provider = 'do'                                                                   │ │
│ │                func = <function kubernetes_versions at 0x108669820>                          │ │
│ │ grab_latest_version = True                                                                   │ │
│ │        k8s_versions = []                                                                     │ │
│ │  kubernetes_version = None                                                                   │ │
│ │              region = 'nyc3'                                                                 │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
IndexError: list index out of range

Translating the stack trace into English via ChatGPT, I get the following explanation:

Based on the provided stack trace, the error occurred in the file nebari/utils.py at line 263. The specific error is an IndexError, which means that the code tried to access an element in a list using an index that is outside the valid range of indices for that list.

In this case, the code is trying to set the value of cloud_config["kubernetes_version"] based on the available Kubernetes versions (k8s_versions). However, it seems that the k8s_versions list is empty (no elements), so when the code tries to access k8s_versions[-1] (the last element), it raises an IndexError because there are no elements to retrieve.

To resolve this issue, you need to ensure that the k8s_versions list is populated with valid Kubernetes versions before attempting to set the value of cloud_config["kubernetes_version"].

Perhaps there may be a bug that results in k8s_versions?

@pavithraes
Copy link
Member

pavithraes commented Jun 23, 2023

@ericmjl Thanks for reporting, and I see this is your first issue - welcome!

@iameskild Do you have thoughts on what's happening here?

I'll try to reproduce as well.

Related/relevant: #1344

@pavithraes pavithraes added needs: investigation 🔍 Someone in the team needs to find the root cause and replicate this bug provider: Digital Ocean area: nebari-cli and removed needs: triage 🚦 Someone needs to have a look at this issue and triage labels Jun 23, 2023
@iameskild
Copy link
Member

iameskild commented Jun 23, 2023

Hi @ericmjl, thanks for raising this! Here is a description of the fix from my PR:

Currently the comparison of "1.24.13-do.0" <= "1.24.13" (or HIGHEST_SUPPORTED_K8S_VERSION) fails. This is an edge case where the versions are indeed equal but the additional suffix (-do.0) causes it fail. This PR ensures that these kinds of comparisons won't fail.

Let me know if you have any questions :)

@dharhas
Copy link
Member

dharhas commented Jun 23, 2023

@iameskild are we able to run installs from M1 Macbooks now. I though that was broken?

@iameskild
Copy link
Member

@dharhas deploying a cluster to one of the cloud providers works from Mac (M1 and otherwise) but local deployments do not.

@pavithraes
Copy link
Member

Thanks for the quick fix, @iameskild!

@fip17
Copy link

fip17 commented Jun 26, 2023

New user having the same problem. How do I fix that?

@iameskild
Copy link
Member

Hi @fip17, sorry for the inconvenience. You can install nebari from the develop branch to get this latest fix

pip install git+https://github.com/nebari-dev/nebari.git@develop

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: nebari-cli needs: investigation 🔍 Someone in the team needs to find the root cause and replicate this bug provider: Digital Ocean type: bug 🐛 Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

5 participants