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

fix fix-cross-device-link error during export #2693

Merged
merged 2 commits into from
Mar 21, 2023

Conversation

LesnyRumcajs
Copy link
Member

@LesnyRumcajs LesnyRumcajs commented Mar 21, 2023

Summary of changes

I encountered an error on my system when trying to export a snapshot.

❯ target/release/forest-cli --chain calibnet snapshot export --tipset 320480
Error: {"code":0,"message":"failed to persist temporary file: Invalid cross-device link (os error 18)"}

The issue is that persist method fails when the temp files live on a different filesystem.

    /// Note: Temporary files cannot be persisted across filesystems. Also
    /// neither the file contents nor the containing directory are
    /// synchronized, so the update may not yet have reached the disk when
    /// `persist` returns.

in my case

/dev/nvme0n1p3  953G  204G  743G  22% /
tmpfs            16G   20M   16G   1% /tmp

Changes introduced in this pull request:

  • fallback to copy in case it's impossible to persist the file (which is the case if the temporary file lives on a different filesystem)

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation,
  • I have added tests that prove my fix is effective or that my feature works
    (if possible),
  • I have made sure the
    CHANGELOG is
    up-to-date. All user-facing changes should be reflected in this document.

@LesnyRumcajs LesnyRumcajs merged commit e4d2933 into main Mar 21, 2023
@LesnyRumcajs LesnyRumcajs deleted the fix-cross-device-link-error branch March 21, 2023 12:29
@LesnyRumcajs LesnyRumcajs mentioned this pull request Aug 4, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants