# Unable to do initial build in tutorial

**URL:** https://discourse.chef.io/t/unable-to-do-initial-build-in-tutorial/12205
**Category:** Chef Habitat
**Created:** [August 22, 2016, 9:10pm UTC](https://discourse.chef.io/t/unable-to-do-initial-build-in-tutorial/12205 "2016-08-22T21:10:58Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![samichel](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@samichel](https://discourse.chef.io/u/samichel)
#### Post date: [August 22, 2016, 9:10pm UTC](https://discourse.chef.io/t/unable-to-do-initial-build-in-tutorial/12205/1 "2016-08-22T21:10:58Z")

</div>

I noticed this inconsistency in the web page…is this related to the error ?

[https://www.habitat.sh/tutorials/getting-started-create-plan/](https://www.habitat.sh/tutorials/getting-started-create-plan/)  
pkg\_shasum=e4e988d9216775a4efa4f4304595d7ff31bdc0276d5b7198ad6166e13630aaa9  
then later  
pkg\_shasum=b54f8ada292b0249245385996221751f571e170162e0d464a26b958478cc9bfa

[vagrant@default-centos-71 mytutorialapp] sudo hab studio enter sudo: hab: command not found [vagrant@default-centos-71 mytutorialapp] which hab  
~/bin/hab  
[vagrant@default-centos-71 mytutorialapp]$ hab studio enter  
? Package for core/hab-studio not found, installing  
» Installing core/hab-studio  
↓ Downloading core/hab-studio/0.9.0/20160815225526  
1.71 KB / 2.78 MB | [\>-----------------------------------------------------------------------------------] 0.06 % 78.90 MB/s 0s  
[snip]  
↓ Downloading core-20160810182414 public origin key  
75 B / 75 B | [===========================================================================================] 100.00 % 3.08 MB/s

? Cached core-20160810182414 public origin key  
???  
??? Can’t create ‘/hab/pkgs/core/hab-studio/0.9.0/20160815225526’ (libarchive err\_code=2)  
???  
[vagrant@default-centos-71 mytutorialapp] which sudo /usr/bin/sudo [vagrant@default-centos-71 mytutorialapp] sudo hab studio enter  
sudo: hab: command not found  
[vagrant@default-centos-71 mytutorialapp] which hab ~/bin/hab [vagrant@default-centos-71 mytutorialapp] echo PATH /usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/devop-tools/bin:/scratch/dms/data/admin:/home/vagrant/.local/bin:/home/vagrant/bin [vagrant@default-centos-71 mytutorialapp]

---

<div class="post-metadata">

### Author: ![metadave](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/metadave/32/1136_2.png) [@metadave](https://discourse.chef.io/u/metadave)
#### Post date: [August 22, 2016, 9:33pm UTC](https://discourse.chef.io/t/unable-to-do-initial-build-in-tutorial/12205/2 "2016-08-22T21:33:24Z")

</div>

Hi - sorry you’re having trouble with the tutorial. I updated it last week, and indeed, missed the second `pkg_shasum` value. The correct value should be:

```
    e4e988d9216775a4efa4f4304595d7ff31bdc0276d5b7198ad6166e13630aaa9

```

I’ll get that fixed shortly.

When running via sudo, you’ll need to make sure the path is correct for `root`, I don’t believe it’s carried over by default w/ sudo.

```
 sudo env "PATH=$PATH" hab studio enter

```

If you’re not running as root, the `/hab` path must exist and be writable by the current user.

Cheers -  
Dave

---

<div class="post-metadata">

### Author: ![metadave](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/metadave/32/1136_2.png) [@metadave](https://discourse.chef.io/u/metadave)
#### Post date: [August 22, 2016, 10:01pm UTC](https://discourse.chef.io/t/unable-to-do-initial-build-in-tutorial/12205/3 "2016-08-22T22:01:53Z")

</div>

Hello -

Following up, I [pushed a fix](https://github.com/habitat-sh/habitat/pull/1181) out to [habitat.sh](http://habitat.sh), but it may take a bit for the Fastly cache to reflect the latest.

Cheers -  
Dave

---

<div class="post-metadata">

### Author: ![samichel](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@samichel](https://discourse.chef.io/u/samichel)
#### Post date: [August 23, 2016, 2:39pm UTC](https://discourse.chef.io/t/unable-to-do-initial-build-in-tutorial/12205/4 "2016-08-23T14:39:31Z")

</div>

Thanks for the quick reply, fix, and explanation.  
Got past that.  
Hit another problem, Googled to get past that. But now hit a connection 404 error…

[1][default:/src:0]# build  
: Loading /src/plan.sh  
mytotorialapp: Plan loaded  
mytotorialapp: hab-plan-build setup  
ERROR: Signing origin key  
’myorigin’ not found in /hab/cache/keys, aborting

Hit another hiccup trying to follow the tutorial.  
Googled for a solution and found this:  
[https://www.habitat.sh/docs/create-packages-build/](https://www.habitat.sh/docs/create-packages-build/)

[1][default:/src:0]#  
echo $HAB\_ORIGIN

[2][default:/src:0]#  
hab origin key generate originname  
» Generating origin key for originname  
? Generated origin key pair originname-20160823141029.

[3][default:/src:0]#  
hab origin key generate myorigin  
» Generating origin key for myorigin  
? Generated origin key pair myorigin-20160823141040.

[4][default:/src:0]#  
ls -l /hab/cache/keys  
total 24  
-rw-r–r--1 root root 75 Aug 23 11:31 core-20160612031944.pub  
-rw-r–r--1 root root 75 Aug 23 11:31 core-20160810182414.pub  
-r--------1 root root 79 Aug 23 14:10 myorigin-20160823141040.pub  
-r--------1 root root 123 Aug 23 14:10 myorigin-20160823141040.sig.key  
-r--------1 root root 81 Aug 23 14:10 originname-20160823141029.pub  
-r--------1 root root 125 Aug 23 14:10 originname-20160823141029.sig.key

[5][default:/src:0]# build  
: Loading /src/plan.sh  
mytotorialapp: Plan loaded  
mytotorialapp: hab-plan-build setup  
mytotorialapp: Using  
HAB\_BIN=/hab/pkgs/core/hab/0.9.0/20160815225003/bin/hab for installs, signing, and hashing  
mytotorialapp: Resolving dependencies

» Installing core/node  
↓ Downloading core/node/4.2.6/20160729200209

1.73 KB / 6.32 MB | [\>-----------------------------------------------------------------------------------] 0.03 % 75.71 MB/s 0s

[snip] (skipping several screens of output)

mkdir: created directory ‘/hab/cache/src’  
mytotorialapp: Downloading  
’[https://s3-us-west-2.amazonaws.com/mytotorialapp/mytotorialapp-0.2.0.tar.gz](https://s3-us-west-2.amazonaws.com/mytotorialapp/mytotorialapp-0.2.0.tar.gz)’ to ‘mytotorialapp-0.2.0.tar.gz’  
–2016-08-23 14:11:21–[https://s3-us-west-2.amazonaws.com/mytotorialapp/mytotorialapp-0.2.0.tar.gz](https://s3-us-west-2.amazonaws.com/mytotorialapp/mytotorialapp-0.2.0.tar.gz)

Resolving [s3-us-west-2.amazonaws.com](http://s3-us-west-2.amazonaws.com) ([s3-us-west-2.amazonaws.com](http://s3-us-west-2.amazonaws.com))… 54.231.169.68  
Connecting to [s3-us-west-2.amazonaws.com](http://s3-us-west-2.amazonaws.com) ([s3-us-west-2.amazonaws.com](http://s3-us-west-2.amazonaws.com))|54.231.169.68|:443… connected.  
HTTP request sent, awaiting response… 404 Not Found  
2016-08-23 14:11:22 ERROR 404: Not Found.

mytotorialapp: Build time: 0m5s  
mytotorialapp: Exiting on error  
[6][default:/src:8]#

Any help would be much appreciated.

Thanks

---

<div class="post-metadata">

### Author: ![metadave](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/metadave/32/1136_2.png) [@metadave](https://discourse.chef.io/u/metadave)
#### Post date: [August 23, 2016, 3:45pm UTC](https://discourse.chef.io/t/unable-to-do-initial-build-in-tutorial/12205/5 "2016-08-23T15:45:56Z")

</div>

There are 2 typos in the URL:

“mytotorialapp” appears twice (notice the `tot`):

```
    https://s3-us-west-2.amazonaws.com/mytotorialapp/mytotorialapp-0.2.0.tar.gz

```

it should be:

```
    https://s3-us-west-2.amazonaws.com/mytutorialapp/mytutorialapp-0.2.0.tar.gz

```

Cheers -  
Dave

---

<div class="post-metadata">

### Author: ![samichel](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@samichel](https://discourse.chef.io/u/samichel)
#### Post date: [August 23, 2016, 4:14pm UTC](https://discourse.chef.io/t/unable-to-do-initial-build-in-tutorial/12205/6 "2016-08-23T16:14:48Z")

</div>

Humble thanks…typo in my [plan.sh](http://plan.sh)

---

<div class="post-metadata">

### Author: ![metadave](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/metadave/32/1136_2.png) [@metadave](https://discourse.chef.io/u/metadave)
#### Post date: [August 23, 2016, 4:32pm UTC](https://discourse.chef.io/t/unable-to-do-initial-build-in-tutorial/12205/7 "2016-08-23T16:32:29Z")

</div>

no problem, happy to help 😄, feel free to join us on [http://slack.habitat.sh/](http://slack.habitat.sh/) for more discussion.

Cheers -  
Dave

---

<div class="post-metadata">

### Author: ![samichel](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@samichel](https://discourse.chef.io/u/samichel)
#### Post date: [August 25, 2016, 12:44pm UTC](https://discourse.chef.io/t/unable-to-do-initial-build-in-tutorial/12205/8 "2016-08-25T12:44:32Z")

</div>

Hi,  
(initially tried to send to [feedback@slack.com](mailto:feedback@slack.com) and signed up there as you suggested,  
but thought it was misdirected…so I’m continuing this thread in hopes you can get me through it 😊)

Ref: [https://discourse.chef.io/t/unable-to-do-initial-build-in-tutorial/167/5](https://discourse.chef.io/t/unable-to-do-initial-build-in-tutorial/167/5)

Finally got to the last step in the tutorial, but it failed.  
Any clues what could be missing ?

Step 8 : CMD start myorigin/mytutorialapp  
—\> Running in 88e9ad296a7e  
—\> b7043e6a786a  
Removing intermediate container 88e9ad296a7e  
Successfully built b7043e6a786a  
[3][default:/src:0]# exit  
logout  
[vagrant@default-centos-71 mytutorialapp] docker run -it -p 8080:8080 myorigin/mytutorialapp docker: Error response from daemon: driver failed programming external connectivity on endpoint admiring\_galileo (8deb028385cb0d8794 75947e53b940a59098c63e8e3a1e8199b949fdef4573ab): Error starting userland proxy: listen tcp 0.0.0.0:8080: bind: address already in use. [vagrant@default-centos-71 mytutorialapp]

Thanks

---

<div class="post-metadata">

### Author: ![samichel](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@samichel](https://discourse.chef.io/u/samichel)
#### Post date: [August 25, 2016, 3:12pm UTC](https://discourse.chef.io/t/unable-to-do-initial-build-in-tutorial/12205/9 "2016-08-25T15:12:52Z")

</div>

I tried a couple more times…its referencing a different host each time, but yielding the same error that port 8080 is in use.  
But it is not in use locally.

[vagrant@default-centos-71  
mytutorialapp]$ docker run -it -p 8080:8080 myorigin/mytutorialapp

docker:  
Error response from daemon: driver failed programming external connectivity on  
endpoint agitated\_hodgkin (6cbaf0686292738a90

cc35d192115885b8b48d5f1c31a3529ebf62672e34eaac):  
Error starting userland proxy: listen tcp 0.0.0.0:8080: bind: address already  
in use.

[vagrant@default-centos-71  
mytutorialapp]$ docker run -it -p 8080:8080 myorigin/mytutorialapp

docker:  
Error response from daemon: driver failed programming external connectivity on  
endpoint furious\_panini (57fc3f69e45ca509aba0

cb3857a9aed2c7fcd382fda4e77823884ede3139dc8a):  
Error starting userland proxy: listen tcp 0.0.0.0:8080: bind: address already  
in use.

[vagrant@default-centos-71  
mytutorialapp]$ netstat | grep 8080

I found this: [https://github.com/docker/docker/issues/8714](https://github.com/docker/docker/issues/8714) appears to be a long standing problem.
