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

Issue with Symbolic Links and fs-extra #6456

Closed
jrusso1020 opened this issue Jul 13, 2021 · 0 comments · Fixed by #6457
Closed

Issue with Symbolic Links and fs-extra #6456

jrusso1020 opened this issue Jul 13, 2021 · 0 comments · Fixed by #6457
Labels
bug Something isn't working

Comments

@jrusso1020
Copy link
Contributor

jrusso1020 commented Jul 13, 2021

Expected Behavior

Broken Symbolic links should be handled by fs-extra similarly to how it's handled by cp -r. The scaffolder should be able to handle these broken symbolic links

For context we have a monorepo, so we keep a local copy of the monorepo stored on our backstage backend server which we periodically fetch changes for. We take our templates and copy them into a specific working directory in the monorepo git repository and then commit and push those changes to the remote.

Current Behavior

When symbolic links are broken, it breaks the scaffolder with an error like

2021-07-13T14:51:16.420Z Error: ENOENT: no such file or directory, stat '/tmp/XXX/XXX/XXX/XXX'

This issue is also outlined here jprichardson/node-fs-extra#638 and fixed in this PR jprichardson/node-fs-extra#779 which was released as part of the 10.0.0 release https://github.com/jprichardson/node-fs-extra/releases/tag/10.0.0 of fs-extra

Possible Solution

Update fs-extra in the scaffolder-backend to 10.0.0. Testing this change on our version of backstage and happy to also open a PR for the open source project

Steps to Reproduce

The issue from fs-extra has an example of how to reproduce. For us it's been sporadic, some time the symbolic links are okay and other times they are broken when scaffolding.

  1. Step 1
  2. Step 2
  3. ...

Context

This has caused our scaffolder to randomly break

Your Environment

  • NodeJS Version (v12): v12
  • Operating System and Version (e.g. Ubuntu 14.04):
  • Browser Information:
@jrusso1020 jrusso1020 added the bug Something isn't working label Jul 13, 2021
jrusso1020 added a commit to jrusso1020/backstage that referenced this issue Jul 13, 2021
Update fs-extra to 10.0.0 to better handle broken symbolic links.
The only breaking changes in the major version upgrade should be
this and the requirement of node v12 or higher which backstage
also requires.

fixes backstage#6456

Signed-off-by: jrusso1020 <jrusso@brex.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant