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

NullPointerException when material type is missing #47

Open
moritz opened this issue May 27, 2019 · 0 comments
Open

NullPointerException when material type is missing #47

moritz opened this issue May 27, 2019 · 0 comments

Comments

@moritz
Copy link

moritz commented May 27, 2019

When a material has no type attribute, the GoCD Config repo admin screen reports:

runtime;
1. Unexpected error when handling plugin response
java.lang.NullPointerException

I would have expected an error message along the lines of "Material No. 1 of pipeline dummy has no attribute 'type'" or something like that.

This is a sample material I've used to reproduce this behavior:

"materials": [
    {
      "auto_update": false,
      "branch": "master",
      "destination": "dummy",
      "filter": {
        "ignore": [],
        "whitelist": []
      },
      "name": "dummy",
      "shallow_clone": false,
      "url": "https://github.com/gocd/build_map.git"
    }

This bug happens with GoCD Version: 19.3.0 (8959-259d1f79e361875995072e5c1fcc9cbda7ccc600).

In case it makes the reproduction of this bug easier, here is the full JSON of the the pipeline:

{
  "environment_variables": [],
  "group": "misc",
  "label_template": "${COUNT}",
  "lock_behavior": "none",
  "materials": [
    {
      "auto_update": false,
      "branch": "master",
      "destination": "dummy",
      "filter": {
        "ignore": [],
        "whitelist": []
      },
      "name": "dummy",
      "shallow_clone": false,
      "url": "https://github.com/gocd/build_map.git"
    }
  ],
  "name": "dummy",
  "stages": [
    {
      "approval": {
        "roles": [],
        "type": "success",
        "users": []
      },
      "clean_working_directory": true,
      "environment_variables": [],
      "fetch_materials": true,
      "jobs": [
        {
          "artifacts": [],
          "environment_variables": [],
          "name": "dummy",
          "properties": [],
          "resources": [
            "stretch"
          ],
          "run_instance_count": "0",
          "tabs": [],
          "tasks": [
            {
              "arguments": [
                "test"
              ],
              "command": "echo",
              "run_if": "passed",
              "timeout": -1,
              "type": "exec",
              "working_directory": "dummy"
            }
          ],
          "timeout": 10
        }
      ],
      "name": "dummy",
      "never_cleanup_artifacts": false
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant