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

After version upgrade settings and configuration files look to be all out of date, and error: Missing region in config #13229

Closed
2 tasks done
qwikag opened this issue Sep 16, 2023 · 5 comments
Labels
pending-response Issue is pending response from the issue author pending-triage Issue is pending triage

Comments

@qwikag
Copy link

qwikag commented Sep 16, 2023

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

20.3.1

Amplify CLI Version

12.4.0

What operating system are you using?

Windows 10

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

no change to cloud resources.

Describe the bug

after upgrade of Next.js and Amplify-cli

I was able to >amplify push --profile xyz

I did a machine restart and >amplify push --profile xyz no longer worked
I was getting an error: Missing region in config

So after trying many things like project confgures etc nothing worked.
Nothing in the ~/.aws/config file had changed...

[profile app1]
sso_session=mysso
sso_account_id=123456789
sso_role_name=AdminAmplify
region=ap-southeast-2
output=json

[profile xyz]
sso_session=mysso
sso_account_id=987654321
sso_role_name=AdminAmplify
region=ap-southeast-2
output=json

[sso-session mysso]
sso_start_url=https://nztech.awsapps.com/start
sso_region=ap-southeast-2
sso_registration_scopes=sso:account:access

Next I pulled the amplify project into a new folder (non git)

and compared the settings (wildly different)
I think there is a fundamental issue with the way files are structure in older version and the latest versioin yet there is no update of the configuration files.
here is a compare of the files with differences... this is my main concernn is the upgrade did not adjust files to reflect what a new project pull would have.

Left
image

Expected behavior

no issue with region

Reproduction steps

updgrade next.js from 13.4.10 to 13.4.19
and amplify from 5.3.10 to 5.3.11
plus other dependancies

but no auth changes

Project Identifier

1aff16e72d6657e6251bd6a212fd28ac

Log output

Missing region in config

Additional information

OK
after upgrade this file is the cause:
local-aws-info.json

after upgrade it looked like this:

{
"dev": {
"configLevel": "project",
"useProfile": true,
"profileName": "amplify_Admin"
}
}

so I did a fresh pull into a new folde and this was what the new project looked like

{
"main": {
"configLevel": "amplifyAdmin"
}
}

so I adjusted the original project and everything back to normal.

SO, the issue here is there is no upgrade path/process! and the upgrade of amplify left me broken

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@qwikag qwikag added the pending-triage Issue is pending triage label Sep 16, 2023
@josefaidt
Copy link
Contributor

Hey @qwikag 👋 thanks for raising this! As we begin to look at this in more depth, what version of the CLI are you upgrading from? Unfortunately we do not currently support a --profile flag on the CLI, which is a bit confusing since this is effectively ignored. However, you can switch the local profile with amplify configure project or by modifying that local-aws-info.json file directly. For example:

{
  "dev": {
    "configLevel": "project",
    "useProfile": true,
    "profileName": "xyz"
  }
}

Please note for AWS SSO with IAM Identity Center you may also need a workaround in order for the CLI to properly fetch the credentials #4488 (comment)

@josefaidt josefaidt added the pending-response Issue is pending response from the issue author label Sep 18, 2023
@qwikag
Copy link
Author

qwikag commented Sep 18, 2023

@josefaidt
I may have upgraded a couple of times to try to fix the many issues I have experienced (daily for the past 3 months)
As I said above: upgraded next.js from 13.4.10 to 13.4.19, and amplify from 5.3.10 to 5.3.11

yes previously I did not need a profile flag but once this error arrived I had to try things.

But the probelm I am raising is the fact that an upgrade is released but any projects running on do not get their metadata upgraded.
Hence my picture highlights how out of alignment the new version cause my config to be misaligned.

Your comment about local-aws-info.json is great except there is no information about these attributes. I have searched high and low to find out what goes in this file.

And a new pull into a new directory does not set this up as you suggest. so there too is the bug.

Now on to your referred comments.
They do not work, I tried them previously, and check out the irony in the "--profile admin", so it seems like you do support the --profile command.
I had everything working just fint until the latest version without "+ credential_process=aws sso login --profile mysso-profile"

But this ticket is not about that it is about the careless method of upgrades without ensuring the underlying projects will remain working.

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Sep 18, 2023
@josefaidt
Copy link
Contributor

josefaidt commented Sep 20, 2023

Hey @qwikag thanks for clarifying, and sorry to hear of the rough experience! Updates to the client libraries should not have a direct impact on the backend files, though was the Amplify CLI also upgraded? The inclusion of credential_process is only needed as a workaround for SSO. amplifyAdmin in the local-aws-info.json signifies auth is performed via Amplify Studio, which is the default behavior for Amplify apps created in the AWS Console or have Amplify Studio enabled. To change this behavior you can run amplify configure project or modify that file directly to use the SSO profile

@josefaidt josefaidt added the pending-response Issue is pending response from the issue author label Sep 20, 2023
@josefaidt
Copy link
Contributor

Closing due to inactivity

@josefaidt josefaidt closed this as not planned Won't fix, can't repro, duplicate, stale Feb 2, 2024
Copy link

github-actions bot commented Feb 2, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-response Issue is pending response from the issue author pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

2 participants