jeremyrickard / do-porter

MIT License
18 stars 7 forks source link

Current version doesn't work as docked, or docs unclear #2

Open squillace opened 5 years ago

squillace commented 5 years ago

The README doesn't describe a working process, and the steps for the creds may be unclear, but here's the error when I pull it and try to install it after cloning and then generating a cred from the bundle in MASTER, as below.

My current guess is that I'm munging the concepts of the "do access key" -- for which I apparently only pass the name? in addition, the current porter.yaml file has this:

--host-bucket=%(bucket)s.{{bundle.parameters.region}}.digitaloceanspaces.com"

Um, don't we mean to escape the "bucket)s" part?

 πŸ”‹ 44% (1:50) ξ‚° porter install --tag jeremyrickard/porter-do-bundle:v0.3.10 -c spring-music --param space_name=cnab --param namespace=cnab                                        ξ‚² 1 ↡ ξ‚² 9011 ξ‚² 09:54:50
installing spring-music...
executing install action from spring-music (bundle instance: spring-music) defined in /cnab/app/porter.yaml
s3cmd create bucket
ERROR: S3 error: 400 (InvalidRequest): Malformed request
Error: error running command /usr/bin/s3cmd s3cmd mb s3://******* --access_key=*******-storage --secret_key=******* --host=nyc3.digitaloceanspaces.com --host-bucket=%(bucket)s.nyc3.digitaloceanspaces.com: exit status 11
err: error running command /usr/bin/s3cmd s3cmd mb s3://******* --access_key=*******-storage --secret_key=******* --host=nyc3.digitaloceanspaces.com --host-bucket=%(bucket)s.nyc3.digitaloceanspaces.com: exit status 11
Error: mixin execution failed: exit status 1
Error: failed to install the bundle: container exit code: 1, message: <nil>

and if I build it from scratch, and THEN install:

 πŸ”‹ 42% (1:47) ξ‚° porter install spring-music -c spring-music --param space_name=cnab --param namespace=cnab                                                                          ξ‚² βœ” ξ‚² 9016 ξ‚² 09:58:46
installing spring-music...
executing install action from spring-music (bundle instance: spring-music) defined in /cnab/app/porter.yaml
s3cmd create bucket
ERROR: S3 error: 400 (InvalidRequest): Malformed request
err: error running command /usr/bin/s3cmd s3cmd mb s3://******* --access_key=*******-storage --secret_key=******* --host=nyc3.digitaloceanspaces.com --host-bucket=%(bucket)s.nyc3.digitaloceanspaces.com: exit status 11
Error: error running command /usr/bin/s3cmd s3cmd mb s3://******* --access_key=*******-storage --secret_key=******* --host=nyc3.digitaloceanspaces.com --host-bucket=%(bucket)s.nyc3.digitaloceanspaces.com: exit status 11
Error: mixin execution failed: exit status 1
Error: failed to install the bundle: container exit code: 1, message: <nil>
squillace commented 5 years ago

and the --debug enabled:

 πŸ”‹ 32% (2:06) ξ‚° porter install spring-music -c spring-music --param space_name=cnab --param namespace=cnab --debug                                                                ξ‚² 1 ↡ ξ‚² 9021 ξ‚² 10:26:12
installing spring-music...
installing bundle spring-music (.cnab/bundle.json) as spring-music
    params: [helm_release namespace node_count porter-debug region space_name database_name]
    creds: [do_spaces_secret kubeconfig do_access_token do_spaces_key]
DEBUG: defaulting debug to PORTER_DEBUG (true)
DEBUG: defaulting action to CNAB_ACTION (install)
executing install action from spring-music (bundle instance: spring-music) defined in /cnab/app/porter.yaml
s3cmd create bucket
DEBUG mixin:    exec
DEBUG mixinDir: /*******/app/mixins/exec
DEBUG file:
DEBUG stdin:
install:
- exec:
    arguments:
    - mb
    - s3://*******
    - --access_key=*******-storage
    - --secret_key=*******
    - --host=nyc3.digitaloceanspaces.com
    - --host-bucket=*******.nyc3.digitaloceanspaces.com
    command: s3cmd
    description: s3cmd create bucket

/*******/app/mixins/exec/exec-runtime /*******/app/mixins/exec/exec-runtime install --debug
DEBUG Parsed Input:
&exec.Action{Steps:[]exec.Step{exec.Step{Instruction:exec.Instruction{Description:"s3cmd create bucket", Command:"s3cmd", Arguments:[]string{"mb", "s3://*******", "--access_key=*******-storage", "--secret_key=*******", "--host=nyc3.digitaloceanspaces.com", "--host-bucket=*******.nyc3.digitaloceanspaces.com"}, Flags:builder.Flags(nil), Outputs:[]exec.Output(nil)}}}}
/usr/bin/s3cmd s3cmd mb s3://******* --access_key=*******-storage --secret_key=******* --host=nyc3.digitaloceanspaces.com --host-bucket=*******.nyc3.digitaloceanspaces.com
ERROR: S3 error: 400 (InvalidRequest): Malformed request
squillace commented 5 years ago

that's after repairing the strange (bundle)s. string in porter and then running it from source.

jeremyrickard commented 5 years ago

Yeah, I have a README update to push. Apologies, I haven’t had a chance to do that given everything else I’ve been trying to pull together

jeremyrickard commented 5 years ago

@squillace you shouldn't need to change anything with:

 - "--host-bucket=%(bucket)s.{{bundle.parameters.region}}.digitaloceanspaces.com"

That is indeed the strange format (where we are just replacing the region.

I believe your error is related to credentials. I've updated the README.md, please give that a look and see if it is any clearer.