Amplify-cli: Error: "multi-environment support is not available for Amplify projects with Mobile Hub migrated resources" latest cli 4.29.5

Created on 8 Oct 2020  Â·  14Comments  Â·  Source: aws-amplify/amplify-cli

Describe the bug
After upgrading to 4.29.5 (from 4.29.2) I am receiving error "multi-environment support is not available for Amplify projects with Mobile Hub migrated resources." when running any amplify env ... commands.

Never have used mobile hub within the amplify project, it is only aprox 4 months old.

Amplify CLI Version
4.29.5

To Reproduce

  1. npm i -g @aws-amplify/cli
  2. amplify env list

Expected behavior
Error should not show ("multi-environment support is not available for Amplify projects with Mobile Hub migrated resources")
List of environments should display

Screenshots
none

Desktop (please complete the following information):

  • OS: Mac
  • Node Version: v12.16.3

Additional context
Downgrading resolves issue (npm i -g @aws-amplify/[email protected])

bug platform

All 14 comments

@dylan-westbury Can you share your amplify-meta.json?

@ammarkarachi

{
  "providers": {
    "awscloudformation": {
      "AuthRoleName": "xxxxx",
      "UnauthRoleArn": "arn:aws:iam::xxxxx:role/xxxxx-unauthRole",
      "AuthRoleArn": "arn:aws:iam::xxxxx:role/xxxxx",
      "Region": "us-east-1",
      "DeploymentBucketName": "xxxxx-deployment",
      "UnauthRoleName": "xxxxx-unauthRole",
      "StackName": "xxxxx",
      "StackId": "arn:aws:cloudformation:us-east-1:xxxxx:stack/xxxxx/xxxxx",
      "AmplifyAppId": "xxxxx"
    }
  },
  {
...edited out
  },
  "notifications": {
    "xxxxxPinpoint": {
      "service": "Pinpoint",
      "output": {
        "Name": "xxxxxPinpoint-prod",
        "Id": "xxxxx",
        "Region": "us-east-1",
        "APNS": {
          "ApplicationId": "xxxxx",
          "CreationDate": "2020-07-03T06:37:08.615Z",
          "DefaultAuthenticationMethod": "CERTIFICATE",
          "Enabled": true,
          "HasCredential": true,
          "HasTokenKey": false,
          "Id": "apns",
          "IsArchived": false,
          "LastModifiedDate": "2020-07-03T06:39:53.294Z",
          "Platform": "APNS",
          "Version": 2
        },
        "FCM": {
          "ApplicationId": "xxxxx",
          "CreationDate": "2020-07-03T06:39:52.917Z",
          "Enabled": true,
          "HasCredential": true,
          "Id": "gcm",
          "IsArchived": false,
          "LastModifiedDate": "2020-07-03T06:39:52.917Z",
          "Platform": "GCM",
          "Version": 1
        },
        "Email": {
          "ApplicationId": "xxxxx",
          "CreationDate": "2020-07-03T06:32:09.122Z",
          "Enabled": true,
          "FromAddress": "xxxxx<no-replyxxxxxxxxxx.com>",
          "Id": "email",
          "Identity": "arn:aws:ses:us-east-1:xxxxx:identity/no-replyxxxxxxxxxx.com",
          "IsArchived": false,
          "LastModifiedDate": "2020-07-03T06:32:09.122Z",
          "MessagesPerSecond": 14,
          "Platform": "EMAIL",
          "RoleArn": "arn:aws:iam::xxxxx:role/service-role/pinpoint-events",
          "Version": 1
        },
        "SMS": {
          "ApplicationId": "xxxxx",
          "CreationDate": "2020-07-03T06:33:34.767Z",
          "Enabled": true,
          "Id": "sms",
          "IsArchived": false,
          "LastModifiedDate": "2020-09-13T04:18:04.449Z",
          "Platform": "SMS",
          "PromotionalMessagesPerSecond": 20,
          "TransactionalMessagesPerSecond": 20,
          "Version": 2
        }
      },
      "lastPushTimeStamp": "2020-10-08T03:55:08.522Z"
    }
  }
}

@dylan-westbury Thanks! it looks like it's a bug on our end with notifications and mobile hub migrator

@ammarkarachi I also noticed pinpoint disabled APNS push notifications for my dev and prod environment, I've had to re-add for each.

Also (maybe a feature), but amplify update analytics and selecting pinpoint now mentions that this can no longer be done, so I had to re-add within console.

@dylan-westbury @ammarkarachi does this problem also extend to creating a new environment on the amplify console. Because I tried to connect my master repo for prod environment and that build failed after 30 minutes and only created the amazon pinpoint app, but nothing else. Even the CFT stack only had the root step and nothing else.

This is not fixed in 4.29.6. I had to revert back to 4.29.2 in order to be able to run amplify env commands again.

$ amplify env remove prgi
multi-environment support is not available for Amplify projects with Mobile Hub migrated resources.

I'm not sure what Mobile Hub migrated resources are but our project is for the web and not for mobile development so we migrated no such thing.

Same problem for me.
I try AWS amplify on a sample react project: https://github.com/tonai/react-deploy
I Rollbacked to 4.29.2 to fix the issue.

@jonathanbiard What problem did you run into with 4.29.6?

amplify init
amplify add notification
amplify env add

and it worked for me, could you share some details how was this not working for you? how is your meta file looks like, what type of resources does not have the providerPlugin property set?

@tonai can you also look at your meta as well?

Also seeing the same thing, new project setup just a few days ago.

This appears to have happened in @aws-amplify/[email protected] ...

âžœ npm i -g @aws-amplify/[email protected]
➜ amplify env list                                                                                                                                                                                                                   
| Environments |
| ------------ |
| *dev         |
âžœ npm i -g @aws-amplify/[email protected]
➜ amplify env list                                                                                                                                                                                                                  Scanning for plugins...
Plugin scan successful
multi-environment support is not available for Amplify projects with Mobile Hub migrated resources.

No changes to the amplify-meta.json between the above 2 attempts, as follows...

{
  "providers": {
    "awscloudformation": {
      "AuthRoleName": "amplify-xxxx-authRole",
      "UnauthRoleArn": "arn:aws:iam::xxxx:role/amplify-xxxx-unauthRole",
      "AuthRoleArn": "arn:aws:iam::xxxx:role/amplify-xxxx-authRole",
      "Region": "ap-southeast-2",
      "DeploymentBucketName": "amplify-xxxx-deployment",
      "UnauthRoleName": "amplify-xxxx-unauthRole",
      "StackName": "amplify-xxxx",
      "StackId": "arn:aws:cloudformation:ap-southeast-2:xxxx:stack/amplify-xxxx/xxxx",
      "AmplifyAppId": "xxxx"
    }
  },
  "api": {
    "xxxx": {
      "service": "AppSync",
      "providerPlugin": "awscloudformation",
      "output": {
        "authConfig": {
          "defaultAuthentication": {
            "authenticationType": "API_KEY",
            "apiKeyConfig": {
              "apiKeyExpirationDays": 7,
              "description": "xxxxKey"
            }
          },
          "additionalAuthenticationProviders": []
        },
        "GraphQLAPIIdOutput": "xxxx",
        "GraphQLAPIEndpointOutput": "https://xxxx.appsync-api.ap-southeast-2.amazonaws.com/graphql",
        "GraphQLAPIKeyOutput": "xxxx"
      },
      "providerMetadata": {
        "s3TemplateURL": "https://s3.amazonaws.com/amplify-xxxx-deployment/amplify-cfn-templates/api/cloudformation-template.json",
        "logicalId": "apixxxx"
      },
      "lastPushTimeStamp": "2020-10-13T22:18:25.523Z",
      "lastPushDirHash": "xxxx="
    }
  },
  "hosting": {
    "amplifyhosting": {
      "service": "amplifyhosting",
      "type": "cicd",
      "lastPushTimeStamp": "2020-10-13T22:16:12.287Z"
    }
  }
}

@attilah : Hi again, had a quick look into this, for me this appears to be due to your checkIfMobileHubProject method in lib/utils/mobilehub-support.js triggering on the amplifyhosting block, which has no providerPlugin. Not sure if it should, only been using Amplify for a few days? However @tonai above seems to have the same block with no providerPlugin also, so I assume the same issue there.

The check here seems a bit wide open though, it ends up giving false positives which you are having to manually patch around, and results in misleading error messages (my code has never been near Mobile Hub).

@oldskool73 yes that is the root cause of the issue, we aware and working on a fix to unblock potentially blocked customers.

@tonai can you also look at your meta as well?

Hi @attilah, I don't really get what you want from me.
Did you want I run some command on my side ?

@aws-amplify/[email protected] seems to have solved this issue for me.

In the latest released we have removed the mobile hub check and will be using a different way for error prone detection so you are unblocked with the newest version of the CLI.

@tonai just update to the latest CLI now, no extra actions needed, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ReidWeb picture ReidWeb  Â·  3Comments

ffxsam picture ffxsam  Â·  3Comments

onlybakam picture onlybakam  Â·  3Comments

jeanpaulcozzatti picture jeanpaulcozzatti  Â·  3Comments

adriatikgashi picture adriatikgashi  Â·  3Comments