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

On update to a different version, check perms FS perms first and fail early #163

Open
placer14 opened this issue Jun 24, 2022 · 1 comment

Comments

@placer14
Copy link

placer14 commented Jun 24, 2022

As a user, I would like for filesystem/permissions to be checked at the beginning (by moving old binaries aside to validate RW privs, for example, which could be restored on failure or deleted on success).

IPNS/IPFS interactions are still slow and can be flaky. This would alleviate the long wait between IPNS/IPFS resolution and the attempt to interact with the FS and failing.

Interesting things to check:

  • repo path can be found
  • access to IPFS binary includes RW privs
  • repo lock can be set (validating the daemon is stopped)

UX to avoid

binary access failed

[12:19:22] $ ipfs-update install v0.13.0
fetching go-ipfs version v0.13.0
Error fetching: ipfs api shell not up
Fetching with HTTP: "https://ipfs.io/ipns/dist.ipfs.io/go-ipfs/v0.13.0/go-ipfs_v0.13.0_darwin-arm64.tar.gz"
Fetching with HTTP: "https://ipfs.io/ipns/dist.ipfs.io/go-ipfs/v0.13.0/go-ipfs_v0.13.0_darwin-arm64.tar.gz"
binary downloaded, verifying...
success! tests all passed.
stashing old binary
install failed, reverting changes...
ERROR: install failed: could not move old binary: remove /usr/local/bin/ipfs: permission denied

Repo lock acquisition

[12:22:43] $ sudo ipfs-update install v0.13.0
fetching go-ipfs version v0.13.0
Error fetching: ipfs api shell not up
Fetching with HTTP: "https://ipfs.io/ipns/dist.ipfs.io/go-ipfs/v0.13.0/go-ipfs_v0.13.0_darwin-arm64.tar.gz"
binary downloaded, verifying...
success! tests all passed.
checking if we should install in GOPATH: /Users/mg/go/bin
installing new binary to /Users/mg/go/bin/ipfs
checking if repo migration is needed...
  check complete, migration required.
Looking for suitable migration binaries.
Need 1 migrations, downloading.
Downloading migration: fs-repo-11-to-12...
Error fetching: ipfs api shell not up
Fetching with HTTP: "https://ipfs.io/ipns/dist.ipfs.io/fs-repo-11-to-12/versions"
Error fetching: ipfs api shell not up
Fetching with HTTP: "https://ipfs.io/ipns/dist.ipfs.io/fs-repo-11-to-12/v1.0.2/fs-repo-11-to-12_v1.0.2_darwin-arm64.tar.gz"
Downloaded and unpacked migration: /tmp/migrations2655223284/fs-repo-11-to-12 (v1.0.2)
Running migration fs-repo-11-to-12 ...
  => Running: /tmp/migrations2655223284/fs-repo-11-to-12 -path=/Users/mg/.ipfs -verbose=true
applying 11-to-12 repo migration
locking repo at "/Users/mg/.ipfs"
error: failed to acquire repo lock at /Users/mg/.ipfs/repo.lock
Is a daemon running? please stop it before running migration
ERROR: Migration Failed:  migration fs-repo-11-to-12 failed: exit status 1
install failed, reverting changes...
ERROR: install failed: migration fs-repo-11-to-12 failed: exit status 1

(this case also suggested migration failed, but v0.13.0 was left in place. This was confusing. Filed a separate issue at #164)

@welcome
Copy link

welcome bot commented Jun 24, 2022

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

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

No branches or pull requests

1 participant