Drone + Kubernetes + Bitbucket Stash panic: runtime error

Hi and thank you for project!

Up and running with subj. Builds and deployments pipeline works fine until drone server was deleted/created.

No changes on repo side.

[email protected]:~$ kubectl -n drone logs server-55bcb989f7-dw5jq

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x9d25f1]

goroutine 1 [running]:
bitbucketserver.New(0xc420016040, 0x19, 0xc42000c079, 0x5, 0xc42000c099, 0x4, 0xc420016019, 0x14, 0xc420018019, 0x1b, …)
bitbucketserver.go:83 +0x151
main.setupStash(0xc4203af180, 0xf1b04e, 0x5, 0x1, 0xc4203ea660)
setup.go:395 +0x306
main.SetupRemote(0xc4203af180, 0x1, 0xf189bd, 0x1, 0x0)
setup.go:345 +0x22f
main.server(0xc4203af180, 0xc4203af180, 0xc420261ccf)
server.go:492 +0x183
urfave/cli.HandleAction(0xdda5e0, 0xf5cb80, 0xc4203af180, 0xc4203ea660, 0x0)
urfave/cli/app.go:485 +0xd4
urfave/cli.(*App).Run(0xc420448680, 0xc4200101c0, 0x1, 0x1, 0x0, 0x0)
urfave/cli/app.go:259 +0x70d
main.main()
main.go:22 +0x18c

Kind: Deployment
metadata:
name: server
labels:
app: server
name: server
spec:
replicas: 1
selector:
matchLabels:
app: server
template:
metadata:
labels:
name: server
app: server
spec:
containers:
- name: server
image: drone/drone:0.8
imagePullPolicy: Always
env:
- name: DRONE_STASH
value: “true”
- name: DRONE_STASH_GIT_USERNAME
value: “admin”
- name: DRONE_STASH_GIT_PASSWORD
value: “demo”
- name: DRONE_STASH_CONSUMER_KEY
value: “95c0282573633eb25e82”
- name: DRONE_STASH_CONSUMER_RSA
value: “/etc/bitbucket/consumer.pem”
- name: DRONE_STASH_URL
value: “http:172.20.44.203:7990”
- name: DRONE_OPEN
value: “true”
- name: DRONE_SECRET
value: “drone”
- name: DRONE_ADMIN
value: “admin”
- name: DRONE_HOST
value: 'http:172.20.44.196:30002’
volumeMounts:
- name: drone-lib
mountPath: /var/lib/drone
- name: bitbucket
mountPath: /etc/bitbucket
readOnly: true
volumes:
- name: bitbucket
secret:
secretName: consumer.pem
- name: drone-lib
persistentVolumeClaim:
claimName: drone

fixed!
Issue was in broken DRONE_STASH_CONSUMER_RSA so BB not answered correctly.
But anyway ‘runtime error’ is not self explained.

Thank you for drone!