-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support: Example not working #145
Comments
Hi @alvaroloes - couple of questions/debugging tips:
Thanks and apologies for the inconvenience. We'll get it sorted out :) |
Hi Matt! Thanks for the response. These are the answers so far:
It is really just the example. Here the main.go file: package main
import (
"context"
sparta "github.com/mweagle/Sparta"
)
// Standard AWS λ function
func helloWorld(ctx context.Context) (string, error) {
return "Hello World!", nil
}
func main() {
var lambdaFunctions []*sparta.LambdaAWSInfo
helloWorldFn, _ := sparta.NewAWSLambda("Hello World",
helloWorld,
sparta.IAMRoleDefinition{})
lambdaFunctions = append(lambdaFunctions, helloWorldFn)
sparta.Main("SpartaStudyStack",
"Simple Sparta application that demonstrates core functionality",
lambdaFunctions,
nil,
nil)
} And here is the module serverless-panda
go 1.12
replace github.com/AlecAivazis/survey => gopkg.in/AlecAivazis/survey.v1 v1.8.4
replace gopkg.in/AlecAivazis/survey.v1 => github.com/AlecAivazis/survey v1.8.4
require (
github.com/AlecAivazis/survey v1.8.4 // indirect
github.com/aws/aws-lambda-go v1.10.0 // indirect
github.com/aws/aws-sdk-go v1.19.35 // indirect
github.com/briandowns/spinner v0.0.0-20190319032542-ac46072a5a91 // indirect
github.com/deckarep/golang-set v1.7.1 // indirect
github.com/dsnet/compress v0.0.1 // indirect
github.com/dustin/go-broadcast v0.0.0-20171205050544-f664265f5a66 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/fatih/color v1.7.0 // indirect
github.com/go-playground/locales v0.12.1 // indirect
github.com/go-playground/universal-translator v0.16.0 // indirect
github.com/golang/snappy v0.0.1 // indirect
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f // indirect
github.com/hokaccha/go-prettyjson v0.0.0-20180920040306-f579f869bbfe // indirect
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6 // indirect
github.com/leodido/go-urn v1.1.0 // indirect
github.com/magefile/mage v1.8.0 // indirect
github.com/mholt/archiver v3.1.1+incompatible // indirect
github.com/mweagle/Sparta v1.7.3
github.com/mweagle/go-cloudcondenser v0.0.0-20180209031108-e1ad78f4b780 // indirect
github.com/mweagle/go-cloudformation v0.0.0-20190424023355-c4621507eecb // indirect
github.com/nwaples/rardecode v1.0.0 // indirect
github.com/otiai10/copy v1.0.1 // indirect
github.com/otiai10/curr v0.0.0-20190513014714-f5a3d24e5776 // indirect
github.com/pierrec/lz4 v2.0.5+incompatible // indirect
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 // indirect
github.com/pkg/errors v0.8.1 // indirect
github.com/rivo/tview v0.0.0-20190515161233-bd836ef13b4b // indirect
github.com/sirupsen/logrus v1.4.2 // indirect
github.com/spf13/cobra v0.0.4 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/zcalusic/sysinfo v0.0.0-20190429151633-fbadb57345c2 // indirect
golang.org/x/net v0.0.0-20190520210107-018c4d40a106 // indirect
gopkg.in/AlecAivazis/survey.v1 v1.8.4 // indirect
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
gopkg.in/go-playground/validator.v9 v9.28.0 // indirect
) There are no more files in the project.
I will try this! Finally, I know how to get more logging. The absence of the reason for the crash was driving me nuts.
Mac OS Mojave
Yes, but the sample payload is the dummy "HelloWorld" one provided by AWS. Anyway, this should not affect because the function is no using it, shouldn't it? Will try the |
🤔 Ok the command How can I provision in such a way that I get some debug logs of the Sparta code that is executed before my actual lambda code? It seems that it is crashing before reaching the |
Ugh - that's a bug :( Is there en |
Yeah! As you can see in the images above, that log level is set to DEBUG, but it seems that it is not affecting the number of logs logged in CloudWatch. There must be something trivial that I'm not seeing |
k - I clearly broke something along the way. In the short term, change https://github.com/mweagle/Sparta/blob/master/sparta_main_awsbinary.go#L57 to use |
Ok. I'll change it and let you know. I might take some hours because I need to leave now. Thanks for the help! |
@mweagle I changed that and no new logs appeared and I got the same behavior.
Between the I have tried to follow the code but I'm still a bit lost. |
k - I can reproduce and am looking... |
And found it... The recent Linux update is causing platformLogSysInfo to panic when calling github.com/zcalusic/sysinfo. In the short term, if you comment out the call site here things should be back on track while I work on a better solution. Please LMK. Thanks! |
YES!! It is working finally! I had already lost all hope. Thanks a lot, @mweagle! I'll keep testing the framework 😉 |
Resolved with v1.9.3. Apologies for the inconvenience. |
I have tried everything to make the example work with no luck. Everything gets correctly deployed to AWS, but when I hit "Test" the Lambda function just crashes with no information about why.
The code is the one in the example and, in case it helps, here are the ClourWatch logs produced:
I have checked everything (timeouts, memory, changed the signature of the Go function for the lambda, etc) but I always get the same result.
Could you please let me know what's wrong? Thanks!
The text was updated successfully, but these errors were encountered: