Uploaded image for project: 'Red Hat OpenShift Data Science'
  1. Red Hat OpenShift Data Science
  2. RHODS-5354

Environment variable names are not validated in the spawner page

XMLWordPrintable

    • False
    • None
    • False
    • Release Notes
    • Yes
    • No
    • Hide
      == Environment variable names were not validated when starting a notebook server
      Environment variable names were not validated on the *Start a notebook server* page.
      If an invalid environment variable was added, users were unable to successfully start a notebook.
      The environmental variable name is now checked in real-time.
      If an invalid environment variable name is entered, an error message displays indicating valid environment variable names must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit.
      Show
      == Environment variable names were not validated when starting a notebook server Environment variable names were not validated on the *Start a notebook server* page. If an invalid environment variable was added, users were unable to successfully start a notebook. The environmental variable name is now checked in real-time. If an invalid environment variable name is entered, an error message displays indicating valid environment variable names must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit.
    • Bug Fix
    • No
    • Yes
    • None
    • RHODS 1.19
    • High

      Description of problem:

      When adding an environment variable with only digits in the name, the build status freezes, and the notebook controller outputs this error:

      1.663845121362662e+09 DEBUG events Warning {"object":

      {"kind":"Notebook","namespace":"opendatahub","name":"jupyter-nb-lferrnan","uid":"49ea52f2-fabd-457c-94bd-988549fe3817","apiVersion":"kubeflow.org/v1beta1","resourceVersion":"618045"}

      , "reason": "FailedCreate", "message": "Reissued from statefulset/jupyter-nb-lferrnan: create Pod jupyter-nb-lferrnan-0 in StatefulSet jupyter-nb-lferrnan failed error: Pod \"jupyter-nb-lferrnan-0\" is invalid: spec.containers[0].env[2].name: Invalid value: \"1341\": a valid environment variable name must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit (e.g. 'my.env-name', or 'MY_ENV.NAME', or 'MyEnvName1', regex used for validation is '[-._a-zA-Z][-._a-zA-Z0-9]*')"}

      We should have validation in the frontend to comply with this value.

      Prerequisites (if any, like setup, operators/versions):

      Steps to Reproduce

      1. Go to the spawner page
      2. Create a new env variable
      3. Fill it with digits, i.e. 1234
      4. Start the notebook, it will freeze and it won't output any error.

      Actual results:

      notebook spawn will freeze and it won't output any error.

      Expected results:

      When writing an env variable that starts with a number, have form validation.

      Reproducibility (Always/Intermittent/Only Once):

      always

      Build Details:

      Workaround:

      Not using env variables that start with digits.

      Additional info:

      a valid environment variable name must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit (e.g. 'my.env-name', or 'MY_ENV.NAME', or 'MyEnvName1', regex used for validation is '[-._a-zA-Z][-._a-zA-Z0-9]*')

      Mirroring https://github.com/opendatahub-io/odh-dashboard/issues/586

              aballantyne Andrew Ballantyne
              rhn-support-lgiorgi Luca Giorgi
              Luca Giorgi Luca Giorgi
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: