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

Failed import prune data to mounted path #1579

Open
Ja7ad opened this issue Nov 2, 2024 · 4 comments · May be fixed by #1668
Open

Failed import prune data to mounted path #1579

Ja7ad opened this issue Nov 2, 2024 · 4 comments · May be fixed by #1668
Assignees
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@Ja7ad
Copy link
Contributor

Ja7ad commented Nov 2, 2024

Description

When import prune data to mounted path got error invalid cross-device link

The error EXDEV (18): invalid cross-device link occurs because os.Rename cannot move files or directories across different file systems (e.g., from one mounted drive to another). os.Rename works only when the source and destination are on the same filesystem.

What Happened

✔ snapshot 2024-11-01 (157.70 MB)

   0% [                              ]  data.zip (0.00 Bytes/157.70 MB) 2024/11/01 11:02:57 download completed


Extracting files...
Moving data...
failed to move directory from /tmp/pactus689140844/data to /home/javad/Work/Pactus/data/testnet/data: rename /tmp/pactus689140844/data /home/javad/Work/Pactus/data/testnet/data: invalid cross-device link

Error happen in:

pactus/util/io.go

Lines 217 to 219 in 9ddfd95

if err := os.Rename(srcDir, dstDir); err != nil {
return fmt.Errorf("failed to move directory from %s to %s: %w", srcDir, dstDir, err)
}

@Ja7ad Ja7ad added bug Something isn't working good first issue Good for newcomers labels Nov 2, 2024
@alidevjimmy
Copy link
Contributor

@Ja7ad How can I reproduce it? what command did you use?

@Ja7ad
Copy link
Contributor Author

Ja7ad commented Nov 8, 2024

@Ja7ad How can I reproduce it? what command did you use?

pactus-daemon import

@Ja7ad
Copy link
Contributor Author

Ja7ad commented Nov 25, 2024

@alidevjimmy Do you have solution for fix this issue?

@b00f b00f added this to the v1.7.0 milestone Dec 21, 2024
@b00f b00f modified the milestones: v1.7.0, v1.8.0 Jan 16, 2025
@BuidlWithShivam
Copy link
Contributor

@Ja7ad Created a pull request.

Inspiration from https://gist.github.com/var23rav/23ae5d0d4d830aff886c3c970b8f6c6b

Kindly let me know if it looks fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants