Skip to content

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

Open
2 tasks done
kgmei opened this issue Apr 22, 2025 · 5 comments
Open
2 tasks done

Amplify Environment Pull Error #14185

kgmei opened this issue Apr 22, 2025 · 5 comments
Labels
bug Something isn't working windows Issues tied to running the CLI on Windows

Comments

@kgmei
Copy link

kgmei commented Apr 22, 2025

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:

  • 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.
@kgmei kgmei added the pending-triage Issue is pending triage label Apr 22, 2025
@AnilMaktala
Copy link
Member

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:

  1. Downgrade the CLI version to 13.0.0
  2. Test if the issue persists after the downgrade.
    Once you've completed these steps, please let us know if the problem is resolved or if you're still encountering difficulties.

@AnilMaktala AnilMaktala added the pending-response Issue is pending response from the issue author label Apr 22, 2025
@kgmei
Copy link
Author

kgmei commented Apr 23, 2025

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.
...
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'

🔻 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'
Error: EBUSY: resource busy or locked, unlink ...
So far:

✅ Works only with Developer Mode enabled and using Command Prompt.
❌ Fails in VS Code terminal and when Developer Mode is enabled or disabled.

Let me know if there’s anything else you’d like me to try or collect for you.

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Apr 23, 2025
@kgmei
Copy link
Author

kgmei commented Apr 24, 2025

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
✅ Enabling Developer Mode
✅ Using Amplify CLI 13.1.0 and 13.0.0 also
✅ Running from the VS Code terminal

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!

@AnilMaktala
Copy link
Member

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.

@AnilMaktala AnilMaktala added bug Something isn't working windows Issues tied to running the CLI on Windows and removed pending-triage Issue is pending triage labels Apr 24, 2025
@kgmei
Copy link
Author

kgmei commented Apr 25, 2025

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,
Meikandan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows Issues tied to running the CLI on Windows
Projects
None yet
Development

No branches or pull requests

2 participants