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

panic: assertion failed: write: circular dependency occurred when pulling #846

Open
dforero0896 opened this issue Jan 18, 2017 · 7 comments

Comments

@dforero0896
Copy link

Hey there, I've been running into this problem when simply pulling for the first time after installing. No clue why this happens.
Thanks

@professorjamesmoriarty
Copy link

@dforero0896 This may be similar to a previous issue #607 posted.

It's always ideal to post means and version installed (drive version and go version). The more info shared, more time saved when @odeke-em or others can find time to help you.

@dforero0896
Copy link
Author

dforero0896 commented Jan 18, 2017

@shaggytwodope yes, saw that, but don't know how to fix it so a little more help would be useful. I understand that issue #607 was due to a problem when using Lustre, which I'm not using.
Also I'm using drive version: 0.3.9 and go version 1.6.2 on linux/amd64.

@odeke-em
Copy link
Owner

Thank you @dforero0896 for the report and welcome to drive!

@shaggytwodope thank you for the introduction and for asking for the information, in deed it does help quite a lot to know the build information.

@dforero0896 would you mind pasting in here the stack trace of the error?

@dforero0896
Copy link
Author

Thanks @odeke-em for the quick response and the welcome. As I'm quite an ignorant with this kinds of stuff, I will paste here the whole message I get and hope that is useful.

Addition count 936 src: 296.66MB
Modification count 2 src: 220.22KB
Proceed with the changes? [Y/n]:y
 98322 / 311291041 [>-----------------------------------------------------]   0.03% 52m49spanic: assertion failed: write: circular dependency occurred

goroutine 268 [running]:
panic(0x935ec0, 0xc82038ccd0)
	/usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6
github.com/boltdb/bolt._assert(0xc820907400, 0xbfe760, 0x23, 0x0, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/boltdb/bolt/db.go:1029 +0xee
github.com/boltdb/bolt.(*node).write(0xc8206deaf0, 0xc820907000)
	/home/daniel/gopath/src/github.com/boltdb/bolt/node.go:226 +0x775
github.com/boltdb/bolt.(*node).spill(0xc8206deaf0, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/boltdb/bolt/node.go:378 +0x5bc
github.com/boltdb/bolt.(*Bucket).spill(0xc8207387c0, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/boltdb/bolt/bucket.go:570 +0x1cf
github.com/boltdb/bolt.(*Bucket).spill(0xc82037ec58, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/boltdb/bolt/bucket.go:537 +0xbc2
github.com/boltdb/bolt.(*Tx).Commit(0xc82037ec40, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/boltdb/bolt/tx.go:163 +0x1d4
github.com/boltdb/bolt.(*DB).Update(0xc8201b23c0, 0xc820539b80, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/boltdb/bolt/db.go:605 +0x11d
github.com/odeke-em/drive/config.(*Context).SerializeIndex(0xc820013180, 0xc8206e2d80, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/odeke-em/drive/config/config.go:279 +0x1a3
github.com/odeke-em/drive/src.(*Commands).createIndex(0xc8200132c0, 0xc8201f6580, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/odeke-em/drive/src/fetch.go:314 +0x1df
github.com/odeke-em/drive/src.(*Commands).localMod.func1(0xc820539d40, 0xc8202b2300, 0xc8200132c0)
	/home/daniel/gopath/src/github.com/odeke-em/drive/src/pull.go:528 +0x56
github.com/odeke-em/drive/src.(*Commands).localMod(0xc8200132c0, 0xc8202b2300, 0x0, 0x0, 0x0, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/odeke-em/drive/src/pull.go:566 +0x2af
github.com/odeke-em/drive/src.(*Commands).(github.com/odeke-em/drive/src.localMod)-fm(0xc8202b2300, 0x0, 0x0, 0x0, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/odeke-em/drive/src/misc.go:1062 +0x56
github.com/odeke-em/drive/src.(*Commands).playPullChanges.func2.1(0xc8202b2300, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/odeke-em/drive/src/pull.go:477 +0x57
github.com/odeke-em/drive/src.(*changeJobSt).changeJober.func1(0x0, 0x0, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/odeke-em/drive/src/misc.go:120 +0x23e
github.com/odeke-em/drive/src.jobSt.Do(0x1, 0xc820492800, 0x0, 0x0, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/odeke-em/drive/src/misc.go:100 +0x35
github.com/odeke-em/drive/src.(*jobSt).Do(0xc8203f4870, 0x0, 0x0, 0x0, 0x0)
	<autogenerated>:6 +0xb0
github.com/odeke-em/semalim.Run.func4.1(0xc8203f46f0, 0xc82080a420, 0xc8203f4710, 0xc8203f4740, 0x7feef00ea958, 0xc8203f4870)
	/home/daniel/gopath/src/github.com/odeke-em/semalim/semalim.go:71 +0x46
created by github.com/odeke-em/semalim.Run.func4
	/home/daniel/gopath/src/github.com/odeke-em/semalim/semalim.go:76 +0x12c

This happens no matter how many files I try pulling.

@odeke-em
Copy link
Owner

Thank you @dforero0896 for the stacktrace. I think this issue might be related to the bunch of boltdb issues that have popped up in the past 2 weeks. Please see https://github.com/odeke-em/drive/wiki/Boltdb-breaks-drive-with-(panic:-invalid-page-type:)-or-(panic:--above-high-water-mark) which was made by @nelaaro after trying to debug boltdb. Also you can try to remove your .drivedb file and then trying again.

@dforero0896
Copy link
Author

After chacking those solutions I found the following. In the first one, I get to drive-gen: no command found. But then I try removing the drivedb file and sync seems to work but after some time I get panic: page 36 already freed. When retrying drive pull again, it works until message appears again with some other page number. The stacktrace for this is

Addition count 796 src: 259.96MB
Modification count 1 src: 1.18KB
Proceed with the changes? [Y/n]:y
 185599797 / 272586867 [==================================>----------------]  68.09% 4m41spanic: page 36 already freed

goroutine 911 [running]:
panic(0x935ec0, 0xc82045fa20)
	/usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6
github.com/boltdb/bolt.(*freelist).free(0xc820418030, 0x2d8, 0x7f58478dd000)
	/home/daniel/gopath/src/github.com/boltdb/bolt/freelist.go:121 +0x37b
github.com/boltdb/bolt.(*node).spill(0xc82079eb60, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/boltdb/bolt/node.go:363 +0x2ca
github.com/boltdb/bolt.(*node).spill(0xc82079eaf0, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/boltdb/bolt/node.go:350 +0x12c
github.com/boltdb/bolt.(*Bucket).spill(0xc8208dd4c0, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/boltdb/bolt/bucket.go:570 +0x1cf
github.com/boltdb/bolt.(*Bucket).spill(0xc820442b78, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/boltdb/bolt/bucket.go:537 +0xbc2
github.com/boltdb/bolt.(*Tx).Commit(0xc820442b60, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/boltdb/bolt/tx.go:163 +0x1d4
github.com/boltdb/bolt.(*DB).Update(0xc8201b4f00, 0xc820b79b60, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/boltdb/bolt/db.go:605 +0x11d
github.com/odeke-em/drive/config.(*Context).SerializeIndex(0xc820013180, 0xc82074fda0, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/odeke-em/drive/config/config.go:279 +0x1a3
github.com/odeke-em/drive/src.(*Commands).createIndex(0xc8200132c0, 0xc82055a9a0, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/odeke-em/drive/src/fetch.go:314 +0x1df
github.com/odeke-em/drive/src.(*Commands).localAdd.func1(0xc820b79d40, 0xc82058f640, 0xc8200132c0)
	/home/daniel/gopath/src/github.com/odeke-em/drive/src/pull.go:574 +0x65
github.com/odeke-em/drive/src.(*Commands).localAdd(0xc8200132c0, 0xc82058f640, 0x0, 0x0, 0x0, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/odeke-em/drive/src/pull.go:605 +0x2b1
github.com/odeke-em/drive/src.(*Commands).(github.com/odeke-em/drive/src.localAdd)-fm(0xc82058f640, 0x0, 0x0, 0x0, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/odeke-em/drive/src/misc.go:1066 +0x56
github.com/odeke-em/drive/src.(*Commands).playPullChanges.func2.1(0xc82058f640, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/odeke-em/drive/src/pull.go:477 +0x57
github.com/odeke-em/drive/src.(*changeJobSt).changeJober.func1(0x0, 0x0, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/odeke-em/drive/src/misc.go:120 +0x23e
github.com/odeke-em/drive/src.jobSt.Do(0x277, 0xc820318f20, 0x0, 0x0, 0x0, 0x0)
	/home/daniel/gopath/src/github.com/odeke-em/drive/src/misc.go:100 +0x35
github.com/odeke-em/drive/src.(*jobSt).Do(0xc820376a00, 0x0, 0x0, 0x0, 0x0)
	<autogenerated>:6 +0xb0
github.com/odeke-em/semalim.Run.func4.1(0xc820416480, 0xc820641500, 0xc820416490, 0xc8204164a0, 0x7f584798cd98, 0xc820376a00)
	/home/daniel/gopath/src/github.com/odeke-em/semalim/semalim.go:71 +0x46
created by github.com/odeke-em/semalim.Run.func4
	/home/daniel/gopath/src/github.com/odeke-em/semalim/semalim.go:76 +0x12c

This happened two times until I got panic: assertion failed: write: circular dependency occurred.

Removed the file again and got my first "successful" pull, so it looks like removing drivedb kinda works.

Thanks for the help.

@odeke-em
Copy link
Owner

odeke-em commented Feb 3, 2017

Hey folks, please get and test out the latest boltdb as per boltdb/bolt#654
You can do so by running

$ go get -u -v github.com/odeke-em/drive/drive-gen && drive-gen

and let me know if the problem persists and I'll report back to the boltdb issue.

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

3 participants