# CloudQuery update issue with aws and postgres plugins migration error

**URL:** <https://community.cloudquery.io/t/cloudquery-update-issue-with-aws-and-postgres-plugins-migration-error/569>\
**Category:** CloudQuery Plugins\
**Created:** [November 16, 2023, 11:31am UTC](https://community.cloudquery.io/t/cloudquery-update-issue-with-aws-and-postgres-plugins-migration-error/569 "2023-11-16T11:31:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![certain-alpaca](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@certain-alpaca](https://community.cloudquery.io/u/certain-alpaca)\
**Post date:** [November 16, 2023, 11:31am UTC](https://community.cloudquery.io/t/cloudquery-update-issue-with-aws-and-postgres-plugins-migration-error/569/1 "2023-11-16T11:31:26Z")

</div>

Hey there! I’m having some troubles after updating the versions of AWS and Postgres plugins. It seems like a couple of tables have changed, and that’s preventing me from running CloudQuery successfully.

I get the following error:

```auto
type: update, current: version:utf8:PK:NotNull, previous: version:utf8]] require migration. Migrate manually or consider using 'migrate_mode: forced'

```

`module=cli`

I’ve added the `migrate_mode: forced` to my Postgres config but I’m still getting the same error. I also tried the `cloudquery migrate` command, but I was not successful either. 😦

---

<div class="post-metadata">

**Author:** ![herman](https://sea1.discourse-cdn.com/flex001/user_avatar/community.cloudquery.io/herman/32/27_2.png) [@herman](https://community.cloudquery.io/u/herman)\
**Post date:** [November 16, 2023, 11:34am UTC](https://community.cloudquery.io/t/cloudquery-update-issue-with-aws-and-postgres-plugins-migration-error/569/2 "2023-11-16T11:34:42Z")

</div>

Hi 👋

Sorry to hear you’re having trouble; can you share the config you’re using with any sensitive values redacted? Also, please share the output of

```auto
cloudquery --version

```

---

<div class="post-metadata">

**Author:** ![certain-alpaca](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@certain-alpaca](https://community.cloudquery.io/u/certain-alpaca)\
**Post date:** [November 16, 2023, 11:49am UTC](https://community.cloudquery.io/t/cloudquery-update-issue-with-aws-and-postgres-plugins-migration-error/569/3 "2023-11-16T11:49:43Z")

</div>

````auto
CloudQuery Version 3.13.1

Source Plugin Config (AWS):
```yaml
kind: source
spec:
  ## Required. Name of the plugin to use.
  ## This should be unique if you have a number of AWS plugins.
  name: "aws"
  ## Optional. Where to search for the plugin. Default: "github". Options: "github", "local", "grpc"
  # registry: "github"

  ## Path for the plugin.
  ## If registry is "github", path should be "repo/name"
  ## If registry is "local", path is path to binary. If "grpc", then it should be the address of the plugin (usually useful in debug).
  path: "cloudquery/aws"

  ## Required. Must be a specific version starting with v, e.g. v1.2.3
  ## Checkout latest versions here: https://github.com/cloudquery/cloudquery/releases?q=plugins-source-aws&expanded=true
  version: "v22.18.0"

  ## Required. You can use ["*"] to sync all tables or specify specific tables. Please note that syncing all tables can be slow.
  ## See all tables: https://www.cloudquery.io/docs/plugins/sources/aws/tables
  tables: [
    "aws_eks_clusters",
    "aws_elbv2_load_balancers",
    "aws_cloudfront_distributions",
    "aws_cognito_identity_pools",
    "aws_ec2_instances",
    "aws_ec2_vpc_endpoints",
    "aws_ec2_images",
    "aws_amplify_apps",
    "aws_iam_users",
    "aws_iam_saml_identity_providers",
    "aws_backup_protected_resources",
    "aws_backup_jobs",
    "aws_backup_plans",
    "aws_acm_certificates",
    "aws_rds_clusters",
    "aws_waf_web_acls"
  ]

  ## Required. All destinations you want to sync data to.
  destinations: ["postgresql"]

  spec:
    ## Optional. Plugin specific configuration.
    ## By default, will use the current AWS credentials available (just like AWS CLI).
    ## See all available options here: https://github.com/cloudquery/cloudquery/blob/main/plugins/source/aws/docs/configuration.md
    regions:
      - XXXXX
      - XXXXXX
      - XXXXXXX
    aws_debug: false
    org:
      admin_account:
        local_profile: ""
      member_role_name: XXXXXXXXXXXXXXXXXXXXX

````

Destination Plugin Config (PostgreSQL):

```yaml
kind: destination
spec:
  ## Required. Name of the plugin.
  ## This is an alias so it should be unique if you have a number of PostgreSQL destination plugins.
  name: "postgresql"
  ## Optional. Where to search for the plugin. Default: "github". Options: "github", "local", "grpc".
  # registry: "github"
  
  ## Path for the plugin.
  ## If registry is "github", path should be "repo/name".
  ## If registry is "local", path is path to binary. If "grpc", then it should be the address of the plugin (usually useful in debug).
  path: "cloudquery/postgresql"
  
  ## Required. Must be a specific version starting with v, e.g. v1.2.3
  ## Checkout latest versions here: https://github.com/cloudquery/cloudquery/releases?q=plugins-destination-postgresql&expanded=true
  version: "v7.0.1"
  
  ## Optional. Default: "overwrite-delete-stale". Available: "overwrite-delete-stale", "overwrite", "append".
  ## Not all modes are supported by all plugins, so make sure to check the plugin documentation for more details.
  write_mode: "overwrite-delete-stale" # overwrite-delete-stale, overwrite, append

  spec:
    ## Plugin-specific configuration for PostgreSQL.
    ## See all available options here: https://github.com/cloudquery/cloudquery/tree/main/plugins/destination/postgresql#postgresql-spec
    ## Required. Connection string to your PostgreSQL instance.
    ## In production, it is highly recommended to use environment variable expansion.
    ## connection_string: ${PG_CONNECTION_STRING}
    connection_string: ${PG_CONNECTION_STRING}
    pgx_log_level: error
    migrate_mode: forced

```

---

<div class="post-metadata">

**Author:** ![herman](https://sea1.discourse-cdn.com/flex001/user_avatar/community.cloudquery.io/herman/32/27_2.png) [@herman](https://community.cloudquery.io/u/herman)\
**Post date:** [November 16, 2023, 12:12pm UTC](https://community.cloudquery.io/t/cloudquery-update-issue-with-aws-and-postgres-plugins-migration-error/569/4 "2023-11-16T12:12:37Z")

</div>

I think the first thing to try is probably to upgrade the CLI; there may have been some fixes around this since `3.13.1`. You can see all the releases here: [GitHub Releases](https://github.com/cloudquery/cloudquery/releases?q=cli-&expanded=true) and the changelog: [CHANGELOG.md](https://github.com/cloudquery/cloudquery/blob/main/cli/CHANGELOG.md).

I think the other problem is that `migrate_mode: forced` is at the wrong level of indentation; it should be in the top-level spec, underneath `write_mode`. Here are the docs for this: [CloudQuery Destination Spec](https://www.cloudquery.io/docs/reference/destination-spec).

---

<div class="post-metadata">

**Author:** ![certain-alpaca](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@certain-alpaca](https://community.cloudquery.io/u/certain-alpaca)\
**Post date:** [November 16, 2023, 1:19pm UTC](https://community.cloudquery.io/t/cloudquery-update-issue-with-aws-and-postgres-plugins-migration-error/569/5 "2023-11-16T13:19:45Z")

</div>

Thanks for the answer.  
I’ll update the CLI and also I’ll correctly set the migrate mode option.  
It’s curious, though, that CloudQuery didn’t complain about the config file, so I guess it’s not doing any kind of validation on the format.

---

<div class="post-metadata">

**Author:** ![herman](https://sea1.discourse-cdn.com/flex001/user_avatar/community.cloudquery.io/herman/32/27_2.png) [@herman](https://community.cloudquery.io/u/herman)\
**Post date:** [November 16, 2023, 1:21pm UTC](https://community.cloudquery.io/t/cloudquery-update-issue-with-aws-and-postgres-plugins-migration-error/569/6 "2023-11-16T13:21:23Z")

</div>

Yeah, I think it doesn’t error on unrecognized parameters on that level, but probably it should.

---

<div class="post-metadata">

**Author:** ![certain-alpaca](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@certain-alpaca](https://community.cloudquery.io/u/certain-alpaca)\
**Post date:** [November 16, 2023, 2:20pm UTC](https://community.cloudquery.io/t/cloudquery-update-issue-with-aws-and-postgres-plugins-migration-error/569/7 "2023-11-16T14:20:05Z")

</div>

Seems like after updating the CloudQuery client and also specifying the migrate mode in the right part of the expect, it worked 🙂. To be honest, I think the issue was with the version of CloudQuery, as I did try the migrate command and it didn’t work either.

Thanks for your support!
