Question

Error "'NoneType' object has no attribute 'get'" when executing runbook via API

  • 24 November 2021
  • 4 replies
  • 14 views

Userlevel 1
Badge +1

Hi.

I’ve verified with this post and this post that I’m sending the parameters correctly and that the variables in my runbook are set to Runtime. 

I’m also doing a POST call but I still get an internal server error with the message "'NoneType' object has no attribute 'get'".

Here’s the body of my call:

{
    "spec": {
          "args": [
            {
              "name": "email",
              "value": "mema@tlke.se"
            },
            {
              "name": "displayName",
              "value": "Mom MEmem"
            },
            {
              "name": "userName",
              "value": "momemom"
            },
            {
              "name": "accountName",
              "value": "MAM, MSM 1"
            },
            {
                "name": "ticketID",
                "value": "794"
            }
          ]
        }
      }
    }
  }

The runbook has multiple tasks, does that change how I send arguments to it?

Thanks.


4 replies

Userlevel 4
Badge +4

Hi Martin,

Not sure if that would be the problem, but your JSON payload is not compliance. You have to remove two curly brackets from the end of the payload. 

About the number of tasks, it doesn’t matter. If you are still having problems, make a simple runbook with a single task and a single variable to practice and check if it works for you. Once you confirm, then move to the one failing. 

Userlevel 1
Badge +1

Hi Jose.

Doh! I checked the syntax of the JSON with Prettier and didn’t get any errors so I just assumed that it was kosher. That’s what I get for assuming things. 

Unfortunately that didn’t help, I still get the same error. I’ll give it a try with a super simple runbook and see.

Thanks for the quick reply.

Userlevel 1
Badge +1

Hello Jose.

It doesn’t matter that I use a super simple runbook. I even replicated the one you outlined in this post, I still get the same error. :/

Is there a log in Calm I can check to get more information?

Userlevel 4
Badge +4

Hey Martin,

Could you paste your request in curl format here? Feel free to anonymize any sensitive information.

 

Reply