aws-samples / cdk-eks-blueprints-patterns

Patterns repository for the Amazon EKS Bluepints for CDK
https://github.com/aws-quickstart/cdk-eks-blueprints
MIT No Attribution
146 stars 161 forks source link

Backstage pattern failed to create due to namespaces "backstage" not found #167

Open xiangyanw opened 5 months ago

xiangyanw commented 5 months ago

Describe the bug A clear and concise description of what the bug is. Failed to deploy the backstage pattern because of below error:

11:57:34 AM | CREATE_FAILED        | Custom::AWSCDK-EKS-KubernetesResource       | BackstageDatabaseExternalSecretA3EDF340
Received response status [FAILED] from custom resource. Message returned: Error: b'Error from server (NotFound): error when creating "/tmp/manifest.yaml": namespaces "backstage" not found\n'

Logs: /aws/lambda/backstage-blueprint-awscdkawseksKu-Handler886CB40B-gygkSKUeNmUY

at invokeUserFunction (/var/task/framework.js:2:6)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async onEvent (/var/task/framework.js:1:369)
at async Runtime.handler (/var/task/cfn-response.js:1:1676) (RequestId: 2d37c026-f026-42c9-9b16-066c8c9dbc5c)

From Lambda logs, it happened when it was deploying externalsecret.

{
    "RequestType": "Create",
    "ServiceToken": "arn:aws:lambda:ap-northeast-1:625011733915:function:backstage-blueprint-awscd-ProviderframeworkonEvent-6WbM98hbI8IV",
    "ResponseURL": "...",
    "StackId": "arn:aws:cloudformation:ap-northeast-1:625011733915:stack/backstage-blueprint/76269280-f8c1-11ee-b8fb-0a87d7790c8b",
    "RequestId": "2d37c026-f026-42c9-9b16-066c8c9dbc5c",
    "LogicalResourceId": "BackstageDatabaseExternalSecretA3EDF340",
    "ResourceType": "Custom::AWSCDK-EKS-KubernetesResource",
    "ResourceProperties": {
        "ServiceToken": "arn:aws:lambda:ap-northeast-1:625011733915:function:backstage-blueprint-awscd-ProviderframeworkonEvent-6WbM98hbI8IV",
        "PruneLabel": "aws.cdk.eks/prune-c8f0cf7145093742876bbb2d2485f38bdfd79948ba",
        "ClusterName": "backstage-blueprint",
        "Manifest": "[{\"apiVersion\":\"external-secrets.io/v1beta1\",\"kind\":\"ExternalSecret\",\"metadata\":{\"name\":\"external-backstage-db-secret\",\"namespace\":\"backstage\",\"labels\":{\"aws.cdk.eks/prune-c8f0cf7145093742876bbb2d2485f38bdfd79948ba\":\"\"}},\"spec\":{\"secretStoreRef\":{\"name\":\"secret-manager-store\",\"kind\":\"ClusterSecretStore\"},\"target\":{\"name\":\"backstage-database-secret\"},\"data\":[{\"secretKey\":\"POSTGRES_PASSWORD\",\"remoteRef\":{\"key\":\"databasesecret6A44CD8F-XOT9G17LNmay\",\"property\":\"password\"}},{\"secretKey\":\"POSTGRES_USER\",\"remoteRef\":{\"key\":\"databasesecret6A44CD8F-XOT9G17LNmay\",\"property\":\"username\"}}]}}]",
        "RoleArn": "arn:aws:iam::625011733915:role/backstage-blueprint-backstageblueprintCreationRoleE-F0mX1Y5aiwQr"
    }
}

To Reproduce Steps to reproduce the behavior: Deploy the backstage pattern.

$ make deps 
$ npm i
$ make build
$ make pattern backstage deploy

Expected behavior A clear and concise description of what you expected to happen. The backstage environment can be created successfully.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information): Cloud9 with Amazon Linux 2023

Smartphone (please complete the following information): NA

Additional context Add any other context about the problem here.

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

khairulhabibataws commented 4 weeks ago

i have similar issue on this, do anyone have solution for this?