pki-io / core

Main pki.io repo
Other
31 stars 7 forks source link

I managed to get a "corrupt" org and I have no idea how #83

Closed FauxFaux closed 9 years ago

FauxFaux commented 9 years ago

Unfortunately I thought I knew what I'd done, so I just deleted it after saving this one error. Worst users ever.

I believe what I did was:

pki.io init foo
cd foo
pki.io ca list

...but that obviously doesn't reproduce the problem right now, on exactly the same machine / name / setup / etc.

% pki.io ca list
&{{{0xc20805a480 map[] false {0 0} [true true false false false true] 0xc20805a540 0} 0xc20807a9c0 0xc208069180}}
Loading admin app
Loading admin config
Loading admin entity
Loading org entity
*************************************************
[..]
The error was: Could not decrypt container: Could not decrypt: Could not decrypt container: Can't initialise cipher: crypto/aes: invalid key size 0

panic: ...

goroutine 1 [running]:
main.checkAppFatal(0x8d8910, 0x1f, 0xc2080b8400, 0x1, 0x1)
    /tmp/tmp.Yo5NzUr1SO/go/src/github.com/pki-io/admin/helpers.go:44 +0x214
main.(*AdminApp).LoadOrgEntity(0xc208068680)
    /tmp/tmp.Yo5NzUr1SO/go/src/github.com/pki-io/admin/adminApp.go:208 +0x91a
main.(*AdminApp).Load(0xc208068680)
    /tmp/tmp.Yo5NzUr1SO/go/src/github.com/pki-io/admin/adminApp.go:261 +0x14c
main.caList(0xc20809e000, 0x0, 0x0)
    /tmp/tmp.Yo5NzUr1SO/go/src/github.com/pki-io/admin/runCA.go:77 +0x60
main.runCA(0xc20809d200, 0x2, 0x2, 0x0, 0x0)
    /tmp/tmp.Yo5NzUr1SO/go/src/github.com/pki-io/admin/runCA.go:187 +0x21b
main.runCommand(0x7fffa822e78a, 0x2, 0xc20802b550, 0x1, 0x1, 0x0, 0x0)
    /tmp/tmp.Yo5NzUr1SO/go/src/github.com/pki-io/admin/pki.io.go:69 +0x321
main.main()
    /tmp/tmp.Yo5NzUr1SO/go/src/github.com/pki-io/admin/pki.io.go:52 +0x4b7

goroutine 5 [runnable]:
github.com/cihub/seelog.(*asyncLoopLogger).processQueue(0xc20805a1e0)
    /tmp/tmp.Yo5NzUr1SO/go/src/github.com/pki-io/admin/_vendor/src/github.com/cihub/seelog/behavior_asynclooplogger.go:61
created by github.com/cihub/seelog.newAsyncLoopLogger
    /tmp/tmp.Yo5NzUr1SO/go/src/github.com/pki-io/admin/_vendor/src/github.com/cihub/seelog/behavior_asynclooplogger.go:40 +0x8e

goroutine 6 [runnable]:
github.com/cihub/seelog.(*asyncLoopLogger).processQueue(0xc20805a300)
    /tmp/tmp.Yo5NzUr1SO/go/src/github.com/pki-io/admin/_vendor/src/github.com/cihub/seelog/behavior_asynclooplogger.go:61
created by github.com/cihub/seelog.newAsyncLoopLogger
    /tmp/tmp.Yo5NzUr1SO/go/src/github.com/pki-io/admin/_vendor/src/github.com/cihub/seelog/behavior_asynclooplogger.go:40 +0x8e

goroutine 7 [runnable]:
github.com/cihub/seelog.(*asyncLoopLogger).processQueue(0xc20805a4e0)
    /tmp/tmp.Yo5NzUr1SO/go/src/github.com/pki-io/admin/_vendor/src/github.com/cihub/seelog/behavior_asynclooplogger.go:61
created by github.com/cihub/seelog.newAsyncLoopLogger
    /tmp/tmp.Yo5NzUr1SO/go/src/github.com/pki-io/admin/_vendor/src/github.com/cihub/seelog/behavior_asynclooplogger.go:40 +0x8e
FauxFaux commented 9 years ago

Looks like this is in response to having duplicate org blocks in ~/.pki.io/admin.conf:

[[org]]
  name = "foo"
  id = "d4882adf22d88401f7a7ee453f69361e"
  admin_id = "1d4c7be76761008fe1cd3edec28af9db"

[[org]]
  name = "foo"
  id = "d15e992698acf677333a15d551adc887"
  admin_id = "548143b6e38db1198c08928a22bfd6e8"

...caused by initing twice with the same name.