ipfs / ipfs/kubo

MFS disappears forever after 'cannot acquire lock' error.

Open
#5,890 1 comment 0 reactions 0 assignees View on GitHub
kind/bug topic/files
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

#### Version information:
go-ipfs version: 0.4.18-
Repo version: 7
System version: amd64/linux
Golang version: go1.11.1

#### Type:
bug

#### Description:

I've been organizing all my data into an IPFS repo located on an external HDD. Basically I'll grab a bunch of files and run then through this function:

```fish
function ipfile_cp
set file $argv[1]
set target $argv[2]

set cid (ipfs add --pin=false --cid-version=1 -r -Q $file)
ipfs files rm --force -r $target
ipfs files cp /ipfs/$cid $target
ipfs files stat $target
end
```

Everything was working great, until today, when I was adding a video of 106M (before I had added files much bigger than that):

```
ipfile_cp $filename /files/$filename
Error: cannot acquire lock: Lock FcntlFlock of /home/fiatjaf/salerno/repo.lock failed: resource temporarily unavailable
Error: cannot acquire lock: Lock FcntlFlock of /home/fiatjaf/salerno/repo.lock failed: resource temporarily unavailable
Error: cannot acquire lock: Lock FcntlFlock of /home/fiatjaf/salerno/repo.lock failed: resource temporarily unavailable
```

(Unfortunately I have no other logs because my script omits them, it seems.)

At that point my daemon wasn't running (I don't know why, I think I always do this stuff with the daemon on). After noticing that fact I tried to turn on the daemon and got all normal output from it:

```
Initializing daemon...
go-ipfs version: 0.4.18-
Repo version: 7
System version: amd64/linux
Golang version: go1.11.1
Successfully raised file descriptor limit to 2048.
Swarm listening on /ip4/10.147.17.230/tcp/4001
Swarm listening on /ip4/10.147.20.230/tcp/4001
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/192.168.15.5/tcp/4001
Swarm listening on /ip6/2804:7f2:2781:db57:7425:3860:a2a9:ec4d/tcp/4001
Swarm listening on /ip6/2804:7f2:2781:db57:9e2a:70ff:fe8a:769/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /ip6/fc99:d06b:a6f9:f0:ab56::1/tcp/4001
Swarm listening on /p2p-circuit
Swarm announcing /ip4/10.147.17.230/tcp/4001
Swarm announcing /ip4/10.147.20.230/tcp/4001
Swarm announcing /ip4/127.0.0.1/tcp/4001
Swarm announcing /ip4/192.168.15.5/tcp/4001
Swarm announcing /ip6/2804:7f2:2781:db57:7425:3860:a2a9:ec4d/tcp/4001
Swarm announcing /ip6/2804:7f2:2781:db57:9e2a:70ff:fe8a:769/tcp/4001
Swarm announcing /ip6/::1/tcp/4001
Swarm announcing /ip6/fc99:d06b:a6f9:f0:ab56::1/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/7070
Daemon is ready
```

Then I run `ipfs files ls /` and got nothing. I had an enourmous tree of files on that MFS and it returns nothing. I can `ipfs add` my files normally (the same files I was adding when I got the error) but can't put then under the path `/videos/` on MFS because MFS is empty:

```
fiatjaf@menger ~/videos [1]> ipfs add --pin=false --cid-version=1 Especial\ Paulo\ Francis\ -\ GNT-ed96uH2fFzM.mp4
added zdj7WeRcVdZcyQCYoJYxKDwp6uhdom2NDSgJCs2uYtSWmeUF1 Especial Paulo Francis - GNT-ed96uH2fFzM.mp4
105.54 MiB / 105.54 MiB [===================================================] 100.00%
fiatjaf@menger ~/videos>
fiatjaf@menger ~/videos> ipfs files cp /ipfs/zdj7WeRcVdZcyQCYoJYxKDwp6uhdom2NDSgJCs2uYtSWmeUF1 /videos/whatever.mp4
Error: cp: cannot put node in path /videos/whatever.mp4: file does not exist
```

#### Other info
```
fiatjaf@menger ~> ipfs repo stat
NumObjects: 168559
RepoSize: 40257768982
StorageMax: 10000000000
RepoPath: /home/fiatjaf/salerno
Version: fs-repo@7
```

```
fiatjaf@menger ~/salerno [124]> du -sh *
38G blocks
8.0K config
1.9M datastore
4.0K datastore_spec
8.0K keystore
4.0K version
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.