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
samples/pubsub.py gives AWS_ERROR_HTTP_CALLBACK_FAILURE or AWS_ERROR_MQTT_UNEXPECTED_HANGUP #115
Comments
Can you try installing from source and see if that gives you the same error?
|
Good news! Doing a fresh checkout and installing from source, However, if I add |
Also, I modified the auto-generated policy to be extremely lenient. That might have had an impact? I know that samples/README.md says the policy needs to provide some privileges. I will try a more specific policy (right now it's just |
A Websockets connection requires aws credentials. The default credentials provider chain used by the samples can retrieve credentials from the environment, an aws profile file, or imds/ecs (which isn't applicable to you). The IoT SDK supports most of the credentials providers you can find in the standard AWS SDKs and their documentation can be a good starting point (https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html for example). As with certificate-based authentication, the IAM policy associated with the aws credentials will need to allow all of the IoT operations you want to perform. |
@EGrunzke have you been able to successfully connect with websockets? |
I have not tried with websockets since I got it working with normal mqtt. I suggest closing this as can't reproduce and I'll comment again if I have any trouble. |
|
Confirm by changing [ ] to [x] below to ensure that it's a bug:
Known Issue
<prefix>-ats.iot.<region>.amazonaws.com
Describe the bug
The pubsub sample gives errors:
--websockets
:AwsCrtError(name='AWS_ERROR_HTTP_CALLBACK_FAILURE', message='A callback has reported failure.', code=2064)
--websockets
:AwsCrtError(name='AWS_ERROR_MQTT_UNEXPECTED_HANGUP', message='The connection was closed unexpectedly.', code=5134)
SDK version number
awsiotsdk-1.5.0
awscrt-0.9.0
Platform/OS/Device
Docker
python:3.8-buster
To Reproduce (observed behavior)
docker run -v `pwd`:/home/root/kit -it python:3.8-buster bash
Examine the
start.sh
file from the connection kit. It will have your endpoint. The cert and key are included in the connection kit as well.While in bash in the docker container:
This gives the errors listed above
Expected behavior
The pubsub example should publish and receive messages.
Logs/output
Additional context
The
start.sh
that comes with the connection kit appears to work, but it uses the old V1 sdk. You can see it work by following the guide:The text was updated successfully, but these errors were encountered: