beta 1.0
windows
After integrating Api getaway and lambda on Amazon console(Lambda tab) I see error lile "Could not list api-gateway event sources."
My yaml file:
Functions:
lambdaFunction:
handler: com.myHandler.DataExtractorLambda
events:
- schedule: cron(0/1 * * * ? *)
- http:
path: publicGetaway/getResources
method: get
Note: Schedule trigger is available for editing and works fine.
@olegZastavnyi thanks for reporting!
Could you provide the indentation of your serverless.yml
file as wrong indentation might lead to the fact that events are not parsed how they should be?
@pmuens Any idea what is wrong ?
@olegZastavnyi could you post a screenshot of you serverless.yml
file so that I can see how it is indented? --> Edit: Just saw the test.txt
file. Thanks for that. The serverless.yml
file seems to be correct.
Have you looked in the API Gateway service section on AWS if the gateway is deployed there?
@pmuens Yes, it present and works but I cant see it on lambda( see screen)
Faced something similar with other AWS resources. Might be an AWS issue and related to this one:
https://github.com/serverless/serverless/issues/1805
/cc @eahefnawy
@pmuens is it possible to change properties (Event) in existing bucket by using serverless ?
@olegZastavnyi You can attach an existing bucket through overwriting by using the custom resources section. The PR https://github.com/serverless/serverless/pull/1844 was merged today and will be released in the Beta.2.
However we're also about to improve the overall event syntax and support for those cases.
@pmuens I need to have it now, no time for waiting release. Any other options ?
@olegZastavnyi the Beta 2 was released a few hours ago you can update Serverless and should have everything in place I described above.
@pmuens Could you please provide some detailed description how to update existing s3 bucket(created by other system) for sqs notification by using "custom resources" section ?
@olegZastavnyi You can add "normal" CloudFormation definitions (such as Resources
or Outputs
) to the resources
section in the serverless.yml
file. This way you can add your S3 bucket and SQS definition.
This documentation shows you how you can do it: https://github.com/serverless/serverless/blob/master/docs/guide/custom-provider-resources.md#adding-custom-provider-resources
There's also no direct need to translate the corresponding CloudFormation definitions to Yaml as you can write them in a JSON file and reference them in the serverless.yml
file with the help of JSON-Ref. You can see an example of JSON-Ref usage at the end of the example serverless.yml
file here: https://github.com/serverless/serverless/blob/master/docs/understanding-serverless/serverless-yml.md#serverlessyml
@pmuens Thansk for response. One more question, how to install beta2?
npm install -g serverless@beta2 ?
@olegZastavnyi An npm install -g serverless@beta
should pull the beta 2 馃憤
@pmuens Just tried, and was not able to modify existing s3 bucket(which was created not by serverless) and got exception "bucket already exists"
Closing this one as we've moved this conversation to E-Mails
Hi, I'm having the same problem("Could not list api-gateway event sources."), what is the solution for that?
I'm using serverless 1.0.0-rc.1, on osx. I only created service with serverless create -t aws-nodejs
and then edited serverless.yml
and uncommented the already existing lines of
events: - http: path: users/create method: get
and then deployed.
I've not found the solution.
@pmuens can you help?
Hmm that's a pretty weird bug. Could you maybe create an example repository with the whole project so that we can clone and inspect it?
/cc @flomotlik @eahefnawy
@pmuens here is the example repository:
https://github.com/yishaic/serverless-bug-example
@yishaic this looks like an IAM issue where you don't actually have the rights to do this. Are you admin on this account?
@flomotlik if you mean to the user I'm using in my aws cli, then yes I'm in admin group and I have the AdministratorAccess policy. And in any way, the API itself is created and available in the Api Gateway service, I just can't see it on lambda(this is the same behaviour @olegZastavnyi had).
@flomotlik I have this same issue but I don't use the triggers screen normally. Sounds like a AWS bug.
@flomotlik @pmuens have you tried to use the example repo I've created? Have you succeeded reproducing the error?
When I create a Lambda function by myself at AWS GUI everything seems ok, only through serverless there is the described behaviour.
I confirm the bug in the latest stable version.
My serverless.yml
:
service: bot
provider:
name: aws
runtime: nodejs4.3
region: eu-west-1
functions:
trigger:
handler: handler.trigger
events:
- http:
path: trigger
method: post
Hi,
Same as @kbariotis for me. Last stable release produces "Could not list api-gateway event sources." error on Lambda's dashboard.
+1
@kbariotis and @gozup could you post a picture of the AWS Console that shows this?
@flomotlik here's a screenshot: https://github.com/serverless/serverless/issues/1816#issuecomment-239096534
@flomotlik here is mine
Cheers
Another one with Could not list api-gateway event sources
in the Dashboard here.
On serverless 1.1, clean serverless.yml with the hello function.
I'm not even using this project at the moment but I discovered this thread when researching my own issue (same display on API as pictured by gozup) during the AWS Lambda microservice example.
It was due to some Function Policies I had created. I looked at the policies via:
aws lambda get-policy --function-name myfunction | jq -r .Policy | tr -d '\' | jq
(everything after the 1st pipe is just for formatting)
After deleting some policies I had created (via aws lambda remove-permission
, leaving only the two that (I assume) were created automatically by the Lambda blueprint, the Triggers tab once again showed the API gateway source.
Just in case this is useful, or for whoever else like me ends up here. Regards --
Same problem here, just created a new java template and tried to deploy the hello function with admin access user...
Adding more info here:
I've checked the policies attached to the function as @jhlb suggested but I only had 2 policies attached (they should be the ones automatically created).
Also, when I test the api endpoint I get the following:
Sat Dec 03 13:14:53 UTC 2016 : Endpoint response body before transformations: {"message":"Go Serverless v1.0! Your function executed successfully!","request":{}}
Sat Dec 03 13:14:53 UTC 2016 : Execution failed due to configuration error: Malformed Lambda proxy response
Sat Dec 03 13:14:53 UTC 2016 : Method completed with status: 502
I've also tried to add AmazonAPIGatewayAdministrator permissions but no changes (it's strange anyway because it correctly create the resources).
Any help?
Cheers,
Dem
@demetrio812 thanks for posting this 馃憤
The Java templates need some updates so that the LAMBDA-PROXY
integration can be used (which is the default one). Could you try to change the http part from
http:
path: hello
method: get
to something like this:
http:
path: hello
method: get
integration: LAMBDA
That should do the trick. The LAMBDA-PROXY
integration is the default one. The function needs to handle the response parameters, headers etc. programatically if this is used (see https://serverless.com/framework/docs/providers/aws/events/apigateway#lambda-proxy-integration).
I still experience the same issue with serverless 1.3.0 aws-java-maven template, even when adding integration: lambda
to the http event. I see the same error message as in the screenshots provided by @olegZastavnyi and @gozup above.
This problem persists, can the issue be reopened?
Thanks for reporting that this is still an issue!
Reopening...
Hi,
I've just run into this issue myself, and was wondering if there was any manual workaround while the automated process gets updated? Not sure if it's related but I'm having cors issues too, and I had assumed this might be connected. (I have cors enabled in my .yml)
edit: Cors was unrelated, I tore down my deployment and rebuilt and that fixed (no idea what happened there) - I still get the same error as pictured above, though not as blocking for me now :) Thanks for a great service <3
Same here
is there any ETA?
same here with serverless v1.8 on macos x. The API gateway basically works but i just cant see the trigger in the AWS console. Wondering how i reveal the URL after i close my shell window with the deploy information printed form serverless which includes the endpoint.
Update: of course i can see it in the API Gateway section of the AWS Console.
@logemann thanks for the update! 馃憤
Wondering how i reveal the URL after i close my shell window with the deploy information printed form serverless which includes the endpoint.
You can run serverless info
every time which will print out the same service info you'll get after each deployment.
verified using serverless v.19 on macos x. Everything works fine, but I can not see the trigger in AWS console with the error "Could not list api-gateway event sources."
Hey!
Same here, with 1.9.0 on Ubuntu, everything works fine, but I can not see the trigger in AWS console with the error "Could not list api-gateway event sources."
I am using JAVA functions.
This is from serverless.yml
functions:
createCustomer:
handler: com.naevatec.iot.lambda.CustomerRequestHandler::createCustomer
events:
- http:
path: customers/
method: post
Thanks!
I am having this same issue v 1.9.0
I'm also encountering this issue on serverless version 1.10.1.
I am also having this issue
+1 with v1.10.2 on macOS Sierra
+1 on macOS.
+1 on serverless 1.8.0
+1 on macOS using serverless 1.11.0
+1 on windows using serverless 1.12.0
+1 on macOS Sierra, serverless 1.11.0
+1 on macOS Sierra, serverless 1.12.1
+1 on macOS Sierra, serverless 1.12.1
Thank you everyone for reporting. This seems to be smth. on AWS end 馃
I'm closing this issue for now to keep the issue count low since this is just a bug which impacts the displaying in the AWS console and not the functionality of the event source.
Most helpful comment
I still experience the same issue with serverless 1.3.0 aws-java-maven template, even when adding
integration: lambda
to the http event. I see the same error message as in the screenshots provided by @olegZastavnyi and @gozup above.