Skip to content

Not able to connect to MQTT with browser - connection establish stalled #303

@croraf

Description

@croraf

Describe the bug

I'm trying a code sample provided in the repo browser/pub_sub.

I'm identifying through Cognito identity pool. I set to allow Unauthenticated identities. I created and assigned a new role to both unauthenticated and authenticated identities. That role was created with default policy document.

After I run the application I see in Cognito that the identity has been created as anonymous identity.

Everything seems to be executed properly but the connection does not get established and instead enters in a "pending state" (reconnecting infinitely, check below image),

image

I did enter the region and endpoint of IoT Core.

export const AWS_REGION = "eu-west-1";
export const AWS_IOT_ENDPOINT = "...-ats.iot.eu-west-1.amazonaws.com";

The endpoint is the one I found in https://eu-west-1.console.aws.amazon.com/iot/home?region=eu-west-1#/connectdevice

Also in https://eu-west-1.console.aws.amazon.com/iot/home?region=eu-west-1#/policyhub I have created a policy with this
image

Expected Behavior

Connection establish should either work or report a meaningful error.

Current Behavior

It just repeatedly tries to make a WS connection. It doesn't throw an error (provides a message on why it fails).

Reproduction Steps

Run the snippet.

Possible Solution

No response

Additional Information/Context

No response

SDK version used

1.18.11

Environment details (OS name and version, etc.)

Ubuntu 22.04 (Chrome 108 browser)

Metadata

Metadata

Assignees

Labels

closed-for-stalenessdocumentationThis is a problem with documentation.p2This is a standard priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions