-
Notifications
You must be signed in to change notification settings - Fork 824
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
Duplicated files generated every time running amplify pull/push #13843
Comments
Hey @Dickensli, thank you for reaching out. Is the project currently being used in a folder that sync with cloud storage like iCloud or OneDrive? |
Thanks for the quick turnaround! No, I don't have any backup or sync with external storage. This should be more serious issue than seeing duplicated files. Please see this section
Moreover, sometimes what I observed is
Overall, the result appears disorganized ... |
Hey @Dickensli, thank you for the information. Could you try the following
|
Hi, I deduplicated all files and reupload #current-cloud-backend.zip; running
|
Hey I finally got it right. The above error is because I accidentally included nested #current-cloud-backend to zip. You are right, my iCloud backup is the root cause. I did not realize iCloud backed up every file on my laptop... but Thanks! Really helpful! |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Could you please comment how the icloud backup corrupted the amplify backend dir? |
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v22.4.0
Amplify CLI Version
12.12.4
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
Every time I run
amplify pull
oramplify push
, duplicate files are generated under the#current-cloud-backend
directory. For example, my backend folder structure looks like this:backend
|── api
|── awscloudformation/build
│ └── root-cloudformation-stack.json
|──auth
│ └── build
|── function
|── amplify-meta.json
|── backend-config.json
|── tags.json
However, the #current-cloud-backend directory ends up with:
#current-cloud-backend
|── api
|── api 2
|──awscloudformation/build
| └── root-cloudformation-stack.json
| └── root-cloudformation-stack 2.json
|── auth
│ └── build
│ └── build 2
|── auth 4
|── function
|── amplify-meta.json
|── amplify-meta 2.json
|── backend-config.json
|── backend-config 2.json
|── tags.json
└── tags 2.json
These number-appended folders are usually empty or outdated and vary with each run, e.g. I updated my api's
defaultauthentication
fromAPI_KEY
toAMAZON_COGNITO_USER_POOLS
usingamplify update api
in local; then I ranamplify push
, and twoamplify-meta.json
s were generated.amplify-meta.json
catch the change butamplify-meta 2.json
does not.Sometimes, it gets worse, and the
api/
folder disappears. When I check Amplify Backend Studio, I see errors like "can't retrieve data since schema is missing." While I can fix this by runningamplify push --force
, the issue of duplicated files still persists.One possible cause is:
I have turned on CI/CD linked to github repo, usually when I have some backend change, I run
amplify push
, waiting for push to succeed, and then rungit add
,git commit
,git push
which triggers CI/CD runs. Could this introduce any conflict between manual amplify push vs. CI/CD push?my
amplify.yml
Expected behavior
no duplicated files/folders should be generated
Reproduction steps
Project Identifier
083a411c049aa404823988034e0b09f6
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: