-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Failed to pull the backend. - ENOENT: no such file or directory, realpath #10032
Comments
It seems that there's been numerous updates to the CLI since I last used it, such as for lambda layers and the gql transformer. At this point, I cannot follow the recommended steps to update lambda layers since I cannot run amplify push as the project cannot be properly initialized. What would be the recommended steps to resolve this? |
I am also experiencing the same issue on same version of cli. I also tried reverting as far back as 7.6.20 and still persisting. I have diagnosed that this is happening due to a windows limitation for file path length. My project pulls fine on a linux machine but does not work on windows anymore after we updated and installed more node packages in one of our lambda layers in our amplify project. I tried enabling long file path on windows but that did not seem to help, however I was able to find a work around by moving the project root folder into a short path (ex: C:\MyProject..) and that allowed me to pull successfully. |
To add on to @0afcode 's comment, there appears to be a reference: https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd |
@josefaidt The path is indeed quite long but long paths were already enabled in W11 so not sure why the issue still happened. I've decided to reinitialize the amplify stack since we had a lot of refactoring to do anyways and to take advantage of the toolchain changes. That exact same lambda layer with the same folder depth in the new stack does not have the issue, so it doesn't actually appear to be an issue with the path length limit in the OS, it's something with the framework. Again, looking at my original post above, the framework added a subdirectory that doesn't exist, "deep_ref" so maybe the issue lies there. |
Hey @iyz91 👋 unfortunately I have not been able to reproduce this by using a Lambda Layer with
|
It's important to note I think that the lambda layer was created using an older CLI version before the lambda layer changes that I linked in the first comment. |
Hey @iyz91 thanks for the clarification!
Does this issue occur each time we attempt to clone the repo and pull? Does this also occur with |
@josefaidt As far as I remember it occurred with both pull and init. |
Hey @iyz91 👋 unfortunately I have not been able to reproduce this issue. Have you continuously experienced this? Re-reading this note from an earlier reply
Was this project recreated from scratch or was it pulled into an empty directory? |
@josefaidt The issue came up when the project repo was pulled into another device and then amplify pull was run. I remember trying different approaches to initializing it etc. (can't say for certain what they were at this point) but everything gave me the same error. When I decided to recreate the stack from scratch I didn't have this problem at all even with the exact same folder structure and nesting depth. The key difference though is the recreation was done using the latest CLI version, while the earlier errored attempts were using the latest CLI on an amplify backend that was previously created probably 2 major CLI versions ago. |
Hey @iyz91 given my inability to reproduce this issue and since you were able to mitigate the issue I will close this for now, however if this occurs again please reply back to this thread and we can re-open to investigate further. |
Hey @josefaidt Looks like this issue popped up again... I created a seperate repo for an admin interface on our project and following the instructions here. This gave the error below:
To be clear, this was done in a brand new repo, pulling from an already existing and pushed amplify backend that was created with the amplify CLI v8. |
@josefaidt Seems to be a bug with node's |
Hey @iyz91 great callout on the Node issue. I will re-open this and mark this as a dependency issue |
@josefaidt - any update on this? Got hit by this again today :/ The weird thing is that everything has been going great with the CLI and then suddenly this old issue is back.
|
I'm also having this issue now.
Amplify version: 12.10.1 (latest) |
Having this issue as well. Amplify version: 12.11.1 |
no such file or directory, realpath 'DynamodbStreamsLambdaLayer\lib\nodejs\node_modules@aws-sdk\client-cognito-identity-provider\node_modules@aws-crypto\sha256-browser\node_modules\tslib\test\validateModuleExportsMatchCommonJS'' |
Before opening, please confirm:
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
16.14.2
Amplify CLI Version
7.6.25
What operating system are you using?
Windows 11
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made.
Amplify Categories
auth, storage, function, api
Amplify Commands
pull
Describe the bug
Project was previously worked on a different device. Setting this up on a new device for the first time created this issue.
The ENOENT error appears to involve a function lambda layer looking for the file/directory realpath in "function<layerName>\lib\nodejs\node_modules\browser-resolve\node_modules\resolve\test\pathfilter\deep_ref\node_modules\deep\deeper". It appears the sub-directory "deep_ref" does not exist but the sub-directories after that do exist.
Deleting any files related to amplify does not solve the issue.
Expected behavior
Amplify should be able to pull the project environment without error, including for any lambda layers.
Reproduction steps
Not sure if this will be reproducible for others as it appears to involve a lambda layer issue.
GraphQL schema(s)
No response
Log output
Additional information
No response
The text was updated successfully, but these errors were encountered: