Skip to content

Bug: 'host1' is not of type 'object' validation error on correct JSON #166

Description

Bug: 'host1' is not of type 'object' validation error on correct JSON

Describe the bug

When running psconfig validate (and using pSConfig pScheduler agent) on a valid psconfig JSON file, validation fails with the error:

Error: 'host1' is not of type 'object'

This happens even though the file matches the official documentation (https://docs.perfsonar.net/psconfig_templates_intro.html) and contains the required sections.

To Reproduce

Steps to reproduce the behavior:

  1. Save the following as /tmp/pscheduler-agent.json:
    {
      "addresses": {
        "host1": { "address": "192.0.2.1" },
        "host2": { "address": "192.0.2.2" }
      },
      "groups": {
        "my_mesh": {
          "type": "mesh",
          "addresses": [ "host1", "host2" ]
        }
      },
      "tests": {
        "my_ping_test": {
          "type": "pscheduler",
          "spec": {
            "test": { "type": "ping" },
            "schedule": { "interval": "PT5M" }
          }
        }
      },
      "archives": {
        "local-esmond": {
          "archiver": "esmond",
          "data": {
            "url": "http://localhost/esmond/perfsonar/archive/"
          }
        }
      },
      "tasks": {
        "ping_all": {
          "group": "my_mesh",
          "test": "my_ping_test",
          "archives": [ "local-esmond" ]
        }
      }
    }
  2. Run:
    psconfig validate /tmp/pscheduler-agent.json
    
  3. Observe the output:
    Validating JSON schema ...... FAIL
        Error: 'host1' is not of type 'object'
    

System info

  • OS: NAME="AlmaLinux" VERSION="9.5 (Teal Serval)"
  • perfsonar-psconfig-utils version: 5.1.4-1.el9.noarch
  • perfsonar-psconfig-pscheduler version: 5.1.4-1.el9.noarch
  • Python version: Python 3.9.21

Additional context

  • The JSON file is valid (checked with python3 -m json.tool).
  • The file matches the example in the official documentation.
  • This error blocks the agent from accepting valid psconfig templates.

Thank you for your help!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions