Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Lambda:IllegalArgument #346

Closed
merunga opened this issue Mar 30, 2018 · 6 comments
Closed

Lambda:IllegalArgument #346

merunga opened this issue Mar 30, 2018 · 6 comments
Labels

Comments

@merunga
Copy link

merunga commented Mar 30, 2018

I don't know if this is an issue with the examples themselves or with serverless-appsync-plugin.

But, after deploying appsync api with lamba datasource and trying to connect with appsync-web-client

Every request to the appsync api ends up with the following error:

{
  "data": null,
  "errors": [{
    "path": ["meInfo"],
    "errorType": "Lambda:IllegalArgument",
    "locations": [{
      "line": 2,
      "column": 3
    }],
    "message": "java.lang.IllegalArgumentException: Illegal ARN format detected, the relative-id must follow the format function:<name>:<alias>"
  }]
}

image

Also tried setting up a serverless version of events schema template that comes by default with appsync, same result

@sid88in
Copy link
Contributor

sid88in commented Mar 30, 2018

@merunga looks like some settings are not correct.

  1. Please double check the resource ARN's used while creating the backend API. You can double check if your API is infact working by going into AppSync console. Try making a call to your lambda and see if you get the response.

  2. Please double check the input configs for the client are set properly with correct API name.

@merunga
Copy link
Author

merunga commented Mar 30, 2018

Hi @sid88in thanks for the quick reply.
I've have already checked the two places where ARNs are used:

  • the appsync dataSource
  • the role policy resources

Is there some other place where I should check? What do you mean with the input configs for the client?

Just to be clear, I have not changed anything in the serverless.yml file except for custom.accountId and custom.userPoolConfig.userPoolId. All the other is exactly as it's defined in the repo. Shouldn't this work by default?

I'll keep looking. Thanks!

@sid88in
Copy link
Contributor

sid88in commented Mar 30, 2018

@merunga I would first make sure AppSync API's are created with correct input ARN's for AWS Lambda. You can try that by either 1) making an API call directly from GraphiQL in AppSync Console or 2) invoking lambda with a test event on lambda console. Now, if you get an error then there is something not right with your backend setup.

If the above step completes successfully, then you should check config/security.env because when you kickstart the client it takes some config params as an input (you can check package json for yarn start command). Please make sure your GraphQL endpoint is configured there.

@merunga
Copy link
Author

merunga commented Mar 30, 2018

@sid88in graphiql in appsync console is returning the same error. I'll check it out. Thanks for your support!

Hope to come back with an explanation!

@sid88in
Copy link
Contributor

sid88in commented Mar 30, 2018

@merunga sounds good. The problem seems to be with the backend API creation. Please check the AWS lambda resource ARN.

@sid88in sid88in closed this as completed Mar 30, 2018
@kirkness
Copy link

Hello! I think it might be on this line https://github.com/serverless/serverless-graphql/blob/master/app-backend/appsync/lambda/serverless.yml#L61

arn:aws:lambda:us-east-1:${self:custom.accountId}:serverless-graphql-appsync-lda-production-graphql

Should become...

arn:aws:lambda:us-east-1:${self:custom.accountId}:function:serverless-graphql-appsync-lda-production-graphql

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants