Attempting to register smart app "A temporary server error occurred Upstream target timed out"

Hi, I’m attempting to register the example java aws lambda smart app but every time I get to the last step, hit save and get this pop up:
“A temporary server error occurred. Please try again in a few minutes. Upstream target timed out”

I’ve been trying to debug this but I haven’t had any luck. Can anyone please give me any ideas on how to fix this?
Thank you.

1 Like

Tagging @erickv @SamsungZell

1 Like

Hello, @manderley

This error message tends to be triggered under the next circumstances:

  1. (Using a webhook) The SmartApp isn’t handling correctly the PING lifecycle.

  2. The add-permission step has been skipped, therefore SmartThings won’t be able to invoke your SmartApp’s Lambda Function.

  3. At the 6th step from SmartApp Java SDK, it will need the --profile parameter when adding permissions. This parameter contains the Access and the Secret Keys to grant access to your Lambda Function, also it must be registered with a region that matches your Lambda’s region.

To configure your aws profile through the aws cli, type the next line at your console:

aws configure --profile default

Then you’ll be prompted to fill the following information:

AWS Access Key ID:
AWS Secret Access Key:
Default region name: <---- This value must match your Lambda's regions.
Default output format:

I hope this information helps you to register your SmartApp successfully.

Best regards,

Erick.

1 Like

This worked, thank you so much!

1 Like

Hi Erickv
I followed smartthing git sample: smartapp-nodejs-tutorial
created a lambda function on AWS, input the ARN, and also select 3 permissions. When I hit the “Save” button at the last step, it still got the same error. Please help me out.

Thanks.

1 Like

Hi, @Bowie

Could you please confirm that you have set the permission as explained at this post and, that in response you’ve received the next output (notice that the principal Id must be 906037444270):

{
    "Sid": "some-id",
    "Effect": "Allow",
    "Principal": {
        "AWS": "arn:aws:iam::906037444270:root"
    },
    "Action": "lambda:InvokeFunction",
    "Resource": "arn:aws:lambda:us-east-1:<IAM-NUMBER>:function:test_smartapp"
}

For more information, check the SmartApp/Hosting documentation.

Please, let me know if this information results useful to you.

Thanks!
Erick.

Hi @erickv
Thank you for your reply and you are right after executing the “add-permission” command, I can finish the app registration. But I had another error while trying to install this smartapp. Are there any steps I missed?

Thanks!


1 Like

Hi, @Bowie

I’ve checked the code of the sample and noticed that the device profiles scope hasn’t been updated. In the meantime the code gets reviewed, please change the scope to i:deviceprofiles:* and include the r:locations:*.

Also, please check the next SmartApp example that integrates the SmartApp SDK NodeJS:

Best regards,
Erick.