Skip to content

Bitbucket: PANIC: runtime error: invalid memory address or nil pointer dereference #652

@nutellinoit

Description

@nutellinoit

We are running into go PANIC error on BitBucket.

I think something is changed on the bitbucket API, the go error stacktrace points to

/go/src/github.com/runatlantis/atlantis/server/events/vcs/bitbucketcloud/client.go:120

if *participant.Approved && *participant.User.Username != pull.Author {

Removing apply_requirements: [approved] from atlantis.yaml fix the problem momentarily

Logs

atlantis_1  | 2019/05/29 15:43:41+0000 [INFO] server: Parsed comment as command="apply" verbose=false dir="" workspace="" project="apigateway" flags=""
atlantis_1  | 2019/05/29 15:43:41+0000 [INFO] server: POST /events – respond HTTP 200
atlantis_1  | 2019/05/29 15:43:41+0000 [INFO] xxxx/terraform-aws#312: Pull request mergeable status: true
atlantis_1  | 2019/05/29 15:43:41+0000 [WARN] xxxx/terraform-aws#312: Unable to update commit status: making request "POST https://api.bitbucket.org/2.0/repositories/xxxx/terraform-aws/commit/945648ab26eb/statuses/build" unexpected status code: 400, body: {"type": "error", "error": {"fields": {"url": ["Enter a valid URL."]}, "message": "url: Enter a valid URL."}}
atlantis_1  | 2019/05/29 15:43:42+0000 [EROR] xxxx/terraform-aws#312: PANIC: runtime error: invalid memory address or nil pointer dereference
atlantis_1  | /usr/local/go/src/runtime/panic.go:513 (0x42a518)
atlantis_1  | /usr/local/go/src/runtime/panic.go:82 (0x42966d)
atlantis_1  | /usr/local/go/src/runtime/signal_unix.go:390 (0x43f861)
atlantis_1  | /go/src/github.com/runatlantis/atlantis/server/events/vcs/bitbucketcloud/client.go:120 (0x8d856a)
atlantis_1  | /go/src/github.com/runatlantis/atlantis/server/events/vcs/proxy.go:60 (0x886ebe)
atlantis_1  | /go/src/github.com/runatlantis/atlantis/server/events/project_command_runner.go:234 (0xcb0461)
atlantis_1  | /go/src/github.com/runatlantis/atlantis/server/events/project_command_runner.go:109 (0xcae4b4)
atlantis_1  | /go/src/github.com/runatlantis/atlantis/server/events/command_runner.go:312 (0xc9df65)
atlantis_1  | /go/src/github.com/runatlantis/atlantis/server/events/command_runner.go:219 (0xc9c7b1)
atlantis_1  | /usr/local/go/src/runtime/asm_amd64.s:1333 (0x457c40)

Tried with versions:

  • v0.7.2
  • v0.8.0
  • v0.6.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions