Unable to do initial build in tutorial

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

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]

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

Hello -

Following up, I pushed a fix out to habitat.sh, but it may take a bit for the Fastly cache to reflect the latest.

Cheers -
Dave

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/

[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’ 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

Resolving s3-us-west-2.amazonaws.com (s3-us-west-2.amazonaws.com)… 54.231.169.68
Connecting to s3-us-west-2.amazonaws.com (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

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

Humble thanks…typo in my plan.sh

no problem, happy to help :smile:, feel free to join us on http://slack.habitat.sh/ for more discussion.

Cheers -
Dave

Hi,
(initially tried to send to 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 :blush:)

Ref: Unable to do initial build in tutorial

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

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 appears to be a long standing problem.