FAQ
Hey all,

I ran into an issue a couple of days ago with the buildpack:
https://github.com/kr/heroku-buildpack-go
referenced in Mark McGranaghan's great tutorial on getting started with Go
on heroku:
http://mmcgrana.github.com/2012/09/getting-started-with-go-on-heroku.html

The buildpack was copying over all of the contents $GOPATH to
$GOPATH/src/demoapp/ so I was ending up with paths that looked like:
$GOPATH/src/demoapp/src/demoapp

which was failing when trying to import a second package via something like
"demoapp/models" since all the source now lived a couple of levels deeper.

I changed the buildpack and got things working, but I was just trying to
clarify if the misunderstanding was mine or if there was an actual problem
with the buildpack.

My code is structured so that I have:
$GOPATH/bin
$GOPATH/pkg
$GOPATH/src
and then all source lives in
$GOPATH/src/demoapp
and my second package is in
$GOPATH/src/demoapp/models

I issued a pull request for the change I made here:
https://github.com/kr/heroku-buildpack-go/pull/13

Anyone else deploying Go on heroku run into something like this? Or have
tips?

Thanks,
-Eric

--

Search Discussions

  • Johann Höchtl at Nov 25, 2012 at 9:17 am

    Am Freitag, 23. November 2012 16:36:15 UTC+1 schrieb ericc:
    Hey all,

    I ran into an issue a couple of days ago with the buildpack:
    https://github.com/kr/heroku-buildpack-go
    referenced in Mark McGranaghan's great tutorial on getting started with Go
    on heroku:
    http://mmcgrana.github.com/2012/09/getting-started-with-go-on-heroku.html
    Me interested too, bumping.

    Thanks,
    -Eric
    --
  • Mark McGranaghan at Nov 25, 2012 at 8:59 pm
    I'm glad to hear of the interest in Go on Heroku (:

    Does anyone have a self-contained, public repo that demonstrates this
    problem? This would be helpful in understanding and perhaps fixing this
    problem. For example:

    $ git clone ...
    $ cd ...
    $ heroku create test-go --buildpack
    https://github.com/kr/heroku-buildpack-go.git
    $ git push heroku master
    [error appears here]
    On Sunday, November 25, 2012 1:17:03 AM UTC-8, Johann Höchtl wrote:



    Am Freitag, 23. November 2012 16:36:15 UTC+1 schrieb ericc:
    Hey all,

    I ran into an issue a couple of days ago with the buildpack:
    https://github.com/kr/heroku-buildpack-go
    referenced in Mark McGranaghan's great tutorial on getting started with
    Go on heroku:
    http://mmcgrana.github.com/2012/09/getting-started-with-go-on-heroku.html
    Me interested too, bumping.

    Thanks,
    -Eric
    --
  • Ericc at Nov 29, 2012 at 5:33 pm
    Hey guys,

    Sorry for the delay. Here's a repo that shows the error along with steps
    to reproduce.

    $ git clone https://github.com/econner/heroku-go-buildpack-error.git
    $ export GOPATH=`pwd`
    $ export PATH=$PATH:$GOPATH/bin
    $ cd $GOPATH/src/demoapp
    $ go get
    $ demoapp
    Hello from main.
    Hello!
    $ cd $GOPATH
    $ heroku create -b https://github.com/kr/heroku-buildpack-go.git
    $ git push heroku master

    Counting objects: 36, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (24/24), done.
    Writing objects: 100% (36/36), 1.87 MiB | 666 KiB/s, done.
    Total 36 (delta 5), reused 0 (delta 0)

    -----> Heroku receiving push
    -----> Fetching custom git buildpack... done
    -----> Go app detected
    -----> Installing Go 1.0.3... done
    Installing Virtualenv... done
    Installing Mercurial... done
    Installing Bazaar... done
    -----> Running: go get ./...
    package demoapp/models: unrecognized import path "demoapp/models"
    ! Heroku push rejected, failed to compile Go app

    To git@heroku.com:cryptic-bastion-6033.git
    ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'git@heroku.com:cryptic-bastion-6033.git'

    Best,
    -Eric
    On Sunday, November 25, 2012 12:32:31 PM UTC-8, Mark McGranaghan wrote:

    I'm glad to hear of the interest in Go on Heroku (:

    Does anyone have a self-contained, public repo that demonstrates this
    problem? This would be helpful in understanding and perhaps fixing this
    problem. For example:

    $ git clone ...
    $ cd ...
    $ heroku create test-go --buildpack
    https://github.com/kr/heroku-buildpack-go.git
    $ git push heroku master
    [error appears here]
    On Sunday, November 25, 2012 1:17:03 AM UTC-8, Johann Höchtl wrote:



    Am Freitag, 23. November 2012 16:36:15 UTC+1 schrieb ericc:
    Hey all,

    I ran into an issue a couple of days ago with the buildpack:
    https://github.com/kr/heroku-buildpack-go
    referenced in Mark McGranaghan's great tutorial on getting started with
    Go on heroku:
    http://mmcgrana.github.com/2012/09/getting-started-with-go-on-heroku.html
    Me interested too, bumping.

    Thanks,
    -Eric
    --
  • Ericc at Nov 29, 2012 at 5:37 pm
    Whoops there should be a
    $ cd heroku-go-buildpack-error
    after
    $ git clone https://github.com/econner/heroku-go-buildpack-error.git
    On Thursday, November 29, 2012 9:33:03 AM UTC-8, ericc wrote:

    Hey guys,

    Sorry for the delay. Here's a repo that shows the error along with steps
    to reproduce.

    $ git clone https://github.com/econner/heroku-go-buildpack-error.git
    $ export GOPATH=`pwd`
    $ export PATH=$PATH:$GOPATH/bin
    $ cd $GOPATH/src/demoapp
    $ go get
    $ demoapp
    Hello from main.
    Hello!
    $ cd $GOPATH
    $ heroku create -b https://github.com/kr/heroku-buildpack-go.git
    $ git push heroku master

    Counting objects: 36, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (24/24), done.
    Writing objects: 100% (36/36), 1.87 MiB | 666 KiB/s, done.
    Total 36 (delta 5), reused 0 (delta 0)

    -----> Heroku receiving push
    -----> Fetching custom git buildpack... done
    -----> Go app detected
    -----> Installing Go 1.0.3... done
    Installing Virtualenv... done
    Installing Mercurial... done
    Installing Bazaar... done
    -----> Running: go get ./...
    package demoapp/models: unrecognized import path "demoapp/models"
    ! Heroku push rejected, failed to compile Go app

    To git@heroku.com:cryptic-bastion-6033.git
    ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to
    'git@heroku.com:cryptic-bastion-6033.git'

    Best,
    -Eric
    On Sunday, November 25, 2012 12:32:31 PM UTC-8, Mark McGranaghan wrote:

    I'm glad to hear of the interest in Go on Heroku (:

    Does anyone have a self-contained, public repo that demonstrates this
    problem? This would be helpful in understanding and perhaps fixing this
    problem. For example:

    $ git clone ...
    $ cd ...
    $ heroku create test-go --buildpack
    https://github.com/kr/heroku-buildpack-go.git
    $ git push heroku master
    [error appears here]
    On Sunday, November 25, 2012 1:17:03 AM UTC-8, Johann Höchtl wrote:



    Am Freitag, 23. November 2012 16:36:15 UTC+1 schrieb ericc:
    Hey all,

    I ran into an issue a couple of days ago with the buildpack:
    https://github.com/kr/heroku-buildpack-go
    referenced in Mark McGranaghan's great tutorial on getting started with
    Go on heroku:

    http://mmcgrana.github.com/2012/09/getting-started-with-go-on-heroku.html
    Me interested too, bumping.

    Thanks,
    -Eric
    --
  • Simon Menke at Nov 30, 2012 at 12:28 pm
    You shouldn't include all the $GOPATH/* directories in your repo. Instead
    only add what's under $GOPATH/src/ (demoapp should be at the root of the
    repo).
    Here is an app which is deployed to
    Heroku https://github.com/fd/heroku-keepalive
    On Thursday, November 29, 2012 6:33:03 PM UTC+1, ericc wrote:

    Hey guys,

    Sorry for the delay. Here's a repo that shows the error along with steps
    to reproduce.

    $ git clone https://github.com/econner/heroku-go-buildpack-error.git
    $ export GOPATH=`pwd`
    $ export PATH=$PATH:$GOPATH/bin
    $ cd $GOPATH/src/demoapp
    $ go get
    $ demoapp
    Hello from main.
    Hello!
    $ cd $GOPATH
    $ heroku create -b https://github.com/kr/heroku-buildpack-go.git
    $ git push heroku master

    Counting objects: 36, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (24/24), done.
    Writing objects: 100% (36/36), 1.87 MiB | 666 KiB/s, done.
    Total 36 (delta 5), reused 0 (delta 0)

    -----> Heroku receiving push
    -----> Fetching custom git buildpack... done
    -----> Go app detected
    -----> Installing Go 1.0.3... done
    Installing Virtualenv... done
    Installing Mercurial... done
    Installing Bazaar... done
    -----> Running: go get ./...
    package demoapp/models: unrecognized import path "demoapp/models"
    ! Heroku push rejected, failed to compile Go app

    To git@heroku.com:cryptic-bastion-6033.git
    ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to
    'git@heroku.com:cryptic-bastion-6033.git'

    Best,
    -Eric
    On Sunday, November 25, 2012 12:32:31 PM UTC-8, Mark McGranaghan wrote:

    I'm glad to hear of the interest in Go on Heroku (:

    Does anyone have a self-contained, public repo that demonstrates this
    problem? This would be helpful in understanding and perhaps fixing this
    problem. For example:

    $ git clone ...
    $ cd ...
    $ heroku create test-go --buildpack
    https://github.com/kr/heroku-buildpack-go.git
    $ git push heroku master
    [error appears here]
    On Sunday, November 25, 2012 1:17:03 AM UTC-8, Johann Höchtl wrote:



    Am Freitag, 23. November 2012 16:36:15 UTC+1 schrieb ericc:
    Hey all,

    I ran into an issue a couple of days ago with the buildpack:
    https://github.com/kr/heroku-buildpack-go
    referenced in Mark McGranaghan's great tutorial on getting started with
    Go on heroku:

    http://mmcgrana.github.com/2012/09/getting-started-with-go-on-heroku.html
    Me interested too, bumping.

    Thanks,
    -Eric
    --
  • Ericwconner at Dec 1, 2012 at 6:32 am
    Ah. Thanks, that makes a lot of sense.
    On Friday, November 30, 2012 4:28:20 AM UTC-8, Simon Menke wrote:

    You shouldn't include all the $GOPATH/* directories in your repo. Instead
    only add what's under $GOPATH/src/ (demoapp should be at the root of the
    repo).
    Here is an app which is deployed to Heroku
    https://github.com/fd/heroku-keepalive
    On Thursday, November 29, 2012 6:33:03 PM UTC+1, ericc wrote:

    Hey guys,

    Sorry for the delay. Here's a repo that shows the error along with steps
    to reproduce.

    $ git clone https://github.com/econner/heroku-go-buildpack-error.git
    $ export GOPATH=`pwd`
    $ export PATH=$PATH:$GOPATH/bin
    $ cd $GOPATH/src/demoapp
    $ go get
    $ demoapp
    Hello from main.
    Hello!
    $ cd $GOPATH
    $ heroku create -b https://github.com/kr/heroku-buildpack-go.git
    $ git push heroku master

    Counting objects: 36, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (24/24), done.
    Writing objects: 100% (36/36), 1.87 MiB | 666 KiB/s, done.
    Total 36 (delta 5), reused 0 (delta 0)

    -----> Heroku receiving push
    -----> Fetching custom git buildpack... done
    -----> Go app detected
    -----> Installing Go 1.0.3... done
    Installing Virtualenv... done
    Installing Mercurial... done
    Installing Bazaar... done
    -----> Running: go get ./...
    package demoapp/models: unrecognized import path "demoapp/models"
    ! Heroku push rejected, failed to compile Go app

    To git@heroku.com:cryptic-bastion-6033.git
    ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to
    'git@heroku.com:cryptic-bastion-6033.git'

    Best,
    -Eric
    On Sunday, November 25, 2012 12:32:31 PM UTC-8, Mark McGranaghan wrote:

    I'm glad to hear of the interest in Go on Heroku (:

    Does anyone have a self-contained, public repo that demonstrates this
    problem? This would be helpful in understanding and perhaps fixing this
    problem. For example:

    $ git clone ...
    $ cd ...
    $ heroku create test-go --buildpack
    https://github.com/kr/heroku-buildpack-go.git
    $ git push heroku master
    [error appears here]
    On Sunday, November 25, 2012 1:17:03 AM UTC-8, Johann Höchtl wrote:



    Am Freitag, 23. November 2012 16:36:15 UTC+1 schrieb ericc:
    Hey all,

    I ran into an issue a couple of days ago with the buildpack:
    https://github.com/kr/heroku-buildpack-go
    referenced in Mark McGranaghan's great tutorial on getting started
    with Go on heroku:

    http://mmcgrana.github.com/2012/09/getting-started-with-go-on-heroku.html
    Me interested too, bumping.

    Thanks,
    -Eric
    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 24, '12 at 1:30a
activeDec 1, '12 at 6:32a
posts7
users5
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase