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

EKS Log Collector - InvalidDocumentContent #716

Closed
Chili-Man opened this issue Jul 28, 2021 · 4 comments · Fixed by #1003
Closed

EKS Log Collector - InvalidDocumentContent #716

Chili-Man opened this issue Jul 28, 2021 · 4 comments · Fixed by #1003
Labels
documentation Documentation issue

Comments

@Chili-Man
Copy link

What happened:
I'm trying to follow the directions here https://github.com/awslabs/amazon-eks-ami/tree/master/log-collector-script/linux#to-invoke-ssm-agent-to-run-eks-log-collector-script-and-push-bundle-to-s3-from-worker-nodes for collecting the logs. I get the following error:

aws ssm create-document --name "EKSLogCollector" --document-type "Command" --content 'https://raw.githubusercontent.com/awslabs/amazon-eks-ami/master/log-collector-script/linux/eks-ssm-content.json'
An error occurred (InvalidDocumentContent) when calling the CreateDocument operation: JSON not well-formed. at Line: 1, Column: 6
exit status 254

Debug output here: https://gist.github.com/Chili-Man/1be262c422d929b87ccc822570553919

What you expected to happen:
I expect the command to succeed per the documentation

How to reproduce it (as minimally and precisely as possible):

aws ssm create-document --name "EKSLogCollector" --document-type "Command" --content 'https://raw.githubusercontent.com/awslabs/amazon-eks-ami/master/log-collector-script/linux/eks-ssm-content.json'

**Anything else we need to know?**:
I'm running the command in Ubuntu 20.04

```shell
aws --version
aws-cli/2.2.14 Python/3.9.5 Linux/5.8.0-63-generic source/x86_64.ubuntu.20 prompt/off

Environment:

  • AWS Region: us-east-1
  • Instance Type(s):
  • EKS Platform version (use aws eks describe-cluster --name <name> --query cluster.platformVersion): eks.1
  • Kubernetes version (use aws eks describe-cluster --name <name> --query cluster.version): 1.21
  • AMI Version: amazon-eks-node-1.21-v20210722 (ami-005fb2dc84caa293d)
  • Kernel (e.g. uname -a): 5.4.129-63.229.amzn2.x86_64 Template is missing source_ami_id in the variables section #1 SMP Tue Jul 20 21:22:08 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
  • Release information (run cat /etc/eks/release on a node):
BASE_AMI_ID="ami-01e809b6b105324b3"
BUILD_TIME="Thu Jul 22 16:13:01 UTC 2021"
BUILD_KERNEL="5.4.129-63.229.amzn2.x86_64"
ARCH="x86_64"
@abeer91
Copy link
Contributor

abeer91 commented Sep 7, 2021

This seems to be working for me:

 ➜  amazon-eks-ami git:(master) aws ssm create-document --name "EKSLogCollector" --document-type "Command" --content 'https://raw.githubusercontent.com/awslabs/amazon-eks-ami/master/log-collector-script/linux/eks-ssm-content.json'
{
    "DocumentDescription": {
        "Hash": "ee9faba0507893796ba61a4148833ea036200fd5f3720765ac8641e8fa036957",
        "HashType": "Sha256",
        "Name": "EKSLogCollector",
        "Owner": "143436755772",
        "CreatedDate": 1631028360.643,
        "Status": "Creating",
        "DocumentVersion": "1",
        "Description": "EKS Log Collector",
        "Parameters": [
            {
                "Name": "bucketName",
                "Type": "String",
                "DefaultValue": "Enabled"
            }
        ],
        "PlatformTypes": [
            "Windows",
            "Linux"
        ],
        "DocumentType": "Command",
        "SchemaVersion": "2.2",
        "LatestVersion": "1",
        "DefaultVersion": "1",
        "DocumentFormat": "JSON",
        "Tags": []
    }
}

Closing this issue, please let me know if this still doesn't work for you.

@cartermckinnon
Copy link
Member

I'm able to reproduce this issue on:

aws-cli/2.4.13 Python/3.8.8 Darwin/20.6.0 exe/x86_64

and

aws-cli/2.4.13 Python/3.8.8 Linux/5.4.156 exe/x86_64

It works as expected on:

aws-cli/1.22.32 Python/3.8.11 Linux/5.4.156 botocore/1.23.32

@cartermckinnon
Copy link
Member

I'm considering this a documentation issue for us, because this boils down to the behavior of the --content flag for aws ssm create-document. But it'd be nice to narrow things down however much we can.

@maharjanSaroj
Copy link

I am getting this issue while trying to collect logs for windows. Not sure if I missing something.

❯ aws --version
aws-cli/2.9.20 Python/3.9.11 Windows/10 exe/AMD64 prompt/off

❯ aws ssm create-document --name "EKSLogCollectorWindows" --document-type "Command" --content https://raw.githubusercontent.com/awslabs/amazon-eks-ami/master/log-collector-script/windows/eks-ssm-content.json

An error occurred (InvalidDocumentContent) when calling the CreateDocument operation: JSON not well-formed. at Line: 1, Column: 6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants