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

After some "aptly repo add", "aptly repo publish": panic: runtime error: invalid memory address or nil pointer dereference #150

Closed
stefaandr opened this issue Nov 28, 2014 · 6 comments
Labels
Milestone

Comments

@stefaandr
Copy link

I had been succesfully using aptly for some days now, adding packages as I create them.
It looks like my aptly database has suddenly become corrupt. As far as I can see, my cron job has been trying to "aptly repo add" a package (and fail, because it already exists in the repo) every minute for some time, and then "aptly repo publish" afterwards, only to suddenly give the error below:

  • aptly repo add test /home/binrepo/incoming/mypackage-1.3_1.3.alpha1_all.deb
    panic: runtime error: invalid memory address or nil pointer dereference [recovered]
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal 0xb code=0x1 addr=0x28 pc=0x63afa9]

    /home/smira/.gvm/gos/go1.3.3/src/pkg/runtime/panic.c:279 +0xf5
    github.com/smira/aptly/cmd.func·027()
    /home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/cmd/run.go:14 +0x9d
    runtime.panic(0x9d49c0, 0xd8ea33)
    /home/smira/.gvm/gos/go1.3.3/src/pkg/runtime/panic.c:248 +0x18d
    github.com/syndtr/goleveldb/leveldb.(_tOps).open(0xc20808ee80, 0xc2081bd540, 0x0, 0x0, 0x0, 0x0)
    /home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/_vendor/src/github.com/syndtr/goleveldb/leveldb/table.go:382 +0x239
    github.com/syndtr/goleveldb/leveldb.(_tOps).newIterator(0xc20808ee80, 0xc2081bd540, 0x0, 0x0, 0x0, 0x0)
    /home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/_vendor/src/github.com/syndtr/goleveldb/leveldb/table.go:411 +0x57
    github.com/syndtr/goleveldb/leveldb.(_tFilesArrayIndexer).Get(0xc2082d0d00, 0x0, 0x0, 0x0)
    /home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/_vendor/src/github.com/syndtr/goleveldb/leveldb/table.go:251 +0x125
    github.com/syndtr/goleveldb/leveldb/iterator.(_arrayIteratorIndexer).Get(0xc2081bdf40, 0x0, 0x0)
    /home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/_vendor/src/github.com/syndtr/goleveldb/leveldb/iterator/array_iter.go:164 +0x7b
    github.com/syndtr/goleveldb/leveldb/iterator.(_indexedIterator).setData(0xc2082c6f00)
    /home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/_vendor/src/github.com/syndtr/goleveldb/leveldb/iterator/indexed_iter.go:39 +0x68
    github.com/syndtr/goleveldb/leveldb/iterator.(_indexedIterator).Seek(0xc2082c6f00, 0xc2082cb1f2, 0x9, 0x9, 0x18)
    /home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/_vendor/src/github.com/syndtr/goleveldb/leveldb/iterator/indexed_iter.go:136 +0xd3
    github.com/syndtr/goleveldb/leveldb/iterator.(_mergedIterator).Seek(0xc208010900, 0xc2082cb1f2, 0x9, 0x9, 0x1)
    /home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/_vendor/src/github.com/syndtr/goleveldb/leveldb/iterator/merged_iter.go:117 +0x117
    github.com/syndtr/goleveldb/leveldb.(_dbIter).Seek(0xc208aff710, 0xc2081eff50, 0x1, 0x8, 0xc208aff710)
    /home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/_vendor/src/github.com/syndtr/goleveldb/leveldb/db_iter.go:166 +0xf6
    github.com/smira/aptly/database.(_levelDB).FetchByPrefix(0xc208189220, 0xc2081eff50, 0x1, 0x8, 0x0, 0x0, 0x0)
    /home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/database/leveldb.go:144 +0x12e
    github.com/smira/aptly/deb.NewLocalRepoCollection(0x7f10f0119eb8, 0xc208189220, 0xc208189220)
    /home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/deb/local.go:101 +0xae
    github.com/smira/aptly/deb.(_CollectionFactory).LocalRepoCollection(0xc208094880, 0xc208094880)
    /home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/deb/collections.go:52 +0x40
    github.com/smira/aptly/cmd.aptlyRepoAdd(0xc208071b00, 0xc20808ede0, 0x2, 0x2, 0x0, 0x0)
    /home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/cmd/repo_add.go:26 +0x112
    github.com/smira/commander.(_Command).Dispatch(0xc208071b00, 0xc20808ede0, 0x2, 0x2, 0x0, 0x0)
    /home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/_vendor/src/github.com/smira/commander/commands.go:305 +0x5d5
    github.com/smira/commander.(_Command).Dispatch(0xc20808c900, 0xc20808edd0, 0x3, 0x3, 0x0, 0x0)
    /home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/_vendor/src/github.com/smira/commander/commands.go:283 +0x1ff
    github.com/smira/commander.(*Command).Dispatch(0xc2080ee5a0, 0xc20808edc0, 0x4, 0x4, 0x0, 0x0)
    /home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/_vendor/src/github.com/smira/commander/commands.go:283 +0x1ff
    github.com/smira/aptly/cmd.Run(0xc2080ee5a0, 0xc20800e010, 0x4, 0x4, 0x4b9001, 0x0)
    /home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/cmd/run.go:38 +0x1aa
    main.main()
    /home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/main.go:9 +0x7c

goroutine 19 [finalizer wait]:
runtime.park(0x413220, 0xd94538, 0xd917a9)
/home/smira/.gvm/gos/go1.3.3/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0xd94538, 0xd917a9)
/home/smira/.gvm/gos/go1.3.3/src/pkg/runtime/proc.c:1385 +0x3b
runfinq()
/home/smira/.gvm/gos/go1.3.3/src/pkg/runtime/mgc0.c:2644 +0xcf
runtime.goexit()
/home/smira/.gvm/gos/go1.3.3/src/pkg/runtime/proc.c:1445

goroutine 20 [syscall]:
os/signal.loop()
/home/smira/.gvm/gos/go1.3.3/src/pkg/os/signal/signal_unix.go:21 +0x1e
created by os/signal.init·1
/home/smira/.gvm/gos/go1.3.3/src/pkg/os/signal/signal_unix.go:27 +0x32

goroutine 22 [runnable]:
github.com/syndtr/goleveldb/leveldb/util.(*BufferPool).drain(0xc2080241c0)
/home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/_vendor/src/github.com/syndtr/goleveldb/leveldb/util/buffer_pool.go:189 +0x1b4
created by github.com/syndtr/goleveldb/leveldb/util.NewBufferPool
/home/smira/.gvm/pkgsets/go1.3.3/global/src/github.com/smira/aptly/_vendor/src/github.com/syndtr/goleveldb/leveldb/util/buffer_pool.go:219 +0x202

@stefaandr
Copy link
Author

Subsequent "aptly mirror list" commands fail.
I have been using aptly 0.8 on x64.
I just tried upgrading to 0.9~dev+84+geec6743, but executing "aptly mirror list" again gives the same error.

@smira
Copy link
Contributor

smira commented Nov 28, 2014

This comes from inside of goleveldb. I'll take a look at the issue in a few hours.

I'm not sure if that would help, but you can try backing up the DB (contents of ~/.aptly/db directory) and running aptly db recover.

@smira
Copy link
Contributor

smira commented Nov 28, 2014

@syndtr could you please take a look at the backtrace above? It looks like a problem in goleveldb. This version of aptly has been built with syndtr/goleveldb@e2fa4e6. Could that be that it has already been fixed?

smira added a commit that referenced this issue Nov 28, 2014
@syndtr
Copy link

syndtr commented Nov 29, 2014

Yes, this issue has been addressed in syndtr/goleveldb@91ad6e5.

@smira smira added the bug label Nov 29, 2014
@smira smira added this to the v0.9 milestone Nov 29, 2014
@smira
Copy link
Contributor

smira commented Nov 29, 2014

Thanks, @syndtr!

I've published new nightly build aptly_0.9~dev+88+gf228ad8 which fixes the issue.

@smira smira closed this as completed Nov 29, 2014
@smira
Copy link
Contributor

smira commented Nov 30, 2014

@stefaandr please let me know if nightly build doesn't fix the issue for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants