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

environment not setting up when switching amplify environments or "amplify pull" #13747

Closed
2 tasks done
JonathonVega opened this issue Apr 29, 2024 · 2 comments
Closed
2 tasks done
Labels
pending-triage Issue is pending triage

Comments

@JonathonVega
Copy link

How did you install the Amplify CLI?

No response

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

No response

Amplify CLI Version

12.11.1

What operating system are you using?

Mac

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

No manual changes made

Describe the bug

When I do "amplify pull", I receive an error message. My amplifyconfiguration.json & awsconfiguration.json files aren't updating I switch amplify environments, and I'm not sure if it is related to this error message.

I included the stack trace of the error message

Any idea why this is occurring?

Expected behavior

When I switch amplify environments, it should update relevant files.

Reproduction steps

  1. "amplify env checkout prod" from dev environment
  2. See no issues, but awsconfiguration.json and amplifyconfiguration.json still point to dev environment resources
  3. "amplify pull"
  4. error message occurs

Project Identifier

No response

Log output

# Put your logs below this line

✔ Successfully pulled backend environment prod from the cloud.
✖ There was an error initializing your environment.
🛑 Could not initialize categories for 'prod': Cannot read properties of undefined (reading 'replace')

Resolution: Review the error message and stack trace for additional information.
Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

ProjectInitFault: Could not initialize categories for 'prod': Cannot read properties of undefined (reading 'replace')
    at initializeEnv (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/initialize-env.js:122:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async pullBackend (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/pull-backend.js:31:5)
    at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/commands/pull.js:59:13)
    at async Object.executeAmplifyCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:194:9)
    at async executePluginModuleCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:139:5)
    at async executeCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:37:9)
    at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:121:5)

Cannot read properties of undefined (reading 'replace')
TypeError: Cannot read properties of undefined (reading 'replace')
    at PinpointName.extractResourceName (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-notifications/lib/pinpoint-name.js:7:82)
    at ensurePinpointApp (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-notifications/lib/pinpoint-helper.js:223:82)
    at pushChanges (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-notifications/lib/multi-env-manager.js:294:51)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.initEnv (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-notifications/lib/multi-env-manager.js:45:40)
    at async initEnv (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-notifications/lib/index.js:47:5)

Additional information

No response

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.
@JonathonVega JonathonVega added the pending-triage Issue is pending triage label Apr 29, 2024
@JonathonVega
Copy link
Author

I was able to resolve the issue by amplify pull where it asked for my .p12 certificate. I provided it through libressl so my files were able to update.

Copy link

This issue is now closed. 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.

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

No branches or pull requests

1 participant