mweagle / Sparta

go microservices, powered by AWS Lambda
https://gosparta.io
MIT License
716 stars 48 forks source link

"Unknown Validator matches" error trying to run "provision" #17

Closed ryanwalls closed 8 years ago

ryanwalls commented 8 years ago

Not sure if the format of the s3 bucket name is the cause... but getting this error with a bucket name like "3dsim-infrastructure-configuration".

ryanwalls commented 8 years ago

Correction... happens with any bucket name I try. Trying to run the "hello world" example from the readme.

This also does not work threedsimlambda.

ryanwalls commented 8 years ago

When I run with debug flag, I get this output:

Ryans-MacBook-Pro:payment-processor ryan$ go run main.go provision -s threedsimlambda --noop -l debug
INFO[0000] Welcome to MyHelloWorldStack                  Go=go1.7 Option=provision SpartaVersion=0.8.0 UTC=2016-09-06T13:14:45Z
DEBU[0000] Provision Validation                          optionsProvision={S3Bucket:threedsimlambda BuildID:} validateErr=S3Bucket: Unknown Validator matches(\w+); validationResults=false
Error: S3Bucket: Unknown Validator matches(\w+);
Usage:
  main provision [flags]

Flags:
  -i, --buildID string    Optional BuildID to use
  -s, --s3Bucket string   S3 Bucket to use for Lambda source

Global Flags:
  -l, --level string   Log level [panic, fatal, error, warn, info, debug] (default "info")
  -n, --noop           Dry-run behavior only (do not perform mutations)

ERRO[0000] S3Bucket: Unknown Validator matches(\w+); 
ryanwalls commented 8 years ago

Just realized there was a closed issue for this #11

mweagle commented 8 years ago

No worries - thanks for the details. I'll take a look.

mweagle commented 8 years ago

HI @ryanwalls - this incorrect error is coming from https://github.com/asaskevich/govalidator. Do you have the latest version of this package? I go getd both that and https://github.com/spf13/cobra and am unable to reproduce even with the short flags. I'll keep investigating & appreciate the details.

ryanwalls commented 8 years ago

@mweagle I use https://github.com/Masterminds/glide to manage my dependencies. It pulls in the latest "release" versions of the libraries for transitive dependencies... so it pulled in the v4 tag (commit 7664702). But apparently that release version is causing the problem, because when I updated to the latest commit, the problem went away.

Perhaps one change you could make would be to use Glide or Godeps to explicitly list sparta's transitive dependencies?

mweagle commented 8 years ago

Good to hear that resolves the issue.

Perhaps one change you could make would be to use Glide or Godeps to explicitly list sparta's transitive dependencies?

Agreed - I've been deliberately holding off committing to a package manager, but will have to reconsider that. Filed as: https://github.com/mweagle/Sparta/issues/18