aws / aws-iot-device-sdk-cpp

SDK for connecting to AWS IoT from a device using C++
http://aws-iot-device-sdk-cpp-docs.s3-website-us-east-1.amazonaws.com
Apache License 2.0
123 stars 111 forks source link

SDK Code -1103 #191

Closed mluis closed 3 years ago

mluis commented 4 years ago

While trying to run the RobotArm example I'm getting this issue:

[INFO] Fri Nov 20 11:36:35 2020
:365 [OpenSSL Wrapper] [3063625936] [ConnectTCPSocket:L234] : resolved greengrass.iot.eu-west-1.amazonaws.com to xx.xxx.xx.xxx
[ERROR] Fri Nov 20 11:36:36 2020
:173 [Discover] [3063625936] [ReadResponseFromNetwork:L128] : Discover Action HTTP request failed with a Response Header :
HTTP/1.1 403 Forbidden

[ERROR] Fri Nov 20 11:36:36 2020
[ERROR] Fri Nov 20 11:37:36 2020
:847 [Discover] [3063883984] [ReadResponseFromNetwork:L128] : Discover Action HTTP request failed with a Response Header :
HTTP/1.1 403 Forbidden

[ERROR] Fri Nov 20 11:37:36 2020
:855 [Discover] [3063883984] [PerformAction:L270] : Discover Read from Network failed. Server returned unknown error while performing the discovery action : SDK Code -1103.
[INFO] Fri Nov 20 11:37:38 2020
:858 [Sample - Switch] [3063883984] [RunSample:L125] : Discover Request failed with response code : -1103.  Trying again...
[INFO] Fri Nov 20 11:37:43 2020
:859 [Sample - Switch] [3063883984] [RunSample:L135] : Discover failed after max retries, exiting

Does anyone has an idea of what could be the solution?

mluis commented 4 years ago

One possible solution could be not having attached the policy to the device.

jmklix commented 4 years ago

Did attaching a policy fix the failed HTTP request?

mluis commented 4 years ago

Did attaching a policy fix the failed HTTP request?

In my case to the device.

jmklix commented 4 years ago

Is that a yes? If so please close the issue

mluis commented 4 years ago

No, it isn't a yes. Why would I close the issue?

EDIT: is the issue closed?

jmklix commented 4 years ago

No, the issue is not closed. Could you elaborate on what you mean by:

In my case to the device.

It appears that you think that attaching a policy to the device might fix your problem and I wanted to know if that worked.

mluis commented 4 years ago

Please refer to here

jmklix commented 4 years ago

One possible solution could be not having attached the policy to the device.

Are you suggesting this as a fix to your own problem? or that this is a possible cause of the error that you are getting? or something else?

Also more additional information would be helpful. eg: Platform/OS/Device, what setup is required to reproduce this, any other additional context that might be relevant.

mluis commented 4 years ago

I'm suggesting the error should address exactly whats the problem.

Please refer to https://github.com/aws-amplify/amplify-cli/issues/4532#issuecomment-644267910 for more context.

KaibaLopez commented 3 years ago

@mluis, if you want help with this issue please state clearly what happened and what you expect, you seem to assume that we have knowledge of your previous issues on aws-amplify but these are different teams with different people working on them.

From your comments it seems like you needed to attach a policy to the greengrass device, which yea it will need, this is expected, but that's assuming you are no longer seeing the error...

So, if attaching it "fixed" your error, then there is no bug, and if it didn't please provide the information @jmklix is asking for (Platform/OS/Device etc.) so we can properly reproduce this. Second problem you bring up is the error message being unclear, assuming not attaching the policy was your problem, I'm guessing you'd want to have an error saying "no policy attached to device" or something along those lines?

mluis commented 3 years ago

@KaibaLopez you guessed it right. Like me! If having an error saying "no policy attached to the device" would go under close scrutiny!

jmklix commented 3 years ago

@mluis I think you are asking for a specific warning to show when a policy is not attached and that is not the level of detail that this sdk shows with the error warnings. There is a v2 c++ sdk so no feature requests are being added to this sdk.

If you haven't already, take a look at this guide that steps through the entire setup process including the policy docs.