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

[Bug]: Cannot find version 8.0.mysql_aurora.3.02.0 for aurora-mysql #5812

Closed
ruzickap opened this issue May 12, 2024 · 3 comments · Fixed by #5813
Closed

[Bug]: Cannot find version 8.0.mysql_aurora.3.02.0 for aurora-mysql #5812

ruzickap opened this issue May 12, 2024 · 3 comments · Fixed by #5813
Labels
type/bug Issues that are bugs.

Comments

@ruzickap
Copy link
Contributor

ruzickap commented May 12, 2024

Description:

I'm getting error using copilot storage init: Cannot find version 8.0.mysql_aurora.3.02.0 for aurora-mysql

Details:

I would like to use copilot with Aurora - so I tried the following command:

copilot storage init --name wordpress-cluster --lifecycle=workload \
  --storage-type Aurora --engine MySQL --initial-db "wordpress"

After running copilot svc deploy I got:

Found only one service, defaulting to: wordpress
Only found one option, defaulting to: dev
✔ Proposing infrastructure changes for stack wordpress-dev-wordpress
- Creating the infrastructure for stack wordpress-dev-wordpress                                       [rollback complete]   [377.5s]
  The following resource(s) failed to create: [AddonsStack]. Rollback re
  quested by user.
  - An Addons CloudFormation Stack for your additional AWS resources                                  [delete in progress]  [377.9s]
    The following resource(s) failed to create: [wordpressclusterDBCluster
    ]. Rollback requested by user.
    - A Secrets Manager secret to store your DB credentials                                           [delete complete]     [10.2s]
    - A DB parameter group for engine configuration values                                            [delete complete]     [0.0s]
    - A security group for your Aurora Serverless v2 cluster wordpresscluster                         [delete complete]     [1.3s]
    - The wordpresscluster Aurora Serverless v2 database cluster                                      [delete complete]     [0.0s]
      Resource handler returned message: "Cannot find version 8.0.mysql_auro
      ra.3.02.0 for aurora-mysql (Service: Rds, Status Code: 400, Request ID
      : d2a3b5e3-c96b-49f1-b330-2ef020e01c94)" (RequestToken: 7d57531f-3bae-
      c1fb-48e4-947f089f7bae, HandlerErrorCode: InvalidRequest)

It looks like CloudFormation template generated by the copilot storage init is not valid anymore.

The CF template contains:

...
  wordpressclusterDBCluster:
    Metadata:
      'aws:copilot:description': 'The wordpresscluster Aurora Serverless v2 database cluster'
    Type: 'AWS::RDS::DBCluster'
    Properties:
      MasterUsername:
        !Join [ "",  [ '{{resolve:secretsmanager:', !Ref wordpressclusterAuroraSecret, ":SecretString:username}}" ]]
      MasterUserPassword:
        !Join [ "",  [ '{{resolve:secretsmanager:', !Ref wordpressclusterAuroraSecret, ":SecretString:password}}" ]]
      DatabaseName: !Ref wordpressclusterDBName
      Engine: 'aurora-mysql'
      EngineVersion: '8.0.mysql_aurora.3.02.0'
      DBClusterParameterGroupName: !Ref wordpressclusterDBClusterParameterGroup
      DBSubnetGroupName: !Ref wordpressclusterDBSubnetGroup
...

My copilot version

❯ copilot --version
copilot version: v1.33.3

Thank you for looking at it...

@ruzickap ruzickap added the type/bug Issues that are bugs. label May 12, 2024
@hkford
Copy link
Collaborator

hkford commented May 13, 2024

Thank you for reporting the issue. It appears that the root cause of the problem is that the AWS Copilot CLI is currently hardcoded to use MySQL version 3.02.0 when creating Aurora Serverless v2 clusters. Depending on the AWS region you are using, a higher version of MySQL may be required.

@ruzickap
Copy link
Contributor Author

Thank you.

I'm using us-east-1 and eu-central-1.

Anyway - based on the output of the script below - it seems like version 8.0.mysql_aurora.3.02.0 is not supported "anywhere".

for REGION in `aws ec2 describe-regions --region us-east-1 --output text | cut -f4`; do
  echo "*** ${REGION}"
  aws rds describe-db-engine-versions --region "${REGION}" --engine aurora-mysql --query "DBEngineVersions[].EngineVersion" | grep '8.0.mysql_aurora.3.02.0'
done

Let me create PR to fix it...

@mergify mergify bot closed this as completed in #5813 May 14, 2024
mergify bot pushed a commit that referenced this issue May 14, 2024
Fixes #5812 

Currently used engine version `8.0.mysql_aurora.3.02.0` for aurora-mysql doesn't exists in AWS any more.

Based on the following script which grabs latest supported version of `aurora-mysql` in all regions - this should be changed to `8.0.mysql_aurora.3.06.0`:

```bash
❯ for REGION in `aws ec2 describe-regions --region us-east-1 --output text | cut -f4`; do
  echo "*** ${REGION}"
  aws rds describe-db-engine-versions --region "${REGION}" --engine aurora-mysql --query "DBEngineVersions[].EngineVersion" | sort | grep '8.0.mysql_aurora.3' | tail -1
done
*** ap-south-1
    "8.0.mysql_aurora.3.06.0"
*** eu-north-1
    "8.0.mysql_aurora.3.06.0"
*** eu-west-3
    "8.0.mysql_aurora.3.06.0"
*** eu-west-2
    "8.0.mysql_aurora.3.06.0"
*** eu-west-1
    "8.0.mysql_aurora.3.06.0"
*** ap-northeast-3
    "8.0.mysql_aurora.3.06.0"
*** ap-northeast-2
    "8.0.mysql_aurora.3.06.0"
*** ap-northeast-1
    "8.0.mysql_aurora.3.06.0"
*** ca-central-1
    "8.0.mysql_aurora.3.06.0"
*** sa-east-1
    "8.0.mysql_aurora.3.06.0"
*** ap-southeast-1
    "8.0.mysql_aurora.3.06.0"
*** ap-southeast-2
    "8.0.mysql_aurora.3.06.0"
*** eu-central-1
    "8.0.mysql_aurora.3.06.0"
*** us-east-1
    "8.0.mysql_aurora.3.06.0"
*** us-east-2
    "8.0.mysql_aurora.3.06.0"
*** us-west-1
    "8.0.mysql_aurora.3.06.0"
*** us-west-2
    "8.0.mysql_aurora.3.06.0"
```
@dannyrandall
Copy link
Contributor

The fix is now released in v1.33.4: https://github.com/aws/copilot-cli/releases/tag/v1.33.4! 🎉 Thanks @ruzickap for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Issues that are bugs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants