Fork me on GitHub
#juxt
<
2017-08-18
>
steveb8n07:08:10

Hi team, I’ve started testing Roll with Jons help and have reached a blocker (I think). Can someone point me in the right direction?

steveb8n07:08:29

to sanity check mach/roll I first ran “mach info” and that was fine. Then I ran “mach roll-info” based on seeing that in the machfile, and then I see…

steveb8n07:08:50

➜ edge git:(master) ✗ mach roll-info $ git describe --dirty --long --tags --match [0-9]* 0.0.1-66-g054ed48-dirty Error whilst performing shell command.

steveb8n07:08:32

am I on the right track or is this something that needs debugging. BTW I’m in no hurry on this but grateful for any help

jonpither07:08:31

What is the error?

jonpither07:08:32

That git output line is normal

steveb8n07:08:18

more context. mach uberjar works fine

steveb8n07:08:31

this is all within the edge project BTW

steveb8n07:08:47

no modifications except changing my own AWS ids

steveb8n07:08:45

but “mach tfjson” fails with same as “mach roll-info”

steveb8n07:08:55

i.e. Error whilst performing shell command.

steveb8n07:08:27

I’m wondering if there is a verbose/debug mode for mach that will tell us more?

dominicm08:08:29

@steveb8n just to check (coming into this late), are you on master of mach?

steveb8n08:08:41

@dominicm I installed yesterday using “sudo npm install -g @juxt/mach” so I presume yes

steveb8n08:08:51

how can I tell from an npm install?

dominicm08:08:45

d/w, you're probably up to date. I thought edge was more experimental than it is. So all is good there.

dominicm08:08:14

@steveb8n

~/src/github.com/juxt/edge master*
❯ mach roll-info 
$ git describe --dirty --long --tags --match [0-9]*
0.0.1-66-g054ed48

evalmachine.<anonymous>:98
throw ex;
^

Error: Error whilst performing shell command.
    at roll$core$sh (evalmachine.<anonymous>:171:8)
    at roll$core$resolve_region (evalmachine.<anonymous>:235:122)
    at evalmachine.<anonymous>:526:42
    at cljs.core.PersistentVector.cljs$core$IReduce$_reduce$arity$3 (<embedded>:1106:284)
    at Function.cljs.core.reduce.cljs$core$IFn$_invoke$arity$3 (<embedded>:577:181)
    at cljs.core.reduce (<embedded>:574:174)
    at Function.roll.core.preprocess.cljs$core$IFn$_invoke$arity$variadic (evalmachine.<anonymous>:524:35)
    at roll$core$preprocess (evalmachine.<anonymous>:500:29)
    at evalmachine.<anonymous>:47:36
    at evalmachine.<anonymous>:70:43
Is this your full error? ^^

steveb8n08:08:14

no, I just get the Error msg. I’ll paste exact….

steveb8n08:08:34

➜ edge git:(master) ✗ mach roll-info $ git describe --dirty --long --tags --match [0-9]* 0.0.1-66-g054ed48-dirty Error whilst performing shell command. ➜ edge git:(master) ✗

dominicm08:08:11

Odd that you don't get a stack, but it's the same error I think 🙂. I wondered if you were cutting it off.

dominicm08:08:18

I can improve that error message I think, one sec.

steveb8n08:08:04

odd indeed 🙂 holding…

dominicm08:08:00

@steveb8n https://github.com/SevereOverfl0w/roll/tree/sherrormsg can you try this branch/fork? Just:

git clone 
cd roll
git checkout sherrormsg
lein install
then try run mach roll-info from edge again

steveb8n08:08:40

➜ edge git:(master) ✗ mach roll-info $ git describe --dirty --long --tags --match [0-9]* 0.0.1-66-g054ed48-dirty Error whilst performing shell command: [“aws” “configure” “get” “region”] ➜ edge git:(master) ✗

steveb8n08:08:06

can I try that aws cli command on it’s own?

steveb8n08:08:17

maybe a problem with my awscli

dominicm08:08:41

@steveb8n pro-tip: AWS_PROFILE=profilenameforaws aws configure get region

steveb8n08:08:41

bear with me, need to swot up on awscli

dominicm08:08:30

https://github.com/juxt/edge/blob/054ed4879ba113ca3e52a732cb648e24ddc66921/resources/config.edn#L36 you can change this line to be your expected AWS profile for people if you don't want to use environment variable. You can cat ~/.aws/credentials to figure out which profiles you have.

jonpither08:08:11

Ah. Ensure u have a default aws region set in your aws cli setup

jonpither08:08:57

Or a region set for the profile u are using

dominicm08:08:03

@jonpither https://github.com/SevereOverfl0w/roll/commit/ddd5471d1581f7afa11952a825d3aeb4a3f9663b here's my patch, it's a bit crap because it just prints out the vector. You might want to do something a bit fancier similar to mach.

steveb8n08:08:00

ok, that was it. I had no default region configured for the cli

steveb8n08:08:05

now getting Error whilst performing shell command: [“aws” “s3api” “head-object” “--bucket” “roll-deployment-artifacts” “--key” “”]

steveb8n08:08:24

but I suspect I need to follow the edge script a little further

steveb8n08:08:04

that’s my bucket name but it looks like I need a key somewhere

steveb8n08:08:19

either way, might be worth handling empty region in roll mach script for future noobs

dominicm08:08:45

@steveb8n I did the same thing 😉 Repeatedly. Agree with what you're saying.

dominicm08:08:58

https://github.com/juxt/edge/blob/054ed4879ba113ca3e52a732cb648e24ddc66921/resources/config.edn#L57 I think this is the key, or supposed to be. Haven't followed the code fully yet, but you might know what's wrong already based on that line

dominicm08:08:53

@steveb8n Did you set AWS_PROFILE or did you make your profile the default one?

steveb8n09:08:17

I just used “aws configure”

dominicm09:08:19

https://github.com/juxt/edge/blob/054ed4879ba113ca3e52a732cb648e24ddc66921/resources/config.edn#L36 roll needs this key set, you can change it to #or [#env AWS_PROFILE "default"]. Uncertain whether making default the default is a good idea rn, but under consideration.

steveb8n09:08:55

roger that, trying now

dominicm09:08:21

(it probably is a good idea, I just have no idea how people use awscli in practice, I use it by not using it and just having the config file saying it's there.)

steveb8n09:08:05

Error whilst performing shell command: [“aws” “s3api” “head-object” “--bucket” “roll-deployment-artifacts” “--key” “” “--profile” “default”]

steveb8n09:08:14

still missing a “key” somewhere

dominicm09:08:46

yeah, looks like I was wrong :thinking_face:

dominicm09:08:54

You know what, this might be normal.

dominicm09:08:05

Do you have any artifacts released?

dominicm09:08:52

Try mach upload first @steveb8n

steveb8n09:08:46

that worked. apparently I need to RTFM

dominicm09:08:06

I didn't know there was a manual, I'm reading the source code 😜

steveb8n09:08:31

tfjson now works as well

dominicm09:08:34

problem was that it tries to resolve latest artifact (of which there was none), and tries to continue.

dominicm09:08:39

Gonna open issue on roll for this stuff

steveb8n09:08:57

cool. good to avoid this in future

dominicm09:08:38

Feel free to @ me if you have any more problems. I've opened issues on github.

steveb8n09:08:15

will do, thanks. It’s dinner time so I’ll stop for now.

steveb8n09:08:31

I’ll update with progress when I resume

steveb8n09:08:46

have a good Friday