Skip to content

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

Closed
@philslab-ninja

Description

Hi,

I am trying to get atlantis to work using GitLab. I have setup atlantis and gitlab (on-premise as well as gitlab.com) and everything seems to be communicating ok. When I enter "atlantis help" as a comment on a commit I get the following error (tested with atlantis standalone and docker version). Tested with different atlantis versions (latest, v0.3.10, v0.3.9).

Probably I am doing something wrong as I have seen no issue for this so far - but I cannot find the problem.

My docker command (username, Token and Secret are correct - blanked out here):

[root@ip-172-31-24-145 ec2-user]# docker run -p 4141:4141 runatlantis/atlantis:latest server --atlantis-url http://xx.xx.xx.xx:4141 --gitlab-user MyUsername --gitlab-token AValidToken --gitlab-webhook-secret TheGitLabSecret --repo-whitelist *
2018/06/15 13:53:55 [WARN] server: Atlantis started - listening on port 4141
2018/06/15 13:54:05 PANIC: runtime error: invalid memory address or nil pointer dereference
goroutine 20 [running]:
github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni.(*Recovery).ServeHTTP.func1(0x7f13c2ff8010, 0xc4201e2280, 0xc4200e1a40)
	/go/src/github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni/recovery.go:34 +0xef
panic(0x9a1ac0, 0xdf19d0)
	/usr/local/go/src/runtime/panic.go:502 +0x229
github.com/runatlantis/atlantis/server/events.(*EventParser).ParseGitlabMergeCommentEvent(0xc420059e80, 0xc420023a60, 0x4, 0xc420204000, 0x6c2868, 0xc4200217a0, 0x14, 0x0, 0x0, 0x0, ...)
	/go/src/github.com/runatlantis/atlantis/server/events/event_parser.go:172 +0x1f3
github.com/runatlantis/atlantis/server.(*EventsController).HandleGitlabCommentEvent(0xc42018d5f0, 0x7f13c2ff8010, 0xc4201e2280, 0xc420023a60, 0x4, 0xc420204000, 0x6c2868, 0xc4200217a0, 0x14, 0x0, ...)
	/go/src/github.com/runatlantis/atlantis/server/events_controller.go:171 +0xd2
github.com/runatlantis/atlantis/server.(*EventsController).handleGitlabPost(0xc42018d5f0, 0x7f13c2ff8010, 0xc4201e2280, 0xc420107600)
	/go/src/github.com/runatlantis/atlantis/server/events_controller.go:159 +0x32e
github.com/runatlantis/atlantis/server.(*EventsController).Post(0xc42018d5f0, 0x7f13c2ff8010, 0xc4201e2280, 0xc420107600)
	/go/src/github.com/runatlantis/atlantis/server/events_controller.go:70 +0x191
github.com/runatlantis/atlantis/server.(*EventsController).Post-fm(0x7f13c2ff8010, 0xc4201e2280, 0xc420107600)
	/go/src/github.com/runatlantis/atlantis/server/server.go:292 +0x48
net/http.HandlerFunc.ServeHTTP(0xc4201bedf0, 0x7f13c2ff8010, 0xc4201e2280, 0xc420107600)
	/usr/local/go/src/net/http/server.go:1947 +0x44
github.com/runatlantis/atlantis/vendor/github.com/gorilla/mux.(*Router).ServeHTTP(0xc4201b8cb0, 0x7f13c2ff8010, 0xc4201e2280, 0xc420107600)
	/go/src/github.com/runatlantis/atlantis/vendor/github.com/gorilla/mux/mux.go:162 +0xed
github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni.Wrap.func1(0x7f13c2ff8010, 0xc4201e2280, 0xc420107400, 0xc4200e1c40)
	/go/src/github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni/negroni.go:41 +0x4d
github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni.HandlerFunc.ServeHTTP(0xc4200e1ae0, 0x7f13c2ff8010, 0xc4201e2280, 0xc420107400, 0xc4200e1c40)
	/go/src/github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni/negroni.go:24 +0x4e
github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni.middleware.ServeHTTP(0xae7d40, 0xc4200e1ae0, 0xc4200e1b40, 0x7f13c2ff8010, 0xc4201e2280, 0xc420107400)
	/go/src/github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni/negroni.go:33 +0xa5
github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni.(middleware).ServeHTTP-fm(0x7f13c2ff8010, 0xc4201e2280, 0xc420107400)
	/go/src/github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni/negroni.go:33 +0x60
github.com/runatlantis/atlantis/server.(*RequestLogger).ServeHTTP(0xc42000c460, 0x7f13c2ff8010, 0xc4201e2280, 0xc420107400, 0xc4200e1c20)
	/go/src/github.com/runatlantis/atlantis/server/middleware.go:37 +0x62
github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni.middleware.ServeHTTP(0xae6a80, 0xc42000c460, 0xc4200e1b20, 0x7f13c2ff8010, 0xc4201e2280, 0xc420107400)
	/go/src/github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni/negroni.go:33 +0xa5
github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni.(middleware).ServeHTTP-fm(0x7f13c2ff8010, 0xc4201e2280, 0xc420107400)
	/go/src/github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni/negroni.go:33 +0x60
github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni.(*Recovery).ServeHTTP(0xc4200e1a40, 0x7f13c2ff8010, 0xc4201e2280, 0xc420107400, 0xc4200e1c00)
	/go/src/github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni/recovery.go:45 +0x82
github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni.middleware.ServeHTTP(0xae6f20, 0xc4200e1a40, 0xc4200e1b00, 0x7f13c2ff8010, 0xc4201e2280, 0xc420107400)
	/go/src/github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni/negroni.go:33 +0xa5
github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni.(*Negroni).ServeHTTP(0xc4201dc1b0, 0xaeba40, 0xc4201022a0, 0xc420107400)
	/go/src/github.com/runatlantis/atlantis/vendor/github.com/urfave/negroni/negroni.go:73 +0xf2
net/http.serverHandler.ServeHTTP(0xc42018d790, 0xaeba40, 0xc4201022a0, 0xc420107400)
	/usr/local/go/src/net/http/server.go:2694 +0xbc
net/http.(*conn).serve(0xc4201bb900, 0xaebf80, 0xc4201e20c0)
	/usr/local/go/src/net/http/server.go:1830 +0x651
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:2795 +0x27b

Thanks for any help!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions