Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


NoneType' object is not subscriptable error during aws-eks-kubectl-run pipe run




I'm trying to apply a yaml file using the aws-eks-kubectl-run pipe but it returns an error.

If I try to apply the yaml file manually it works without any issues

The error is:

✔ Successfully updated the kube config.
Traceback (most recent call last):
File "/", line 42, in <module>
File "/usr/local/lib/python3.7/site-packages/kubectl_run/", line 112, in run
File "/usr/local/lib/python3.7/site-packages/kubectl_run/", line 77, in handle_apply
self.update_labels_in_metadata(template_file, labels)
File "/usr/local/lib/python3.7/site-packages/kubectl_run/", line 31, in update_labels_in_metadata
yaml_doc['metadata'].setdefault('labels', {}).update(labels)
TypeError: 'NoneType' object is not subscriptable

I'm trying to apply the file

- wget
- ls -latrh
- pipe: atlassian/aws-eks-kubectl-run:1.2.4
CLUSTER_NAME: "$name-$environment"
# KUBECTL_ARGS: '<array>' # Optional
RESOURCE_PATH: "spotinst-kubernetes-cluster-controller-ga.yaml"
# LABELS: '<array>' # Optional
DEBUG: 'true'


Changing the 'with_default_labels' to true also doesn't fix the issue.


Any idea how to fix this issue? for other yaml files it works without any issues


1 answer

1 accepted

2 votes
Answer accepted
Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jul 06, 2020

Hi @Rutger van Bruggen ,

thank you for your question.

The problem is in "spotinst-kubernetes-cluster-controller-ga.yam" file. It ends with three dashes (---).

According to YAML specs 2.2 Structures:

YAML uses three dashes (---) to separate directives from document content. This also serves to signal the start of a document if no directives are present. Three dots ( ...) indicate the end of a document without starting a new one, for use in communication channels.

during parsing the file pipe's method `update_labels_in_metadata` tries to find all separate documents from provided file, but the latest three dashes (---) declare false start of the new document.

It'd be better add pre-processing and remove trailing three dashes (---) from the file.

- truncate -s-4 spotinst-kubernetes-cluster-controller-ga.yaml

Also, we'll think about this case to prevent breaking the pipe.

Thanks for the update. I can confirm it fixed the issue

Like ktomk likes this

Can it also happen with comments ?

I dont have trailing --- , however i added comments at the top like 

# Comment
and started getting this same error.

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events