-
Notifications
You must be signed in to change notification settings - Fork 822
Amplify Environment Pull Error #14185
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
Comments
Hey @kgmei, Thanks for reporting this. As we work to investigate and resolve this issue, we have a potential workaround that may help in the meantime. Could you please try the following steps:
|
Hi @AnilMaktala, thanks for the quick response. I tried using CLI version 13.0.0 as suggested —the same issues persist regardless of the version. I tested under both Developer Mode enabled and disabled, and here’s what I’m seeing: 🔻 When Developer Mode is disabled, amplify pull fails with this error: 🛑 Could not attach the backend to the project. DirectoryError: Could not attach the backend to the project. 🔻 When Developer Mode is enabled, it gets past that but throws a different error: EBUSY: resource busy or locked, unlink 'D:\Projects\myproject-dev\myproject\amplify-backup\backend\node_modules\aws-cdk-lib\aws-certificatemanager\suffixes\README.txt' ✅ Works only with Developer Mode enabled and using Command Prompt. Let me know if there’s anything else you’d like me to try or collect for you. |
Hi @AnilMaktala, just looping back with some more findings and context. Previously, everything was working fine without any special configurations — I was able to run amplify pull on the D drive, directly in the VS Code terminal, and without enabling Developer Mode. No issues at all. However, recently, that exact same setup started failing — even after trying the suggested workaround and downgrading to CLI 13.0.0. The errors I encountered included: EPERM: operation not permitted, symlink ... when Developer Mode is disabled EBUSY: resource busy or locked, unlink ... when Developer Mode is enabled After further trial and error, here’s what finally worked: ✅ Moving the project to the C drive With this setup, the amplify pull completes successfully. It’s a bit unclear why this setup suddenly became necessary, as nothing in my workflow or environment had changed before this issue began. If there’s any insight on what may have caused this shift — like recent changes in Amplify CLI’s file handling or permissions — I’d love to understand more. Happy to share more details or test further if needed! |
Hey @kgmei, Thank you for testing the workaround and sharing your findings. We have identified an issue related to Windows file locking and symlink permissions when using VS Code's integrated PowerShell terminal. I have logged this as a bug for our team to investigate and resolve. In the meantime, you can work around this issue by using Windows Command Prompt instead of VS Code's integrated PowerShell terminal when running amplify pull commands. For context, this issue occurs because PowerShell and Command Prompt handle file locking differently during symlink operations. When the Amplify CLI creates symlinks (especially in the amplify-backup directory) during environment switching, PowerShell maintains file locks that prevent successful completion, while Command Prompt processes these operations correctly. |
Hi @AnilMaktala, Thank you for your response and for the workaround. I tried using the Windows Command Prompt as suggested, and it worked successfully. However, I’d like to highlight that the issue persists when Developer Mode is disabled. When Developer Mode is enabled, the amplify pull command works fine, but when it is disabled, I encounter the same error related to symlink permissions and file locking. Please let me know if any additional tests or details are required. Best regards, |
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v22.14.0
Amplify CLI Version
13.0.1
What operating system are you using?
Windows
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 working with multiple Amplify environments on Windows 11, attempting to sequentially pull different environments using amplify pull works for the first environment but fails on the second pull within the same project directory when using VS Code's integrated PowerShell terminal.
Errors observed:
**EPERM: operation not permitted, symlink ...
EBUSY: resource busy or locked, unlink ...
This seems to be related to symlink creation and file locking under amplify-backup during the backup operation before switching environments.
Important observation:
Running the same flow inside Command Prompt (with Developer Mode enabled) works fine for both environments.**
Expected behavior
he expected behavior is:
Pull environment 1 successfully
Pull environment 2 successfully, replacing the previous backend state with the new one
Allow smooth merging and environment switching within the same project folder, without file lock, symlink, or permission errors — regardless of whether it’s inside VS Code terminal or Command Prompt
Reproduction steps
Reproduction flow
Environment:
OS: Windows 11
Amplify CLI: Latest version (Node.js environment)
VS Code integrated PowerShell terminal
Steps:
Ensure Developer Mode is enabled in Windows
Open VS Code
Open integrated terminal (PowerShell)
Navigate to project folder correctly:
Error messages:
EPERM: operation not permitted, symlink ...
EBUSY: resource busy or locked, unlink ...
Now, try the same two-pull flow using Command Prompt (Developer Mode enabled) — both pulls work fine.
Project Identifier
No response
Log output
EPERM: operation not permitted, symlink 'D:\Projects\myproject-dev\myproject\amplify\backend' -> 'D:\Projects\myproject-dev\myproject\amplify-backup\backend\node_modules\overrides-for-auth-resource'
EBUSY: resource busy or locked, unlink 'D:\Projects\myprojectv-dev\myproject\amplify-backup\backend\node_modules\rxjs\LICENSE.txt'
Command Prompt (Developer Mode enabled):
✅ Both amplify pull operations succeed.
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: