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

Portainer panics when starting off an existing EE database without data migration #4551

Closed
deviantony opened this issue Dec 2, 2020 · 0 comments · Fixed by #4557
Closed

Comments

@deviantony
Copy link
Member

Bug description

Starting Portainer CE from an existing EE database without going through the database migration steps will create a Go panic.

Expected behavior

Portainer should display an error message if it is unable to go through the database migration process and provide a link to the database migration documentation.

Portainer Logs

2020/11/09 02:21:30 Migrating database from version 1 to 25.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x5e08ca]

goroutine 1 [running]:
github.com/boltdb/bolt.(*Bucket).Cursor(...)
	/tmp/go/pkg/mod/github.com/boltdb/bolt@v1.3.1/bucket.go:91
github.com/portainer/portainer/api/bolt/migrator.(*Migrator).retrieveLegacyResourceControls.func1(0xc000130ee0, 0x0, 0xc000130ee0)
	/home/vsts/work/1/s/api/bolt/migrator/migrate_dbversion1.go:66 +0xaa
github.com/boltdb/bolt.(*DB).View(0xc00000a960, 0xc0005359b8, 0x0, 0x0)
	/tmp/go/pkg/mod/github.com/boltdb/bolt@v1.3.1/db.go:629 +0xa8
github.com/portainer/portainer/api/bolt/migrator.(*Migrator).retrieveLegacyResourceControls(0xc000535b80, 0x3d, 0x40, 0x3d, 0x0, 0x0)
	/home/vsts/work/1/s/api/bolt/migrator/migrate_dbversion1.go:64 +0x82
github.com/portainer/portainer/api/bolt/migrator.(*Migrator).updateResourceControlsToDBVersion2(0xc000535b80, 0x0, 0x0)
	/home/vsts/work/1/s/api/bolt/migrator/migrate_dbversion1.go:10 +0x40
github.com/portainer/portainer/api/bolt/migrator.(*Migrator).Migrate(0xc000535b80, 0x2a, 0xc000535b60)
	/home/vsts/work/1/s/api/bolt/migrator/migrator.go:105 +0x7e6
github.com/portainer/portainer/api/bolt.(*Store).MigrateData(0xc0000b81c0, 0x0, 0x0)
	/home/vsts/work/1/s/api/bolt/datastore.go:157 +0x3d1
main.initDataStore(0x19dc1cc, 0x5, 0x1cb0100, 0xc0001d0f60, 0xc0000a2200, 0x5)
	/home/vsts/work/1/s/api/cmd/portainer/main.go:67 +0x156
main.main()
	/home/vsts/work/1/s/api/cmd/portainer/main.go:340 +0x99

Steps to reproduce the issue:

  1. Deploy an instance of Portainer EE
  2. Stop that instance
  3. Deploy an instance of Portainer CE reusing the data from the EE instance

Technical details:

  • Portainer version: 2.0-CE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants