Skip to content

Return a type error instead of panicking on null number and integer template values - #8155

Open
denik wants to merge 1 commit into
mainfrom
denik/fix-jsonschema-null
Open

denik wants to merge 1 commit into
mainfrom
denik/fix-jsonschema-null

Conversation

@denik

@denik denik commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Changes

validateNumber and validateInteger in libs/jsonschema/validate_type.go now return their usual expected type float/integer, but value is <nil> error for a JSON null instead of calling .Kind() on the nil reflect.Type that reflect.TypeOf(nil) returns. validateString and validateBoolean already handle null this way.

bundle init effect, in acceptance/bundle/templates-machinery/null-value (from the test PR):

  • --config-file {"ratio": null} for a number property: Error: failed to load config from file ratio-null.json: incorrect type for property ratio: expected type float, but value is <nil> instead of a panic.
  • "enum": [0.5, null] on a number property: Error: failed to load schema: type validation for enum at index 1 failed for property ratio: expected type float, but value is <nil> instead of a panic.
  • {"extra": null} for an integer property declared only in a root anyOf subschema: Error: failed to load config from file extra-null.json: instance does not match any of the schemas in anyOf instead of a panic. A valid {"extra": 3} gets the same error (recorded in the test PR, a separate bug), so this case shows only that the panic is gone.

Unit tests in validate_type_test.go cover nil for both validators. The stack-trace filter is no longer needed. Badness now describes only the remaining anyOf integer bug.

Why

This PR was created by analyzing coverage gaps. Coverage: http://go/cli/dashboard/coverage/file/libs/jsonschema/validate_type.go (validateNumber and validateInteger, lines 33-51).
A typo or a generated config file with a null crashes bundle init with a stack trace and a "please report this issue" message, when a one-line type error is all the user needs.

Test: #8154

Gaps and risks

  • Not tested on a TTY. The prompt path parses typed input and never produces a null, so it cannot reach these validators with nil.
  • Other null handling in libs/jsonschema is unchanged: "default": null and "const": null are treated as absent (no type check). This PR leaves those behaviors alone.
  • Integer properties declared only in anyOf are still rejected for every value; that is left for a separate fix.
  • Self-review (Opus, Astra): no findings on the fix; the changelog entry was narrowed to the cases that actually crashed.
  • Risk: low (it only turns a panic into the existing error).

🤖 AI agent (opus5.5, isaac_claude)

This pull request and its description were written by Isaac.

@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Regression test report ✅

Commit: 2fca0df8b | Workflow run

Selected 1 changed tests (limit=20, 0 not selected)

2 tests: regression=2 unreleased=0 coverage=0 failing=0
test branch main (21661cc) latest (v1.28.0)
TestAccept/bundle/templates-machinery/null-value/DMS= ✅ ❌ ❌
TestAccept/bundle/templates-machinery/null-value/DMS=true ✅ ❌ ❌
TestAccept/bundle/templates-machinery/null-value/DMS=: branch ✅ | main (21661cc) ❌ | latest (v1.28.0) ❌

main (21661cc):

acceptance_test.go:1402: Diff:
        --- bundle/templates-machinery/null-value/output.txt
        +++ /tmp/TestAcceptbundletemplates-machinerynull-valueDMS=90847600/002/output.txt
        @@ -2,8 +2,53 @@
         === number property set to null in the config file
         
         >>> musterr [CLI] bundle init . --config-file ratio-null.json --output-dir rendered
        -Error: failed to load config from file ratio-null.json: incorrect type for property ratio: expected type float, but value is <nil>
        +The Databricks CLI unexpectedly had a fatal error.
        +Please report this issue to Databricks in the form of a GitHub issue at:
        +https://github.com/databricks/cli
         
        +CLI Version: [CLI_VERSION]
        +
        +Panic Payload: runtime error: invalid memory address or nil pointer dereference
        +
        +Stack Trace:
        +goroutine 1 [running]:
        +runtime/debug.Stack()
        +	/opt/hostedtoolcache/go/[GO_VERSION]/x64/src/runtime/debug/stack.go:26 +0x5e
        +github.com/databricks/cli/cmd/root.execute.func1()
        +	/tmp/TestAccept1763441664/001/cmd/root/root.go:169 +0xd4
        +panic({0x361b1c8?, 0x3ba8b40?})
        +	/opt/hostedtoolcache/go/[GO_VERSION]/x64/src/runtime/panic.go:859 +0x125
        +github.com/databricks/cli/libs/jsonschema.validateNumber({0x0?, 0x0?})
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/validate_type.go:35 +0x3d
        +github.com/databricks/cli/libs/jsonschema.validateType(...)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/validate_type.go:16
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validateTypes(0x22ac4441e200, 0x22ac4436d320?)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/instance.go:95 +0xea
        +github.com/databricks/cli/libs/jsonschema.(*Schema).ValidateInstance(0x22ac44481000?, 0x22ac4436d320)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/instance.go:53 +0x12a
        +github.com/databricks/cli/libs/jsonschema.(*Schema).LoadInstance(0x22ac4441e200, {0x7ffff864608c, 0xf})
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/instance.go:37 +0x34a
        +github.com/databricks/cli/libs/template.(*config).assignValuesFromFile(0x22ac44297e20, {0x7ffff864608c, 0xf})
        +	/tmp/TestAccept1763441664/001/libs/template/config.go:86 +0x74
        +github.com/databricks/cli/libs/template.(*defaultWriter).promptForInput(0x22ac4424e140, {0x3985700, 0x22ac4436ce40}, {0x3982b18?, 0x22ac4420e1c0?})
        +	/tmp/TestAccept1763441664/001/libs/template/writer.go:117 +0xae
        +github.com/databricks/cli/libs/template.(*defaultWriter).Materialize(0x22ac4424e140, {0x3985700, 0x22ac4436ce40}, {0x3982b18?, 0x22ac4420e1c0?})
        +	/tmp/TestAccept1763441664/001/libs/template/writer.go:168 +0x30
        +github.com/databricks/cli/cmd/bundle.newInitCommand.func1(0x22ac4461a608, {0x22ac444c1c20?, 0x4?, 0x1c31e56?})
        +	/tmp/TestAccept1763441664/001/cmd/bundle/init.go:92 +0x453
        +github.com/spf13/cobra.(*Command).execute(0x22ac4461a608, {0x22ac444c1bd0, 0x5, 0x5})
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1015 +0xb3c
        +github.com/spf13/cobra.(*Command).ExecuteC(0x22ac44372c08)
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1148 +0x450
        +github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1080
        +github.com/databricks/cli/cmd/root.execute({0x39856c8, 0x3c1a560}, 0x22ac44372c08, {0x22ac442aa590, 0x7, 0x7})
        +	/tmp/TestAccept1763441664/001/cmd/root/root.go:231 +0x413
        +github.com/databricks/cli/cmd/root.(*Tree).Execute(0x22ac444f98f0, {0x39856c8, 0x3c1a560}, {0x22ac442aa590, 0x7, 0x7})
        +	/tmp/TestAccept1763441664/001/cmd/root/tree.go:65 +0x57
        +main.main()
        +	/tmp/TestAccept1763441664/001/main.go:36 +0x125
        +
         === integer property set to null in the config file
         
         >>> musterr [CLI] bundle init . --config-file count-null.json --output-dir rendered
        @@ -12,13 +56,109 @@
         === null in the enum of a number property
         
         >>> musterr [CLI] bundle init ./enum-null --output-dir rendered
        -Error: failed to load schema: type validation for enum at index 1 failed for property ratio: expected type float, but value is <nil>
        +The Databricks CLI unexpectedly had a fatal error.
        +Please report this issue to Databricks in the form of a GitHub issue at:
        +https://github.com/databricks/cli
         
        +CLI Version: [CLI_VERSION]
        +
        +Panic Payload: runtime error: invalid memory address or nil pointer dereference
        +
        +Stack Trace:
        +goroutine 1 [running]:
        +runtime/debug.Stack()
        +	/opt/hostedtoolcache/go/[GO_VERSION]/x64/src/runtime/debug/stack.go:26 +0x5e
        +github.com/databricks/cli/cmd/root.execute.func1()
        +	/tmp/TestAccept1763441664/001/cmd/root/root.go:169 +0xd4
        +panic({0x361b1c8?, 0x3ba8b40?})
        +	/opt/hostedtoolcache/go/[GO_VERSION]/x64/src/runtime/panic.go:859 +0x125
        +github.com/databricks/cli/libs/jsonschema.validateNumber({0x0?, 0x0?})
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/validate_type.go:35 +0x3d
        +github.com/databricks/cli/libs/jsonschema.validateType(...)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/validate_type.go:16
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validateSchemaEnumValueTypes(0xa?)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/schema.go:213 +0x142
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validate(0x325592509c00)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/schema.go:312 +0x21b
        +github.com/databricks/cli/libs/jsonschema.LoadFS({0x396dec0?, 0x325592969210?}, {0x1c7e61a?, 0x9?})
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/schema.go:367 +0x51c
        +github.com/databricks/cli/libs/template.loadSchemaAndResolveTemplateDir({0x7ffef7dd2090, 0xb})
        +	/tmp/TestAccept1763441664/001/libs/template/reader.go:207 +0x53
        +github.com/databricks/cli/libs/template.(*localReader).LoadSchemaAndTemplateFS(0x7ffef7dd2090?, {0x0?, 0x0?})
        +	/tmp/TestAccept1763441664/001/libs/template/reader.go:194 +0x1d
        +github.com/databricks/cli/libs/template.(*defaultWriter).promptForInput(0x325592929c80, {0x3985700, 0x3255929e1440}, {0x3982b18?, 0x3255929691f0?})
        +	/tmp/TestAccept1763441664/001/libs/template/writer.go:105 +0x3d
        +github.com/databricks/cli/libs/template.(*defaultWriter).Materialize(0x325592929c80, {0x3985700, 0x3255929e1440}, {0x3982b18?, 0x3255929691f0?})
        +	/tmp/TestAccept1763441664/001/libs/template/writer.go:168 +0x30
        +github.com/databricks/cli/cmd/bundle.newInitCommand.func1(0x3255929bbb08, {0x3255929e07e0?, 0x4?, 0x1c31e56?})
        +	/tmp/TestAccept1763441664/001/cmd/bundle/init.go:92 +0x453
        +github.com/spf13/cobra.(*Command).execute(0x3255929bbb08, {0x3255929e0780, 0x3, 0x3})
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1015 +0xb3c
        +github.com/spf13/cobra.(*Command).ExecuteC(0x3255928ba308)
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1148 +0x450
        +github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1080
        +github.com/databricks/cli/cmd/root.execute({0x39856c8, 0x3c1a560}, 0x3255928ba308, {0x3255926345b0, 0x5, 0x5})
        +	/tmp/TestAccept1763441664/001/cmd/root/root.go:231 +0x413
        +github.com/databricks/cli/cmd/root.(*Tree).Execute(0x32559257dd60, {0x39856c8, 0x3c1a560}, {0x3255926345b0, 0x5, 0x5})
        +	/tmp/TestAccept1763441664/001/cmd/root/tree.go:65 +0x57
        +main.main()
        +	/tmp/TestAccept1763441664/001/main.go:36 +0x125
        +
         === integer property declared only in anyOf set to null in the config file
         
         >>> musterr [CLI] bundle init ./any-of --config-file extra-null.json --output-dir rendered
        -Error: failed to load config from file extra-null.json: instance does not match any of the schemas in anyOf
        +The Databricks CLI unexpectedly had a fatal error.
        +Please report this issue to Databricks in the form of a GitHub issue at:
        +https://github.com/databricks/cli
         
        +CLI Version: [CLI_VERSION]
        +
        +Panic Payload: runtime error: invalid memory address or nil pointer dereference
        +
        +Stack Trace:
        +goroutine 1 [running]:
        +runtime/debug.Stack()
        +	/opt/hostedtoolcache/go/[GO_VERSION]/x64/src/runtime/debug/stack.go:26 +0x5e
        +github.com/databricks/cli/cmd/root.execute.func1()
        +	/tmp/TestAccept1763441664/001/cmd/root/root.go:169 +0xd4
        +panic({0x361b1c8?, 0x3ba8b40?})
        +	/opt/hostedtoolcache/go/[GO_VERSION]/x64/src/runtime/panic.go:859 +0x125
        +github.com/databricks/cli/libs/jsonschema.validateInteger({0x0?, 0x0?})
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/validate_type.go:47 +0x52
        +github.com/databricks/cli/libs/jsonschema.validateType(...)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/validate_type.go:16
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validateTypes(0xa5fae88e200, 0xa5fae8731a0?)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/instance.go:95 +0xea
        +github.com/databricks/cli/libs/jsonschema.(*Schema).ValidateInstance(0x359b470?, 0xa5fae8731a0)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/instance.go:53 +0x12a
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validateAnyOf(0xa5fae61f800?, 0xa5fae8731a0)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/instance.go:157 +0x1cc
        +github.com/databricks/cli/libs/jsonschema.(*Schema).ValidateInstance(0xa5fae680c00?, 0xa5fae8731a0)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/instance.go:53 +0x12a
        +github.com/databricks/cli/libs/jsonschema.(*Schema).LoadInstance(0xa5fae61f800, {0x7fff539f908c, 0xf})
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/instance.go:37 +0x34a
        +github.com/databricks/cli/libs/template.(*config).assignValuesFromFile(0xa5fae764da0, {0x7fff539f908c, 0xf})
        +	/tmp/TestAccept1763441664/001/libs/template/config.go:86 +0x74
        +github.com/databricks/cli/libs/template.(*defaultWriter).promptForInput(0xa5fae83eb40, {0x3985700, 0xa5fae872cf0}, {0x3982b18?, 0xa5fae8624b0?})
        +	/tmp/TestAccept1763441664/001/libs/template/writer.go:117 +0xae
        +github.com/databricks/cli/libs/template.(*defaultWriter).Materialize(0xa5fae83eb40, {0x3985700, 0xa5fae872cf0}, {0x3982b18?, 0xa5fae8624b0?})
        +	/tmp/TestAccept1763441664/001/libs/template/writer.go:168 +0x30
        +github.com/databricks/cli/cmd/bundle.newInitCommand.func1(0xa5fae852308, {0xa5fae6c19a0?, 0x4?, 0x1c31e56?})
        +	/tmp/TestAccept1763441664/001/cmd/bundle/init.go:92 +0x453
        +github.com/spf13/cobra.(*Command).execute(0xa5fae852308, {0xa5fae6c1950, 0x5, 0x5})
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1015 +0xb3c
        +github.com/spf13/cobra.(*Command).ExecuteC(0xa5fae456008)
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1148 +0x450
        +github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1080
        +github.com/databricks/cli/cmd/root.execute({0x39856c8, 0x3c1a560}, 0xa5fae456008, {0xa5fae4aa590, 0x7, 0x7})
        +	/tmp/TestAccept1763441664/001/cmd/root/root.go:231 +0x413
        +github.com/databricks/cli/cmd/root.(*Tree).Execute(0xa5fae3be3d0, {0x39856c8, 0x3c1a560}, {0xa5fae4aa590, 0x7, 0x7})
        +	/tmp/TestAccept1763441664/001/cmd/root/tree.go:65 +0x57
        +main.main()
        +	/tmp/TestAccept1763441664/001/main.go:36 +0x125
        +
         === integer property declared only in anyOf set to a valid integer in the config file
         
         >>> musterr [CLI] bundle init ./any-of --config-file extra-3.json --output-dir rendered
        
FAIL

latest (v1.28.0):

acceptance_test.go:1402: Diff:
        --- bundle/templates-machinery/null-value/output.txt
        +++ /tmp/TestAcceptbundletemplates-machinerynull-valueDMS=3643934353/002/output.txt
        @@ -2,8 +2,53 @@
         === number property set to null in the config file
         
         >>> musterr [CLI] bundle init . --config-file ratio-null.json --output-dir rendered
        -Error: failed to load config from file ratio-null.json: incorrect type for property ratio: expected type float, but value is <nil>
        +The Databricks CLI unexpectedly had a fatal error.
        +Please report this issue to Databricks in the form of a GitHub issue at:
        +https://github.com/databricks/cli
         
        +CLI Version: [CLI_VERSION]
        +
        +Panic Payload: runtime error: invalid memory address or nil pointer dereference
        +
        +Stack Trace:
        +goroutine 1 [running]:
        +runtime/debug.Stack()
        +	runtime/debug/stack.go:26 +0x5e
        +github.com/databricks/cli/cmd/root.execute.func1()
        +	github.com/databricks/cli/cmd/root/root.go:167 +0xd4
        +panic({0x352bad0?, 0x3aa09c0?})
        +	runtime/panic.go:859 +0x125
        +github.com/databricks/cli/libs/jsonschema.validateNumber({0x0?, 0x0?})
        +	github.com/databricks/cli/libs/jsonschema/validate_type.go:35 +0x3d
        +github.com/databricks/cli/libs/jsonschema.validateType(...)
        +	github.com/databricks/cli/libs/jsonschema/validate_type.go:16
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validateTypes(0x19eb052fc000, 0x19eb05487380?)
        +	github.com/databricks/cli/libs/jsonschema/instance.go:95 +0xea
        +github.com/databricks/cli/libs/jsonschema.(*Schema).ValidateInstance(0x19eb052f7000?, 0x19eb05487380)
        +	github.com/databricks/cli/libs/jsonschema/instance.go:53 +0x12a
        +github.com/databricks/cli/libs/jsonschema.(*Schema).LoadInstance(0x19eb052fc000, {0x7ffdb87d4020, 0xf})
        +	github.com/databricks/cli/libs/jsonschema/instance.go:37 +0x34a
        +github.com/databricks/cli/libs/template.(*config).assignValuesFromFile(0x19eb053be340, {0x7ffdb87d4020, 0xf})
        +	github.com/databricks/cli/libs/template/config.go:86 +0x74
        +github.com/databricks/cli/libs/template.(*defaultWriter).promptForInput(0x19eb053dc140, {0x3885670, 0x19eb05486ea0}, {0x3882cf8?, 0x19eb050661d0?})
        +	github.com/databricks/cli/libs/template/writer.go:117 +0xae
        +github.com/databricks/cli/libs/template.(*defaultWriter).Materialize(0x19eb053dc140, {0x3885670, 0x19eb05486ea0}, {0x3882cf8?, 0x19eb050661d0?})
        +	github.com/databricks/cli/libs/template/writer.go:168 +0x30
        +github.com/databricks/cli/cmd/bundle.newInitCommand.func1(0x19eb05466308, {0x19eb05337a40?, 0x4?, 0x1bc2e36?})
        +	github.com/databricks/cli/cmd/bundle/init.go:92 +0x453
        +github.com/spf13/cobra.(*Command).execute(0x19eb05466308, {0x19eb053379f0, 0x5, 0x5})
        +	github.com/spf13/cobra@v1.10.2/command.go:1015 +0xb3c
        +github.com/spf13/cobra.(*Command).ExecuteC(0x19eb051e4c08)
        +	github.com/spf13/cobra@v1.10.2/command.go:1148 +0x450
        +github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        +	github.com/spf13/cobra@v1.10.2/command.go:1080
        +github.com/databricks/cli/cmd/root.execute({0x3885638, 0x3b11cc0}, 0x19eb051e4c08, {0x19eb0511e590, 0x7, 0x7})
        +	github.com/databricks/cli/cmd/root/root.go:227 +0x3b6
        +github.com/databricks/cli/cmd/root.(*Tree).Execute(0x19eb053673c0, {0x3885638, 0x3b11cc0}, {0x19eb0511e590, 0x7, 0x7})
        +	github.com/databricks/cli/cmd/root/tree.go:65 +0x57
        +main.main()
        +	github.com/databricks/cli/main.go:36 +0x125
        +
         === integer property set to null in the config file
         
         >>> musterr [CLI] bundle init . --config-file count-null.json --output-dir rendered
        @@ -12,13 +56,109 @@
         === null in the enum of a number property
         
         >>> musterr [CLI] bundle init ./enum-null --output-dir rendered
        -Error: failed to load schema: type validation for enum at index 1 failed for property ratio: expected type float, but value is <nil>
        +The Databricks CLI unexpectedly had a fatal error.
        +Please report this issue to Databricks in the form of a GitHub issue at:
        +https://github.com/databricks/cli
         
        +CLI Version: [CLI_VERSION]
        +
        +Panic Payload: runtime error: invalid memory address or nil pointer dereference
        +
        +Stack Trace:
        +goroutine 1 [running]:
        +runtime/debug.Stack()
        +	runtime/debug/stack.go:26 +0x5e
        +github.com/databricks/cli/cmd/root.execute.func1()
        +	github.com/databricks/cli/cmd/root/root.go:167 +0xd4
        +panic({0x352bad0?, 0x3aa09c0?})
        +	runtime/panic.go:859 +0x125
        +github.com/databricks/cli/libs/jsonschema.validateNumber({0x0?, 0x0?})
        +	github.com/databricks/cli/libs/jsonschema/validate_type.go:35 +0x3d
        +github.com/databricks/cli/libs/jsonschema.validateType(...)
        +	github.com/databricks/cli/libs/jsonschema/validate_type.go:16
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validateSchemaEnumValueTypes(0x6?)
        +	github.com/databricks/cli/libs/jsonschema/schema.go:213 +0x142
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validate(0x7bb1a56ba00)
        +	github.com/databricks/cli/libs/jsonschema/schema.go:312 +0x21b
        +github.com/databricks/cli/libs/jsonschema.LoadFS({0x386e308?, 0x7bb1a927840?}, {0x1c0e8a9?, 0xc?})
        +	github.com/databricks/cli/libs/jsonschema/schema.go:367 +0x51c
        +github.com/databricks/cli/libs/template.loadSchemaAndResolveTemplateDir({0x7ffdda64c024, 0xb})
        +	github.com/databricks/cli/libs/template/reader.go:207 +0x53
        +github.com/databricks/cli/libs/template.(*localReader).LoadSchemaAndTemplateFS(0x7ffdda64c024?, {0x0?, 0x0?})
        +	github.com/databricks/cli/libs/template/reader.go:194 +0x1d
        +github.com/databricks/cli/libs/template.(*defaultWriter).promptForInput(0x7bb1aa262c0, {0x3885670, 0x7bb1aa0f740}, {0x3882cf8?, 0x7bb1a927820?})
        +	github.com/databricks/cli/libs/template/writer.go:105 +0x3d
        +github.com/databricks/cli/libs/template.(*defaultWriter).Materialize(0x7bb1aa262c0, {0x3885670, 0x7bb1aa0f740}, {0x3882cf8?, 0x7bb1a927820?})
        +	github.com/databricks/cli/libs/template/writer.go:168 +0x30
        +github.com/databricks/cli/cmd/bundle.newInitCommand.func1(0x7bb1a9e7b08, {0x7bb1aa0eae0?, 0x4?, 0x1bc2e36?})
        +	github.com/databricks/cli/cmd/bundle/init.go:92 +0x453
        +github.com/spf13/cobra.(*Command).execute(0x7bb1a9e7b08, {0x7bb1aa0ea80, 0x3, 0x3})
        +	github.com/spf13/cobra@v1.10.2/command.go:1015 +0xb3c
        +github.com/spf13/cobra.(*Command).ExecuteC(0x7bb1a8c0608)
        +	github.com/spf13/cobra@v1.10.2/command.go:1148 +0x450
        +github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        +	github.com/spf13/cobra@v1.10.2/command.go:1080
        +github.com/databricks/cli/cmd/root.execute({0x3885638, 0x3b11cc0}, 0x7bb1a8c0608, {0x7bb1a6a65b0, 0x5, 0x5})
        +	github.com/databricks/cli/cmd/root/root.go:227 +0x3b6
        +github.com/databricks/cli/cmd/root.(*Tree).Execute(0x7bb1a926520, {0x3885638, 0x3b11cc0}, {0x7bb1a6a65b0, 0x5, 0x5})
        +	github.com/databricks/cli/cmd/root/tree.go:65 +0x57
        +main.main()
        +	github.com/databricks/cli/main.go:36 +0x125
        +
         === integer property declared only in anyOf set to null in the config file
         
         >>> musterr [CLI] bundle init ./any-of --config-file extra-null.json --output-dir rendered
        -Error: failed to load config from file extra-null.json: instance does not match any of the schemas in anyOf
        +The Databricks CLI unexpectedly had a fatal error.
        +Please report this issue to Databricks in the form of a GitHub issue at:
        +https://github.com/databricks/cli
         
        +CLI Version: [CLI_VERSION]
        +
        +Panic Payload: runtime error: invalid memory address or nil pointer dereference
        +
        +Stack Trace:
        +goroutine 1 [running]:
        +runtime/debug.Stack()
        +	runtime/debug/stack.go:26 +0x5e
        +github.com/databricks/cli/cmd/root.execute.func1()
        +	github.com/databricks/cli/cmd/root/root.go:167 +0xd4
        +panic({0x352bad0?, 0x3aa09c0?})
        +	runtime/panic.go:859 +0x125
        +github.com/databricks/cli/libs/jsonschema.validateInteger({0x0?, 0x0?})
        +	github.com/databricks/cli/libs/jsonschema/validate_type.go:47 +0x52
        +github.com/databricks/cli/libs/jsonschema.validateType(...)
        +	github.com/databricks/cli/libs/jsonschema/validate_type.go:16
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validateTypes(0x1be927d14200, 0x1be927d06bd0?)
        +	github.com/databricks/cli/libs/jsonschema/instance.go:95 +0xea
        +github.com/databricks/cli/libs/jsonschema.(*Schema).ValidateInstance(0x34aeba8?, 0x1be927d06bd0)
        +	github.com/databricks/cli/libs/jsonschema/instance.go:53 +0x12a
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validateAnyOf(0x1be927b7d800?, 0x1be927d06bd0)
        +	github.com/databricks/cli/libs/jsonschema/instance.go:157 +0x1cc
        +github.com/databricks/cli/libs/jsonschema.(*Schema).ValidateInstance(0x1be927b77000?, 0x1be927d06bd0)
        +	github.com/databricks/cli/libs/jsonschema/instance.go:53 +0x12a
        +github.com/databricks/cli/libs/jsonschema.(*Schema).LoadInstance(0x1be927b7d800, {0x7ffeaced2020, 0xf})
        +	github.com/databricks/cli/libs/jsonschema/instance.go:37 +0x34a
        +github.com/databricks/cli/libs/template.(*config).assignValuesFromFile(0x1be927c3ef60, {0x7ffeaced2020, 0xf})
        +	github.com/databricks/cli/libs/template/config.go:86 +0x74
        +github.com/databricks/cli/libs/template.(*defaultWriter).promptForInput(0x1be927c5ce40, {0x3885670, 0x1be927d06720}, {0x3882cf8?, 0x1be927ce87d0?})
        +	github.com/databricks/cli/libs/template/writer.go:117 +0xae
        +github.com/databricks/cli/libs/template.(*defaultWriter).Materialize(0x1be927c5ce40, {0x3885670, 0x1be927d06720}, {0x3882cf8?, 0x1be927ce87d0?})
        +	github.com/databricks/cli/libs/template/writer.go:168 +0x30
        +github.com/databricks/cli/cmd/bundle.newInitCommand.func1(0x1be927ce6308, {0x1be927bb7a40?, 0x4?, 0x1bc2e36?})
        +	github.com/databricks/cli/cmd/bundle/init.go:92 +0x453
        +github.com/spf13/cobra.(*Command).execute(0x1be927ce6308, {0x1be927bb79f0, 0x5, 0x5})
        +	github.com/spf13/cobra@v1.10.2/command.go:1015 +0xb3c
        +github.com/spf13/cobra.(*Command).ExecuteC(0x1be927a64c08)
        +	github.com/spf13/cobra@v1.10.2/command.go:1148 +0x450
        +github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        +	github.com/spf13/cobra@v1.10.2/command.go:1080
        +github.com/databricks/cli/cmd/root.execute({0x3885638, 0x3b11cc0}, 0x1be927a64c08, {0x1be92799e590, 0x7, 0x7})
        +	github.com/databricks/cli/cmd/root/root.go:227 +0x3b6
        +github.com/databricks/cli/cmd/root.(*Tree).Execute(0x1be927be73c0, {0x3885638, 0x3b11cc0}, {0x1be92799e590, 0x7, 0x7})
        +	github.com/databricks/cli/cmd/root/tree.go:65 +0x57
        +main.main()
        +	github.com/databricks/cli/main.go:36 +0x125
        +
         === integer property declared only in anyOf set to a valid integer in the config file
         
         >>> musterr [CLI] bundle init ./any-of --config-file extra-3.json --output-dir rendered
        
FAIL
TestAccept/bundle/templates-machinery/null-value/DMS=true: branch ✅ | main (21661cc) ❌ | latest (v1.28.0) ❌

main (21661cc):

acceptance_test.go:1402: Diff:
        --- bundle/templates-machinery/null-value/output.txt
        +++ /tmp/TestAcceptbundletemplates-machinerynull-valueDMS=true3880723069/002/output.txt
        @@ -2,8 +2,53 @@
         === number property set to null in the config file
         
         >>> musterr [CLI] bundle init . --config-file ratio-null.json --output-dir rendered
        -Error: failed to load config from file ratio-null.json: incorrect type for property ratio: expected type float, but value is <nil>
        +The Databricks CLI unexpectedly had a fatal error.
        +Please report this issue to Databricks in the form of a GitHub issue at:
        +https://github.com/databricks/cli
         
        +CLI Version: [CLI_VERSION]
        +
        +Panic Payload: runtime error: invalid memory address or nil pointer dereference
        +
        +Stack Trace:
        +goroutine 1 [running]:
        +runtime/debug.Stack()
        +	/opt/hostedtoolcache/go/[GO_VERSION]/x64/src/runtime/debug/stack.go:26 +0x5e
        +github.com/databricks/cli/cmd/root.execute.func1()
        +	/tmp/TestAccept1763441664/001/cmd/root/root.go:169 +0xd4
        +panic({0x361b1c8?, 0x3ba8b40?})
        +	/opt/hostedtoolcache/go/[GO_VERSION]/x64/src/runtime/panic.go:859 +0x125
        +github.com/databricks/cli/libs/jsonschema.validateNumber({0x0?, 0x0?})
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/validate_type.go:35 +0x3d
        +github.com/databricks/cli/libs/jsonschema.validateType(...)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/validate_type.go:16
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validateTypes(0x3d149482e200, 0x3d1494834c00?)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/instance.go:95 +0xea
        +github.com/databricks/cli/libs/jsonschema.(*Schema).ValidateInstance(0x3d1494673000?, 0x3d1494834c00)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/instance.go:53 +0x12a
        +github.com/databricks/cli/libs/jsonschema.(*Schema).LoadInstance(0x3d149482e200, {0x7ffd1edde060, 0xf})
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/instance.go:37 +0x34a
        +github.com/databricks/cli/libs/template.(*config).assignValuesFromFile(0x3d149474c420, {0x7ffd1edde060, 0xf})
        +	/tmp/TestAccept1763441664/001/libs/template/config.go:86 +0x74
        +github.com/databricks/cli/libs/template.(*defaultWriter).promptForInput(0x3d1494816740, {0x3985700, 0x3d1494834720}, {0x3982b18?, 0x3d14946285e0?})
        +	/tmp/TestAccept1763441664/001/libs/template/writer.go:117 +0xae
        +github.com/databricks/cli/libs/template.(*defaultWriter).Materialize(0x3d1494816740, {0x3985700, 0x3d1494834720}, {0x3982b18?, 0x3d14946285e0?})
        +	/tmp/TestAccept1763441664/001/libs/template/writer.go:168 +0x30
        +github.com/databricks/cli/cmd/bundle.newInitCommand.func1(0x3d1494800608, {0x3d14946b1c20?, 0x4?, 0x1c31e56?})
        +	/tmp/TestAccept1763441664/001/cmd/bundle/init.go:92 +0x453
        +github.com/spf13/cobra.(*Command).execute(0x3d1494800608, {0x3d14946b1bd0, 0x5, 0x5})
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1015 +0xb3c
        +github.com/spf13/cobra.(*Command).ExecuteC(0x3d149455ec08)
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1148 +0x450
        +github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1080
        +github.com/databricks/cli/cmd/root.execute({0x39856c8, 0x3c1a560}, 0x3d149455ec08, {0x3d14943ae610, 0x7, 0x7})
        +	/tmp/TestAccept1763441664/001/cmd/root/root.go:231 +0x413
        +github.com/databricks/cli/cmd/root.(*Tree).Execute(0x3d14946e3940, {0x39856c8, 0x3c1a560}, {0x3d14943ae610, 0x7, 0x7})
        +	/tmp/TestAccept1763441664/001/cmd/root/tree.go:65 +0x57
        +main.main()
        +	/tmp/TestAccept1763441664/001/main.go:36 +0x125
        +
         === integer property set to null in the config file
         
         >>> musterr [CLI] bundle init . --config-file count-null.json --output-dir rendered
        @@ -12,13 +56,109 @@
         === null in the enum of a number property
         
         >>> musterr [CLI] bundle init ./enum-null --output-dir rendered
        -Error: failed to load schema: type validation for enum at index 1 failed for property ratio: expected type float, but value is <nil>
        +The Databricks CLI unexpectedly had a fatal error.
        +Please report this issue to Databricks in the form of a GitHub issue at:
        +https://github.com/databricks/cli
         
        +CLI Version: [CLI_VERSION]
        +
        +Panic Payload: runtime error: invalid memory address or nil pointer dereference
        +
        +Stack Trace:
        +goroutine 1 [running]:
        +runtime/debug.Stack()
        +	/opt/hostedtoolcache/go/[GO_VERSION]/x64/src/runtime/debug/stack.go:26 +0x5e
        +github.com/databricks/cli/cmd/root.execute.func1()
        +	/tmp/TestAccept1763441664/001/cmd/root/root.go:169 +0xd4
        +panic({0x361b1c8?, 0x3ba8b40?})
        +	/opt/hostedtoolcache/go/[GO_VERSION]/x64/src/runtime/panic.go:859 +0x125
        +github.com/databricks/cli/libs/jsonschema.validateNumber({0x0?, 0x0?})
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/validate_type.go:35 +0x3d
        +github.com/databricks/cli/libs/jsonschema.validateType(...)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/validate_type.go:16
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validateSchemaEnumValueTypes(0xa?)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/schema.go:213 +0x142
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validate(0x2c54dba36200)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/schema.go:312 +0x21b
        +github.com/databricks/cli/libs/jsonschema.LoadFS({0x396dec0?, 0x2c54dba002d0?}, {0x1c7e61a?, 0x2c54db73a3c0?})
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/schema.go:367 +0x51c
        +github.com/databricks/cli/libs/template.loadSchemaAndResolveTemplateDir({0x7ffdca9df064, 0xb})
        +	/tmp/TestAccept1763441664/001/libs/template/reader.go:207 +0x53
        +github.com/databricks/cli/libs/template.(*localReader).LoadSchemaAndTemplateFS(0x7ffdca9df064?, {0x0?, 0x0?})
        +	/tmp/TestAccept1763441664/001/libs/template/reader.go:194 +0x1d
        +github.com/databricks/cli/libs/template.(*defaultWriter).promptForInput(0x2c54dbaf80c0, {0x3985700, 0x2c54dbafd770}, {0x3982b18?, 0x2c54dba002b0?})
        +	/tmp/TestAccept1763441664/001/libs/template/writer.go:105 +0x3d
        +github.com/databricks/cli/libs/template.(*defaultWriter).Materialize(0x2c54dbaf80c0, {0x3985700, 0x2c54dbafd770}, {0x3982b18?, 0x2c54dba002b0?})
        +	/tmp/TestAccept1763441664/001/libs/template/writer.go:168 +0x30
        +github.com/databricks/cli/cmd/bundle.newInitCommand.func1(0x2c54dbbc6008, {0x2c54db9ebd40?, 0x4?, 0x1c31e56?})
        +	/tmp/TestAccept1763441664/001/cmd/bundle/init.go:92 +0x453
        +github.com/spf13/cobra.(*Command).execute(0x2c54dbbc6008, {0x2c54db9ebce0, 0x3, 0x3})
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1015 +0xb3c
        +github.com/spf13/cobra.(*Command).ExecuteC(0x2c54dba6e308)
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1148 +0x450
        +github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1080
        +github.com/databricks/cli/cmd/root.execute({0x39856c8, 0x3c1a560}, 0x2c54dba6e308, {0x2c54db722670, 0x5, 0x5})
        +	/tmp/TestAccept1763441664/001/cmd/root/root.go:231 +0x413
        +github.com/databricks/cli/cmd/root.(*Tree).Execute(0x2c54dba01680, {0x39856c8, 0x3c1a560}, {0x2c54db722670, 0x5, 0x5})
        +	/tmp/TestAccept1763441664/001/cmd/root/tree.go:65 +0x57
        +main.main()
        +	/tmp/TestAccept1763441664/001/main.go:36 +0x125
        +
         === integer property declared only in anyOf set to null in the config file
         
         >>> musterr [CLI] bundle init ./any-of --config-file extra-null.json --output-dir rendered
        -Error: failed to load config from file extra-null.json: instance does not match any of the schemas in anyOf
        +The Databricks CLI unexpectedly had a fatal error.
        +Please report this issue to Databricks in the form of a GitHub issue at:
        +https://github.com/databricks/cli
         
        +CLI Version: [CLI_VERSION]
        +
        +Panic Payload: runtime error: invalid memory address or nil pointer dereference
        +
        +Stack Trace:
        +goroutine 1 [running]:
        +runtime/debug.Stack()
        +	/opt/hostedtoolcache/go/[GO_VERSION]/x64/src/runtime/debug/stack.go:26 +0x5e
        +github.com/databricks/cli/cmd/root.execute.func1()
        +	/tmp/TestAccept1763441664/001/cmd/root/root.go:169 +0xd4
        +panic({0x361b1c8?, 0x3ba8b40?})
        +	/opt/hostedtoolcache/go/[GO_VERSION]/x64/src/runtime/panic.go:859 +0x125
        +github.com/databricks/cli/libs/jsonschema.validateInteger({0x0?, 0x0?})
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/validate_type.go:47 +0x52
        +github.com/databricks/cli/libs/jsonschema.validateType(...)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/validate_type.go:16
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validateTypes(0x341e15754800, 0x341e15756450?)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/instance.go:95 +0xea
        +github.com/databricks/cli/libs/jsonschema.(*Schema).ValidateInstance(0x359b470?, 0x341e15756450)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/instance.go:53 +0x12a
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validateAnyOf(0x341e15754000?, 0x341e15756450)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/instance.go:157 +0x1cc
        +github.com/databricks/cli/libs/jsonschema.(*Schema).ValidateInstance(0x341e15581000?, 0x341e15756450)
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/instance.go:53 +0x12a
        +github.com/databricks/cli/libs/jsonschema.(*Schema).LoadInstance(0x341e15754000, {0x7ffde8702060, 0xf})
        +	/tmp/TestAccept1763441664/001/libs/jsonschema/instance.go:37 +0x34a
        +github.com/databricks/cli/libs/template.(*config).assignValuesFromFile(0x341e15665240, {0x7ffde8702060, 0xf})
        +	/tmp/TestAccept1763441664/001/libs/template/config.go:86 +0x74
        +github.com/databricks/cli/libs/template.(*defaultWriter).promptForInput(0x341e1573c580, {0x3985700, 0x341e15725e90}, {0x3982b18?, 0x341e156c2d90?})
        +	/tmp/TestAccept1763441664/001/libs/template/writer.go:117 +0xae
        +github.com/databricks/cli/libs/template.(*defaultWriter).Materialize(0x341e1573c580, {0x3985700, 0x341e15725e90}, {0x3982b18?, 0x341e156c2d90?})
        +	/tmp/TestAccept1763441664/001/libs/template/writer.go:168 +0x30
        +github.com/databricks/cli/cmd/bundle.newInitCommand.func1(0x341e1572a608, {0x341e155c1c20?, 0x4?, 0x1c31e56?})
        +	/tmp/TestAccept1763441664/001/cmd/bundle/init.go:92 +0x453
        +github.com/spf13/cobra.(*Command).execute(0x341e1572a608, {0x341e155c1bd0, 0x5, 0x5})
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1015 +0xb3c
        +github.com/spf13/cobra.(*Command).ExecuteC(0x341e15472c08)
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1148 +0x450
        +github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1080
        +github.com/databricks/cli/cmd/root.execute({0x39856c8, 0x3c1a560}, 0x341e15472c08, {0x341e153aa590, 0x7, 0x7})
        +	/tmp/TestAccept1763441664/001/cmd/root/root.go:231 +0x413
        +github.com/databricks/cli/cmd/root.(*Tree).Execute(0x341e155f98f0, {0x39856c8, 0x3c1a560}, {0x341e153aa590, 0x7, 0x7})
        +	/tmp/TestAccept1763441664/001/cmd/root/tree.go:65 +0x57
        +main.main()
        +	/tmp/TestAccept1763441664/001/main.go:36 +0x125
        +
         === integer property declared only in anyOf set to a valid integer in the config file
         
         >>> musterr [CLI] bundle init ./any-of --config-file extra-3.json --output-dir rendered

latest (v1.28.0):

acceptance_test.go:1402: Diff:
        --- bundle/templates-machinery/null-value/output.txt
        +++ /tmp/TestAcceptbundletemplates-machinerynull-valueDMS=true2691265330/002/output.txt
        @@ -2,8 +2,53 @@
         === number property set to null in the config file
         
         >>> musterr [CLI] bundle init . --config-file ratio-null.json --output-dir rendered
        -Error: failed to load config from file ratio-null.json: incorrect type for property ratio: expected type float, but value is <nil>
        +The Databricks CLI unexpectedly had a fatal error.
        +Please report this issue to Databricks in the form of a GitHub issue at:
        +https://github.com/databricks/cli
         
        +CLI Version: [CLI_VERSION]
        +
        +Panic Payload: runtime error: invalid memory address or nil pointer dereference
        +
        +Stack Trace:
        +goroutine 1 [running]:
        +runtime/debug.Stack()
        +	runtime/debug/stack.go:26 +0x5e
        +github.com/databricks/cli/cmd/root.execute.func1()
        +	github.com/databricks/cli/cmd/root/root.go:167 +0xd4
        +panic({0x352bad0?, 0x3aa09c0?})
        +	runtime/panic.go:859 +0x125
        +github.com/databricks/cli/libs/jsonschema.validateNumber({0x0?, 0x0?})
        +	github.com/databricks/cli/libs/jsonschema/validate_type.go:35 +0x3d
        +github.com/databricks/cli/libs/jsonschema.validateType(...)
        +	github.com/databricks/cli/libs/jsonschema/validate_type.go:16
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validateTypes(0x188ce700c000, 0x188ce71a7260?)
        +	github.com/databricks/cli/libs/jsonschema/instance.go:95 +0xea
        +github.com/databricks/cli/libs/jsonschema.(*Schema).ValidateInstance(0x188ce71b8400?, 0x188ce71a7260)
        +	github.com/databricks/cli/libs/jsonschema/instance.go:53 +0x12a
        +github.com/databricks/cli/libs/jsonschema.(*Schema).LoadInstance(0x188ce700c000, {0x7ffc1a832000, 0xf})
        +	github.com/databricks/cli/libs/jsonschema/instance.go:37 +0x34a
        +github.com/databricks/cli/libs/template.(*config).assignValuesFromFile(0x188ce70d6520, {0x7ffc1a832000, 0xf})
        +	github.com/databricks/cli/libs/template/config.go:86 +0x74
        +github.com/databricks/cli/libs/template.(*defaultWriter).promptForInput(0x188ce70f4400, {0x3885670, 0x188ce71a6d80}, {0x3882cf8?, 0x188ce6dcc470?})
        +	github.com/databricks/cli/libs/template/writer.go:117 +0xae
        +github.com/databricks/cli/libs/template.(*defaultWriter).Materialize(0x188ce70f4400, {0x3885670, 0x188ce71a6d80}, {0x3882cf8?, 0x188ce6dcc470?})
        +	github.com/databricks/cli/libs/template/writer.go:168 +0x30
        +github.com/databricks/cli/cmd/bundle.newInitCommand.func1(0x188ce717e308, {0x188ce704fa40?, 0x4?, 0x1bc2e36?})
        +	github.com/databricks/cli/cmd/bundle/init.go:92 +0x453
        +github.com/spf13/cobra.(*Command).execute(0x188ce717e308, {0x188ce704f9f0, 0x5, 0x5})
        +	github.com/spf13/cobra@v1.10.2/command.go:1015 +0xb3c
        +github.com/spf13/cobra.(*Command).ExecuteC(0x188ce6efcc08)
        +	github.com/spf13/cobra@v1.10.2/command.go:1148 +0x450
        +github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        +	github.com/spf13/cobra@v1.10.2/command.go:1080
        +github.com/databricks/cli/cmd/root.execute({0x3885638, 0x3b11cc0}, 0x188ce6efcc08, {0x188ce6e36590, 0x7, 0x7})
        +	github.com/databricks/cli/cmd/root/root.go:227 +0x3b6
        +github.com/databricks/cli/cmd/root.(*Tree).Execute(0x188ce707f3c0, {0x3885638, 0x3b11cc0}, {0x188ce6e36590, 0x7, 0x7})
        +	github.com/databricks/cli/cmd/root/tree.go:65 +0x57
        +main.main()
        +	github.com/databricks/cli/main.go:36 +0x125
        +
         === integer property set to null in the config file
         
         >>> musterr [CLI] bundle init . --config-file count-null.json --output-dir rendered
        @@ -12,13 +56,109 @@
         === null in the enum of a number property
         
         >>> musterr [CLI] bundle init ./enum-null --output-dir rendered
        -Error: failed to load schema: type validation for enum at index 1 failed for property ratio: expected type float, but value is <nil>
        +The Databricks CLI unexpectedly had a fatal error.
        +Please report this issue to Databricks in the form of a GitHub issue at:
        +https://github.com/databricks/cli
         
        +CLI Version: [CLI_VERSION]
        +
        +Panic Payload: runtime error: invalid memory address or nil pointer dereference
        +
        +Stack Trace:
        +goroutine 1 [running]:
        +runtime/debug.Stack()
        +	runtime/debug/stack.go:26 +0x5e
        +github.com/databricks/cli/cmd/root.execute.func1()
        +	github.com/databricks/cli/cmd/root/root.go:167 +0xd4
        +panic({0x352bad0?, 0x3aa09c0?})
        +	runtime/panic.go:859 +0x125
        +github.com/databricks/cli/libs/jsonschema.validateNumber({0x0?, 0x0?})
        +	github.com/databricks/cli/libs/jsonschema/validate_type.go:35 +0x3d
        +github.com/databricks/cli/libs/jsonschema.validateType(...)
        +	github.com/databricks/cli/libs/jsonschema/validate_type.go:16
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validateSchemaEnumValueTypes(0x6?)
        +	github.com/databricks/cli/libs/jsonschema/schema.go:213 +0x142
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validate(0x220329dfd800)
        +	github.com/databricks/cli/libs/jsonschema/schema.go:312 +0x21b
        +github.com/databricks/cli/libs/jsonschema.LoadFS({0x386e308?, 0x220329f687e0?}, {0x1c0e8a9?, 0x3?})
        +	github.com/databricks/cli/libs/jsonschema/schema.go:367 +0x51c
        +github.com/databricks/cli/libs/template.loadSchemaAndResolveTemplateDir({0x7fff3a1e3004, 0xb})
        +	github.com/databricks/cli/libs/template/reader.go:207 +0x53
        +github.com/databricks/cli/libs/template.(*localReader).LoadSchemaAndTemplateFS(0x7fff3a1e3004?, {0x0?, 0x0?})
        +	github.com/databricks/cli/libs/template/reader.go:194 +0x1d
        +github.com/databricks/cli/libs/template.(*defaultWriter).promptForInput(0x220329edaf00, {0x3885670, 0x220329f8e7b0}, {0x3882cf8?, 0x220329f687c0?})
        +	github.com/databricks/cli/libs/template/writer.go:105 +0x3d
        +github.com/databricks/cli/libs/template.(*defaultWriter).Materialize(0x220329edaf00, {0x3885670, 0x220329f8e7b0}, {0x3882cf8?, 0x220329f687c0?})
        +	github.com/databricks/cli/libs/template/writer.go:168 +0x30
        +github.com/databricks/cli/cmd/bundle.newInitCommand.func1(0x220329f66308, {0x220329f0da40?, 0x4?, 0x1bc2e36?})
        +	github.com/databricks/cli/cmd/bundle/init.go:92 +0x453
        +github.com/spf13/cobra.(*Command).execute(0x220329f66308, {0x220329f0d9e0, 0x3, 0x3})
        +	github.com/spf13/cobra@v1.10.2/command.go:1015 +0xb3c
        +github.com/spf13/cobra.(*Command).ExecuteC(0x220329ce2c08)
        +	github.com/spf13/cobra@v1.10.2/command.go:1148 +0x450
        +github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        +	github.com/spf13/cobra@v1.10.2/command.go:1080
        +github.com/databricks/cli/cmd/root.execute({0x3885638, 0x3b11cc0}, 0x220329ce2c08, {0x220329c265b0, 0x5, 0x5})
        +	github.com/databricks/cli/cmd/root/root.go:227 +0x3b6
        +github.com/databricks/cli/cmd/root.(*Tree).Execute(0x220329e653c0, {0x3885638, 0x3b11cc0}, {0x220329c265b0, 0x5, 0x5})
        +	github.com/databricks/cli/cmd/root/tree.go:65 +0x57
        +main.main()
        +	github.com/databricks/cli/main.go:36 +0x125
        +
         === integer property declared only in anyOf set to null in the config file
         
         >>> musterr [CLI] bundle init ./any-of --config-file extra-null.json --output-dir rendered
        -Error: failed to load config from file extra-null.json: instance does not match any of the schemas in anyOf
        +The Databricks CLI unexpectedly had a fatal error.
        +Please report this issue to Databricks in the form of a GitHub issue at:
        +https://github.com/databricks/cli
         
        +CLI Version: [CLI_VERSION]
        +
        +Panic Payload: runtime error: invalid memory address or nil pointer dereference
        +
        +Stack Trace:
        +goroutine 1 [running]:
        +runtime/debug.Stack()
        +	runtime/debug/stack.go:26 +0x5e
        +github.com/databricks/cli/cmd/root.execute.func1()
        +	github.com/databricks/cli/cmd/root/root.go:167 +0xd4
        +panic({0x352bad0?, 0x3aa09c0?})
        +	runtime/panic.go:859 +0x125
        +github.com/databricks/cli/libs/jsonschema.validateInteger({0x0?, 0x0?})
        +	github.com/databricks/cli/libs/jsonschema/validate_type.go:47 +0x52
        +github.com/databricks/cli/libs/jsonschema.validateType(...)
        +	github.com/databricks/cli/libs/jsonschema/validate_type.go:16
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validateTypes(0x3971ff614200, 0x3971ff606bd0?)
        +	github.com/databricks/cli/libs/jsonschema/instance.go:95 +0xea
        +github.com/databricks/cli/libs/jsonschema.(*Schema).ValidateInstance(0x34aeba8?, 0x3971ff606bd0)
        +	github.com/databricks/cli/libs/jsonschema/instance.go:53 +0x12a
        +github.com/databricks/cli/libs/jsonschema.(*Schema).validateAnyOf(0x3971ff47d800?, 0x3971ff606bd0)
        +	github.com/databricks/cli/libs/jsonschema/instance.go:157 +0x1cc
        +github.com/databricks/cli/libs/jsonschema.(*Schema).ValidateInstance(0x3971ff477000?, 0x3971ff606bd0)
        +	github.com/databricks/cli/libs/jsonschema/instance.go:53 +0x12a
        +github.com/databricks/cli/libs/jsonschema.(*Schema).LoadInstance(0x3971ff47d800, {0x7ffc94336000, 0xf})
        +	github.com/databricks/cli/libs/jsonschema/instance.go:37 +0x34a
        +github.com/databricks/cli/libs/template.(*config).assignValuesFromFile(0x3971ff53ef60, {0x7ffc94336000, 0xf})
        +	github.com/databricks/cli/libs/template/config.go:86 +0x74
        +github.com/databricks/cli/libs/template.(*defaultWriter).promptForInput(0x3971ff55ce40, {0x3885670, 0x3971ff606720}, {0x3882cf8?, 0x3971ff5e87d0?})
        +	github.com/databricks/cli/libs/template/writer.go:117 +0xae
        +github.com/databricks/cli/libs/template.(*defaultWriter).Materialize(0x3971ff55ce40, {0x3885670, 0x3971ff606720}, {0x3882cf8?, 0x3971ff5e87d0?})
        +	github.com/databricks/cli/libs/template/writer.go:168 +0x30
        +github.com/databricks/cli/cmd/bundle.newInitCommand.func1(0x3971ff5e6308, {0x3971ff4b7a40?, 0x4?, 0x1bc2e36?})
        +	github.com/databricks/cli/cmd/bundle/init.go:92 +0x453
        +github.com/spf13/cobra.(*Command).execute(0x3971ff5e6308, {0x3971ff4b79f0, 0x5, 0x5})
        +	github.com/spf13/cobra@v1.10.2/command.go:1015 +0xb3c
        +github.com/spf13/cobra.(*Command).ExecuteC(0x3971ff364c08)
        +	github.com/spf13/cobra@v1.10.2/command.go:1148 +0x450
        +github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        +	github.com/spf13/cobra@v1.10.2/command.go:1080
        +github.com/databricks/cli/cmd/root.execute({0x3885638, 0x3b11cc0}, 0x3971ff364c08, {0x3971ff2a0590, 0x7, 0x7})
        +	github.com/databricks/cli/cmd/root/root.go:227 +0x3b6
        +github.com/databricks/cli/cmd/root.(*Tree).Execute(0x3971ff4e73c0, {0x3885638, 0x3b11cc0}, {0x3971ff2a0590, 0x7, 0x7})
        +	github.com/databricks/cli/cmd/root/tree.go:65 +0x57
        +main.main()
        +	github.com/databricks/cli/main.go:36 +0x125
        +
         === integer property declared only in anyOf set to a valid integer in the config file
         
         >>> musterr [CLI] bundle init ./any-of --config-file extra-3.json --output-dir rendered

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 2fca0df

Run: 46101788370

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 174 18 3:35
✅​ aws-windows-latest-4core-16gb 174 18 2:56
✅​ azure linux-2core-8gb 173 18 3:33
✅​ azure-windows-latest-4core-16gb 173 18 3:09
✅​ gcp linux-2core-8gb 174 18 3:34
✅​ gcp-windows-latest-4core-16gb 174 18 3:11
Top 6 slowest tests (at least 2 minutes):
duration env testname
3:33 azure linux-2core-8gb TestAccept
3:26 gcp linux-2core-8gb TestAccept
3:21 aws linux-2core-8gb TestAccept
3:09 gcp-windows-latest-4core-16gb TestAccept
3:08 azure-windows-latest-4core-16gb TestAccept
2:54 aws-windows-latest-4core-16gb TestAccept

@denik
denik marked this pull request as ready for review November 28, 2026 00:49
@denik
denik requested review from a team as code owners November 28, 2026 00:49

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review at 89b8cf5. Each finding was verified against the code.

No blocking issues found.

This PR stops bundle init from panicking when a number property, or an integer property declared only in anyOf, is null. It adds a nil check to validateNumber and validateInteger before they call reflect.TypeOf(v).Kind(), so a null now gets the usual type error. The fix is correct for every path in the acceptance test, and non-null inputs behave as before. I have no blocking issues. One thing outside this PR's scope: integer properties declared only in anyOf are still never converted from float64 in LoadInstance, so even a valid number like {"extra": 3} fails there with the same error. That is worth a follow-up.

@denik
denik force-pushed the denik/fix-jsonschema-null branch from 89b8cf5 to c2a34c5 Compare November 28, 2026 01:13
@denik
denik requested a review from andrewnester November 28, 2026 01:14

@Sankalp-Mittal Sankalp-Mittal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Generated] Review by review-factory (Claude Sonnet 5.5 + Claude Opus 5.5 + Claude Opus 5.5, cross-verified). Only points the reviewers agreed on are posted.

No issues found.

Base automatically changed from denik/acc-jsonschema-null to main November 28, 2026 02:23
@denik denik closed this in #8154 Nov 28, 2026
@denik denik reopened this Nov 28, 2026
…alues

validateNumber and validateInteger called reflect.TypeOf(v).Kind(), which
dereferences a nil reflect.Type when the JSON value is null. bundle init
crashed this way for a null number property in --config-file, a null in a
number property's enum, and a null for an integer property that only a root
anyOf schema declares. Both validators now report the null as a wrong type,
as validateString and validateBoolean already do.

Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions github-actions Bot added the DABs DABs related issues label Nov 28, 2026
@denik
denik force-pushed the denik/fix-jsonschema-null branch from c2a34c5 to 2fca0df Compare November 28, 2026 03:12

@Sankalp-Mittal Sankalp-Mittal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Generated] Review by review-factory (Claude Opus 5.5 + Claude Sonnet 5.5 + Claude Opus 5.5, cross-verified). Only points the reviewers agreed on are posted.

No issues found.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues factory-generated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants