Skip to content

Conversation

@gmarciani
Copy link
Contributor

@gmarciani gmarciani commented Nov 18, 2025

Description of changes

Fix bugs that caused unhelpful validation error messages in the following cases:

  1. DevSettings is null.
  2. DevSettings/InstanceTypesData is not a valid JSON.
  3. DevSettings/InstanceTypesData is missing required fields.

Before this change the validators where returning cryptic and not actionable error messages such as 'NoneType' object has no attribute 'get'.

With this change we moved to more clear an acitonable error messages (See UX description below).

User experience after this change

When DevSettings is null:

{
  "configurationValidationErrors": [
    {
      "level": "ERROR",
      "type": "ConfigSchemaValidator",
      "message": "[('DevSettings', ['Field may not be null.'])]"
    }
  ],
  "message": "Invalid cluster configuration."
}

When DevSetting/InstanceTypesData is not a valid JSON:

{
  "message": "Invalid cluster configuration: DevSettings/InstanceTypesData is not a valid JSON."
}

When DevSettings/InstanceTypesData is missing the required field NetworkInfo/NetworkCards

{
  "configurationValidationErrors": [
    {
      "level": "ERROR",
      "type": "MultiNetworkInterfacesInstancesValidator",
      "message": "Could not determine network cards for instance type hpc5a.48xlarge"
    },
    {
      "level": "ERROR",
      "type": "ComputeResourceLaunchTemplateValidator",
      "message": "Unable to validate configuration parameters for queue q1. Could not determine network cards for instance type hpc5a.48xlarge"
    },
    {
      "level": "ERROR",
      "type": "InstancesNetworkingValidator",
      "message": "Could not determine network cards for instance type hpc5a.48xlarge"
    }
  ],
  "message": "Invalid cluster configuration."
}

User Experience before this change

When DevSettings is null:

{
  "message": "Invalid cluster configuration: 'NoneType' object has no attribute 'get'"
}

When DevSettings/InstanceTypesData is not a valid JSON:

{
  "message": "Invalid cluster configuration: Expecting ':' delimiter: line 1 column 16 (char 15)"
}

When DevSettings/InstanceTypesData is missing the requiredf field NetworkInfo/NetworkCards

{
  "configurationValidationErrors": [
    {
      "level": "ERROR",
      "type": "MultiNetworkInterfacesInstancesValidator",
      "message": "object of type 'NoneType' has no len()"
    },
    {
      "level": "ERROR",
      "type": "ComputeResourceLaunchTemplateValidator",
      "message": "Unable to validate configuration parameters for queue q1. object of type 'NoneType' has no len()"
    },
    {
      "level": "ERROR",
      "type": "InstancesNetworkingValidator",
      "message": "object of type 'NoneType' has no len()"
    }
  ],
  "message": "Invalid cluster configuration."
}

Tests

  • Manual validation of the UX described above.
  • Unit tests (existing and new ones)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@gmarciani gmarciani force-pushed the wip/mgiacomo/3150/fix-dev-settings-validation-1117-1 branch from 3989cf7 to 9089499 Compare November 18, 2025 14:39
@gmarciani gmarciani marked this pull request as ready for review November 18, 2025 14:39
@gmarciani gmarciani requested review from a team as code owners November 18, 2025 14:39
@gmarciani gmarciani force-pushed the wip/mgiacomo/3150/fix-dev-settings-validation-1117-1 branch 2 times, most recently from 47d6133 to 5011d62 Compare November 18, 2025 14:54
…DevSettings is null, DevSettings/InstanceTypesData is not a valid JSON or DevSettings/InstanceTypesData is missing required fields.

With this change we replaced the validation error message "'NoneType' object has no attribute 'get'", with a more actionable "Could not determine network cards for instance type ${instanceType}"
@gmarciani gmarciani force-pushed the wip/mgiacomo/3150/fix-dev-settings-validation-1117-1 branch from 5011d62 to e073f93 Compare November 18, 2025 14:57
@gmarciani gmarciani changed the title [Validation] Fix bug that caused unhelpful validation errors in case DevSettings is null or DevSettings/InstanceTypesData is missing required fields. [Validation] Fix bug that caused unhelpful validation errors in case DevSettings is null, DevSettings/InstanceTypesData is not a valid JSON or it is missing required fields. Nov 18, 2025
@gmarciani gmarciani enabled auto-merge (rebase) November 18, 2025 15:07
@gmarciani gmarciani merged commit 5379ca3 into aws:develop Nov 19, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants