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

ConcurrentModificationException: Schema is currently being altered, please wait until that is complete. #3135

Open
TimmyAA opened this issue Jan 30, 2025 · 10 comments
Labels
Gen 2 pending-community-response Issue is pending a response from the author or community. pending-triage question Further information is requested transferred

Comments

@TimmyAA
Copy link

TimmyAA commented Jan 30, 2025

Environment information

> npx ampx info
System:
  OS: Windows 11 10.0.22631
  CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
  Memory: 33.05 GB / 63.77 GB
Binaries:
  Node: 20.18.2 - C:\Program Files\nodejs\node.EXE
  Yarn: undefined - undefined
  npm: 10.8.2 - C:\Program Files\nodejs\npm.CMD
  pnpm: undefined - undefined
NPM Packages:
  @aws-amplify/auth-construct: 1.6.0
  @aws-amplify/backend: 1.14.0
  @aws-amplify/backend-auth: 1.5.0
  @aws-amplify/backend-cli: 1.4.8
  @aws-amplify/backend-data: 1.4.0
  @aws-amplify/backend-deployer: 1.1.15
  @aws-amplify/backend-function: 1.12.1
  @aws-amplify/backend-output-schemas: 1.4.0
  @aws-amplify/backend-output-storage: 1.1.4
  @aws-amplify/backend-secret: 1.1.5
  @aws-amplify/backend-storage: 1.2.4
  @aws-amplify/cli-core: 1.2.3
  @aws-amplify/client-config: 1.5.5
  @aws-amplify/deployed-backend-client: 1.5.0
  @aws-amplify/form-generator: 1.0.3
  @aws-amplify/model-generator: 1.0.12
  @aws-amplify/platform-core: 1.6.0
  @aws-amplify/plugin-types: 1.8.0
  @aws-amplify/sandbox: 1.2.11
  @aws-amplify/schema-generator: 1.2.7
  aws-amplify: 6.11.0
  aws-cdk: 2.173.2
  aws-cdk-lib: 2.173.2
  typescript: 5.7.2
No AWS environment variables
No CDK environment variables

Describe the bug

This error keeps coming up in sandbox (from windows) when making minor changes, like adding a field to a data model...
...failed: ConcurrentModificationException: Schema is currently being altered, please wait until that is complete.

The CloudFormation stack in console indicates "UPDATE_COMPLETE"

The only workaround that I've found is to run the sandbox with the changes from Ubuntu, then once complete, start the sandbox again in Windows

I did notice that when I save resource.ts, There is a double trigger on the file...

[Sandbox] Watching for file changes...
File written: amplify_outputs.json
[Sandbox] Triggered due to a file update event: \amplify\data\resource.ts
[Sandbox] Triggered due to a file update event: \amplify\data\resource.ts
[Sandbox] Previous deployment is still in progress. Will queue for another deployment after this one finishes
...
Error: ❌ d295 failed: ConcurrentModificationException: Schema is currently being altered, please wait until that is complete.

Caused By: ❌ d295 failed: ConcurrentModificationException: Schema is currently being altered, please wait until that is complete.

Reproduction steps

Adding a field to a data model.

@ykethan
Copy link
Member

ykethan commented Jan 30, 2025

Hey,👋 thanks for raising this! I'm going to transfer this over to our data repository for better assistance 🙂

@ykethan ykethan transferred this issue from aws-amplify/amplify-backend Jan 30, 2025
@AnilMaktala AnilMaktala added Gen 2 question Further information is requested labels Jan 30, 2025
@AnilMaktala
Copy link
Member

Hey @TimmyAA, Can you check your open terminals to see if you are running multiple sandbox instances?

@AnilMaktala AnilMaktala added the pending-community-response Issue is pending a response from the author or community. label Jan 30, 2025
@TimmyAA
Copy link
Author

TimmyAA commented Jan 30, 2025

Hey @TimmyAA, Can you check your open terminals to see if you are running multiple sandbox instances?

Hi @AnilMaktala, 2 terminals open, one running 'npx ampx sandbox' and other running 'quasar dev'

@github-actions github-actions bot added pending-maintainer-response Issue is pending a response from the Amplify team. and removed pending-community-response Issue is pending a response from the author or community. labels Jan 30, 2025
@AnilMaktala
Copy link
Member

@TimmyAA Thanks for checking. Do you have multiple stacks in your app? Also, what change in the resource.ts file triggered this issue?

@TimmyAA
Copy link
Author

TimmyAA commented Jan 30, 2025

@TimmyAA Thanks for checking. Do you have multiple stacks in your app? Also, what change in the resource.ts file triggered this issue?

Single stack.
I added the 'signature' field to the model...

  SCResponses: a
    .model({
      id: a.id().required(),
...
      signature: a.string().required(),
...
      deletedAt: a.string(),
      deleted: a.boolean().default(false),
    })

The only thing that looked suspicious was this double trigger on a single save...

[Sandbox] Watching for file changes...
File written: amplify_outputs.json
[Sandbox] Triggered due to a file update event: \amplify\data\resource.ts
[Sandbox] Triggered due to a file update event: \amplify\data\resource.ts
[Sandbox] Previous deployment is still in progress. Will queue for another deployment after this one finishes

I may try not letting npx ampx sandbox watch for file changes and just run it after I change something in the stack
Or is there a local state file that gets out of sync, maybe caused by this double trigger

@TimmyAA
Copy link
Author

TimmyAA commented Jan 30, 2025

Didn't work... added a new fields to a model while 'npx ampx sandbox' wasn't running. Then started it, same error.

...failed: ConcurrentModificationException: Schema is currently being altered, please wait until that is complete.

@AnilMaktala
Copy link
Member

Hey @TimmyAA, Interesting! Are you on Discord by any chance?

@AnilMaktala AnilMaktala added pending-community-response Issue is pending a response from the author or community. and removed pending-maintainer-response Issue is pending a response from the Amplify team. labels Jan 31, 2025
@nat-jones
Copy link

Experiencing the same issue. Is there an update on this?

@TimmyAA
Copy link
Author

TimmyAA commented Feb 6, 2025

No progress, but more information...
authorization changes on data resource work fine
storage resource changes work too

Just data model additions are a problem.

@github-actions github-actions bot added pending-maintainer-response Issue is pending a response from the Amplify team. and removed pending-community-response Issue is pending a response from the author or community. labels Feb 6, 2025
@AnilMaktala
Copy link
Member

hi @TimmyAA, Thanks for additional detials. I am unable to reproduce the issue on my end. To rule out any sandbox-specific problems, could you please try running the sandbox with a new identifier and share the results?

`npx ampx sandbox --identifier somename'

@AnilMaktala AnilMaktala added pending-community-response Issue is pending a response from the author or community. and removed pending-maintainer-response Issue is pending a response from the Amplify team. labels Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gen 2 pending-community-response Issue is pending a response from the author or community. pending-triage question Further information is requested transferred
Projects
None yet
Development

No branches or pull requests

4 participants