"tmpfs/goroots/go1.8/pkg/tool/linux_amd64/link: route.a: not package main"

99 views
Skip to first unread message

Ben Guild

unread,
Nov 15, 2017, 12:04:39 AM11/15/17
to Google App Engine
By including this in the main package (aside from `init()`) ...

func main() {

 appengine
.Main();


}

... This error appears on about 50% of deployments, and it's been going on for over a year. Really annoying because I can't build locally without commenting out that method, yet I can't deploy consistently with it there. (it usually takes two tries)

Does anyone have a workaround, or could it please be looked into?

Yannick (Cloud Platform Support)

unread,
Nov 15, 2017, 11:40:09 AM11/15/17
to Google App Engine
Hello, this is a weird error to have as appengine.Main() is a call used by many go applications, so it is definitely expected to work just fine for you. The fact that you're the only person to have reported this issue in the year that it has affected you makes me suspect that there might be an issue with either your application's configuration or your environment.

To make sure the problem isn't with your environment you might want to upload your application to the Cloud Shell and deploy it from there.

If you're also getting deployment errors on the Cloud Shell could you tell us more about your app's configuration and the commands you're using to test and deploy it?

Also please note that this type of question is probably more suited for Stack Overflow where you would also be asked for more information.

Ben Guild

unread,
Nov 15, 2017, 11:47:43 AM11/15/17
to Google App Engine
It's not only me.
The reason I had main() commented out was because that was a workaround that I found here on these groups. It's just still a bug and I wanted to bring it up again.

Ben Guild

unread,
Nov 15, 2017, 11:47:43 AM11/15/17
to Google App Engine
I believe it may be a bug with the Mac SDK.


On Thursday, November 16, 2017 at 1:40:09 AM UTC+9, Yannick (Cloud Platform Support) wrote:

Ben Guild

unread,
Nov 15, 2017, 11:48:17 AM11/15/17
to Google App Engine


On Thursday, November 16, 2017 at 1:40:09 AM UTC+9, Yannick (Cloud Platform Support) wrote:

Yannick (Cloud Platform Support)

unread,
Nov 15, 2017, 1:02:28 PM11/15/17
to Google App Engine
Searching for "not package main" I couldn't find the workaround to refer to. As for that Stack Overflow question (also posted here) it appears to be related to launching the development server, not trying to deploy your application to App Engine. Trying to deploy outside of MacOS (like on the Cloud Shell) should be a good way to test if the issue is related to that version of the SDK.

Luca Mattos Möller

unread,
Sep 5, 2018, 1:47:44 PM9/5/18
to Google App Engine
I was having this issue when my GOPATH was pointing to a directory inside my gae project's directory. I was doing that because I wanted my server modules to be organized in a standard way (per Go standards) so that my go code analysis/navigation/lint plugins worked properly and at the same time I wanted the gae dev server to detect changes to them and recompile automatically. Turns out it seems we can't have both :(

The issue was solved for me when I moved my server's go modules (and the GOPATH entry referring to them) to another directory outside the project's directory.


On Wednesday, November 15, 2017 at 12:04:39 AM UTC-5, Ben Guild wrote:
Reply all
Reply to author
Forward
0 new messages