Aws-iot-device-sdk-python-v2: message='La connexion a été fermée de manière inattendue.', code=5134 region us-west-1

Créé le 1 févr. 2021  ·  7Commentaires  ·  Source: aws/aws-iot-device-sdk-python-v2

Confirmez en remplaçant [ ] par [x] ci-dessous pour vous assurer qu'il s'agit bien d'un bogue :

Problème connu

  • [X] J'utilise un point de terminaison de type de données ATS : le point de terminaison doit ressembler à <prefix>-ats.iot.<region>.amazonaws.com
    xxxxxxxxx-ats.iot.us-west-1.amazonaws.com

Décrivez le bogue
Passé par "Mise en route - et enregistrement de l'appareil"
Obtention du certificat, de la clé privée, de la clé publique et de l'autorité de certification

Numéro de version du SDK
2 (python3)

Plate-forme/OS/Appareil
Sur quoi lances-tu le sdk ?
Ubuntu

Se reproduire (comportement observé)
Étapes pour reproduire le comportement (veuillez partager le code)
Échantillon de pub/sous-marin simple
python3 pubsub.py --endpoint xxxxxxxxxx-ats.iot.us-west-1.amazonaws.com --root-ca root-CA.crt --cert zztest.cert.pem --key zztest.private.key -- Débogage de la verbosité

 [DEBUG] [2021-02-01T06:03:41Z] [00007fc75343a700] [task-scheduler] - id=0x7fc744013750 : Planification de la tâche socket_handler_close pour une exécution immédiate
 [DEBUG] [2021-02-01T06:03:41Z] [00007fc75343a700] [task-scheduler] - id=0x7fc7440021b0 : exécution de la tâche epoll_event_loop_unsubscribe_cleanup avecstatut
 [DEBUG] [2021-02-01T06:03:41Z] [00007fc75343a700] [task-scheduler] - id=0x7fc744013750 : exécution de la tâche socket_handler_close avecstatut
 [DEBUG] [2021-02-01T06:03:41Z] [00007fc75343a700] [canal] - id=0x7fc744002770 : arrêt du gestionnaire 0x7fc7440136b0 dans le répertoire d'écriture terminé.
 [DEBUG] [2021-02-01T06:03:41Z] [00007fc75343a700] [task-scheduler] - id=0x7fc744002798 : Planification (nulle) de tâche pour une exécution immédiate
 [DEBUG] [2021-02-01T06:03:41Z] [00007fc75343a700] [task-scheduler] - id=0x7fc744002798 : Tâche en cours d'exécution (nulle) avecstatut
 [DEBUG] [2021-02-01T06:03:41Z] [00007fc75343a700] [canal] - id=0x7fc744002770 : lors de l'arrêt, annulation de la tâche 0x7fc744013920
 [DEBUG] [2021-02-01T06:03:41Z] [00007fc75343a700] [task-scheduler] - id=0x7fc744013920 : exécution de la tâche tls_timeout avecstatut
 [DEBUG] [2021-02-01T06:03:41Z] [00007fc75343a700] [canal] - id=0x7fc744002770 : lors de l'arrêt, annulation de la tâche 0x7fc74402de40
 [DEBUG] [2021-02-01T06:03:41Z] [00007fc75343a700] [task-scheduler] - id=0x7fc74402de40 : exécution de la tâche mqtt_connack_timeout avecstatut
 [DEBUG] [2021-02-01T06:03:41Z] [00007fc75343a700] [channel-bootstrap] - id=0x10f7550 : arrêt du canal 0x7fc744002770 avec l'erreur 0.
 [DEBUG] [2021-02-01T06:03:41Z] [00007fc75343a700] [canal] - id=0x7fc744002770 : destruction du canal.
 [DEBUG] [2021-02-01T06:03:41Z] [00007fc75343a700] [channel-bootstrap] - id=0x10f7550 : publication de la référence d'amorçage
 Traceback (dernier appel le plus récent) :
 Fichier "pubsub.py", ligne 130, dans
 connect_future.result()
 Fichier "/usr/lib/python3.6/concurrent/futures/_base.py", ligne 432, dans le résultat
 retourner soi.__get_result()
 Fichier "/usr/lib/python3.6/concurrent/futures/_base.py", ligne 384, dans __get_result
 élever soi-même._exception
 awscrt.exceptions.AwsCrtError : AwsCrtError(name='AWS_ERROR_MQTT_UNEXPECTED_HANGUP', message='La connexion a été fermée de manière inattendue.', code=5134)
 [DEBUG] [2021-02-01T06:03:41Z] [00007fc75814b740] [mqtt-client] - id=0x12fbb80 : l'utilisateur a appelé la déconnexion.
 [ERREUR] [2021-02-01T06:03:41Z] [00007fc75814b740] [mqtt-client] - id=0x12fbb80 : la connexion n'est pas ouverte et ne peut pas être fermée
 [DEBUG] [2021-02-01T06:03:41Z] [00007fc75814b740] [mqtt-client] - id=0x12fbb80 : le dernier refcount sur la connexion a été publié, commencez à détruire la connexion.
 [DEBUG] [2021-02-01T06:03:41Z] [00007fc75814b740] [mqtt-client] - id=0x12fbb80 : Détruire la connexion

Comportement prévisible
Une description claire et concise de ce à quoi vous vous attendiez.
messages publiés en permanence

Journaux/sortie
Le cas échéant, ajoutez des journaux ou une sortie d'erreur.

N'OUBLIEZ PAS DE DÉSINFECTER VOS INFORMATIONS PERSONNELLES

awscrt.io.init_logging(awscrt.io.LogLevel.Warn, 'stderr')

Contexte supplémentaire
Ajoutez ici tout autre contexte concernant le problème.

Cela semble un peu bête et déroutant...
image
Pourquoi y a-t-il 2 choses différentes appelées IoT Core dans la console de gestion ?
Je travaille actuellement dans la région us-west-1 (Californie du Nord) ...
Il est dit que pour l'un d'entre eux, IoT Core n'est pas pris en charge - alors si je clique sur l'autre icône, il dit que c'est le cas, pouvez-vous expliquer ?
image

et voici celui qui fonctionne dans us-west-1
image
Ou ça ne marche pas ? c'est ça le problème racine... ça marche mais ça ne marche pas... :P

closed-for-staleness guidance

Commentaire le plus utile

Je me sens tellement stupide en ce moment, l'erreur pour moi était que je n'avais pas activé le certificat dans la console IoT. C'est une bêtise mais ça pourrait aider les autres

Tous les 7 commentaires

Quelle version de python3 et d'Ubuntu utilisez-vous ? Quelles autorisations utilisez-vous également pour la stratégie IAM ? Il semble que vous rencontriez un problème de connexion. Je vous recommande donc de commencer par AWSIoTFullAccess pour exclure que votre politique soit le problème. Assurez-vous simplement de le limiter aux seules actions et ressources dont vous aurez réellement besoin plus tard.

AWSIoTFullAccess :

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "iot:*"
            ],
            "Resource": "*"
        }
    ]
}

En ce qui concerne le contenu supplémentaire que vous avez mentionné, l'un d'eux a iot dans l'URL tandis que l'autre a iotv2 . Lequel est celui qui travaille pour vous?

Merci pour la réponse jmklix.
Ce que vous avez suggéré est spécifiquement pour MQTT ?
J'ai fait fonctionner les websockets, mais uniquement avec les informations d'identification .aws qui, pour notre cas d'utilisation, ne sont pas souhaitées.
Les websockets peuvent-ils s'authentifier et autoriser à l'aide des fichiers de certificat (xxxx.pem xxx.private.key xxx.public.key) consommés par mqtt ?

Oui, j'ai attrapé l'url iot/iot2 ... y a-t-il une documentation qui explique la différence entre les deux versions principales d'iot ?
Il existe également 2 sdks python client autant que je sache - l'un est pour python 2.7 l'autre pour python 3, y a-t-il plus de différences ? sont-ils étroitement associés aux versions de base iot et iot2 ? Sont-ils compatibles cross ou back ? Existe-t-il une documentation pour cela ?

Oui, c'est pour MQTT. Non, vous ne pouvez pas utiliser de fichiers de certificat avec des sockets Web

Vous pouvez modifier la stratégie pour IoT things qui sont déjà créés sur la console AWS. Sélectionnez le thing et sélectionnez la sécurité dans la barre sous-latérale. Là, vous devriez voir des certificats et vous voudrez sélectionner ce certificat. Une fois que cela est ouvert, sélectionnez la politique dans la barre sous-latérale. Sélectionnez ensuite cette stratégie et enfin cliquez sur Edit policy document et collez l'AWSIoTFullAccess que j'ai répertorié précédemment. La politique par défaut ne fonctionne pas avec les SDK v2. S'il vous plaît laissez-moi savoir si vous avez besoin d'explications supplémentaires.

L'url iot est celle que vous souhaitez utiliser car l'iotv2 ne devrait plus être visible et sera supprimée sous peu. Les sdk python et iot sont indépendants l'un de l'autre et n'ont aucune relation. L'iot v1 prend en charge python 2 et 3 tandis que l'iot v2 ne prend en charge que python 3. Les sdk iot ne sont pas compatibles entre eux ou rétrocompatibles et la documentation de l'api v2 peut être trouvée ici .

J'ai le même problème, j'ai utilisé la politique @jmklix incluse ci-dessus, j'ai créé un nouveau certificat manuellement, je l'ai lié à l'IoT Thing et à la politique et j'ai téléchargé le .pem, la clé privée et la root-CA comme ceci :

python3 shadow.py --endpoint xxxxxxxxxx-ats.iot.us-east-2.amazonaws.com --root-ca root-CA.crt --cert 726290b105-certificate.pem.crt --key 726290b105-private.pem.key --thing-name MyThingName

L'exemple shadow.py indique que --cert doit être au format .pem, j'ai donc également essayé avec 726290b105-certificate.pem

La même erreur se produit avec l'exemple pubsub.py.

J'utilise un Raspberry pi avec Python 3.

J'ai essayé d'installer avec PyPI et d'installer avec la source.

L'erreur se produit dans connected_future.result() dans l'exemple shadow.py.

J'ai un composant qui publie en utilisant MQTT similaire à l'exemple ipc_greengrass.py et cela fonctionne bien.

Je soupçonne que je fais quelque chose de mal en incluant la clé, cert et --rood-ca. Bien que j'ai vérifié les formats des fichiers. J'obtiens cette erreur :

Traceback (most recent call last):
  File "shadow.py", line 275, in <module>
    connected_future.result()
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 432, in result
    return self.__get_result()
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
awscrt.exceptions.AwsCrtError: AwsCrtError(name='AWS_ERROR_MQTT_UNEXPECTED_HANGUP', 
message='The connection was closed unexpectedly.',
code=5134)

Exécution avec --verbosity --debug

[INFO] [2021-02-18T19:57:17Z] [b7b6bec0] [event-loop] - id=0xa4371f0: Initializing edge-triggered epoll
[DEBUG] [2021-02-18T19:57:17Z] [b7b6bec0] [event-loop] - id=0xa4371f0: Eventfd not available, falling back to pipe for cross-thread notification.
[INFO] [2021-02-18T19:57:17Z] [b7b6bec0] [event-loop] - id=0xa4371f0: Starting event-loop thread.
[INFO] [2021-02-18T19:57:17Z] [b7b6bec0] [dns] - id=0xa42b310: Initializing default host resolver with 16 max host entries.
[INFO] [2021-02-18T19:57:17Z] [b7050b40] [thread] - id=0xa3eeb8c: a cpu affinity was specified when launching this thread and set_mempolicy() is available on this system. Setting the memory policy to MPOL_PREFERRED
[WARN] [2021-02-18T19:57:17Z] [b7050b40] [thread] - id=0xa3eeb8c: call to set_mempolicy() failed with errno 38
[INFO] [2021-02-18T19:57:17Z] [b7b6bec0] [channel-bootstrap] - id=0xa44d200: Initializing client bootstrap with event-loop group 0xa43ea60
[INFO] [2021-02-18T19:57:17Z] [b684fb40] [event-loop] - id=0xa4371f0: main loop started
[INFO] [2021-02-18T19:57:17Z] [b684fb40] [event-loop] - id=0xa4371f0: default timeout 100000, and max events to process per tick 100
[DEBUG] [2021-02-18T19:57:17Z] [b7b6bec0] [tls-handler] - ctx: Certificate and key have been set, setting them up now.
[DEBUG] [2021-02-18T19:57:17Z] [b7b6bec0] [tls-handler] - ctx: Setting ALPN list x-amzn-mqtt-ca
Connecting to <endpoint> with client ID 'test-1e0e6e8b-ee1f-441d-8956-69aaedcb937d'...
[DEBUG] [2021-02-18T19:57:17Z] [b7b6bec0] [mqtt-client] - client=0xa4ee030: Initalizing MQTT client
[DEBUG] [2021-02-18T19:57:17Z] [b7b6bec0] [mqtt-client] - id=0xa450e40: Creating new connection
[DEBUG] [2021-02-18T19:57:17Z] [b7b6bec0] [mqtt-topic-tree] - tree=0xa450f94: Creating new topic tree
[DEBUG] [2021-02-18T19:57:17Z] [b7b6bec0] [mqtt-client] - id=0xa450e40: Begin connecting process, switch state to CONNECTING.
[INFO] [2021-02-18T19:57:17Z] [b7b6bec0] [mqtt-client] - id=0xa450e40: using ping timeout of 3000000000 ns
[DEBUG] [2021-02-18T19:57:17Z] [b7b6bec0] [dns] - id=0xa42b310: Host resolution requested for a1ypu7uyt3br9h-ats.iot.us-east-2.amazonaws.com
[DEBUG] [2021-02-18T19:57:17Z] [b7b6bec0] [dns] - id=0xa42b310: No cached entries found for a1ypu7uyt3br9h-ats.iot.us-east-2.amazonaws.com starting new resolver thread.
[DEBUG] [2021-02-18T19:57:17Z] [b5754b40] [dns] - static: resolving host a1ypu7uyt3br9h-ats.iot.us-east-2.amazonaws.com
[DEBUG] [2021-02-18T19:57:17Z] [b5754b40] [dns] - static: resolved record: 3.131.31.52
[DEBUG] [2021-02-18T19:57:17Z] [b5754b40] [dns] - static: resolved record: 52.15.119.124
[DEBUG] [2021-02-18T19:57:17Z] [b5754b40] [dns] - static: resolved record: 13.59.30.89
[DEBUG] [2021-02-18T19:57:17Z] [b5754b40] [dns] - static: resolved record: 2600:1f00:6000::383:1f34
[DEBUG] [2021-02-18T19:57:17Z] [b5754b40] [dns] - static: resolved record: 2600:1f00:6000::340f:777c
[DEBUG] [2021-02-18T19:57:17Z] [b5754b40] [dns] - static: resolved record: 2600:1f00:6000::d3b:1e59
[DEBUG] [2021-02-18T19:57:17Z] [b5754b40] [dns] - static: new address resolved 3.131.31.52 for host a1ypu7uyt3br9h-ats.iot.us-east-2.amazonaws.com caching
[DEBUG] [2021-02-18T19:57:17Z] [b5754b40] [dns] - static: new address resolved 52.15.119.124 for host a1ypu7uyt3br9h-ats.iot.us-east-2.amazonaws.com caching
[DEBUG] [2021-02-18T19:57:17Z] [b5754b40] [dns] - static: new address resolved 13.59.30.89 for host a1ypu7uyt3br9h-ats.iot.us-east-2.amazonaws.com caching
[DEBUG] [2021-02-18T19:57:17Z] [b5754b40] [dns] - static: new address resolved 2600:1f00:6000::383:1f34 for host a1ypu7uyt3br9h-ats.iot.us-east-2.amazonaws.com caching
[DEBUG] [2021-02-18T19:57:17Z] [b5754b40] [dns] - static: new address resolved 2600:1f00:6000::340f:777c for host a1ypu7uyt3br9h-ats.iot.us-east-2.amazonaws.com caching
[DEBUG] [2021-02-18T19:57:17Z] [b5754b40] [dns] - static: new address resolved 2600:1f00:6000::d3b:1e59 for host a1ypu7uyt3br9h-ats.iot.us-east-2.amazonaws.com caching
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb4e03050: Scheduling attempt_connection task for immediate execution
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb4e03b50: Scheduling attempt_connection task for immediate execution
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb4e03050: Running attempt_connection task with <Running> status
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [socket] - id=0xb5d00b70 fd=7: initializing with domain 1 and type 0
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [socket] - id=0xb5d00b70 fd=7: setting socket options to: keep-alive 0, keep idle 0, keep-alive interval 0, keep-alive probe count 0.
[WARN] [2021-02-18T19:57:17Z] [b684fb40] [socket] - id=0xb5d00b70 fd=7: setsockopt() for NO_SIGNAL failed with errno 92. If you are having SIGPIPE signals thrown, you may want to install a signal trap in your application layer.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [socket] - id=0xb5d00b70 fd=7: beginning connect.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [socket] - id=0xb5d00b70 fd=7: connecting to endpoint 2600:1f00:6000::383:1f34:443.
[ERROR] [2021-02-18T19:57:17Z] [b684fb40] [socket] - id=0xb5d00b70 fd=7: connect failed with error code 101.
[INFO] [2021-02-18T19:57:17Z] [b684fb40] [dns] - id=0xa42b310: recording failure for record 2600:1f00:6000::383:1f34 for a1ypu7uyt3br9h-ats.iot.us-east-2.amazonaws.com, moving to bad list
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [dns] - static: purging address 2600:1f00:6000::383:1f34 for host a1ypu7uyt3br9h-ats.iot.us-east-2.amazonaws.com from the cache due to cache eviction or shutdown
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [socket] - id=0xb5d00b70 fd=7: is still open, closing...
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [socket] - id=0xb5d00b70 fd=7: closing
[ERROR] [2021-02-18T19:57:17Z] [b684fb40] [channel-bootstrap] - id=0xa44d200: failed to create socket with error 1049
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb4e03b50: Running attempt_connection task with <Running> status
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [socket] - id=0xb5d00b70 fd=7: initializing with domain 0 and type 0
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [socket] - id=0xb5d00b70 fd=7: setting socket options to: keep-alive 0, keep idle 0, keep-alive interval 0, keep-alive probe count 0.
[WARN] [2021-02-18T19:57:17Z] [b684fb40] [socket] - id=0xb5d00b70 fd=7: setsockopt() for NO_SIGNAL failed with errno 92. If you are having SIGPIPE signals thrown, you may want to install a signal trap in your application layer.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [socket] - id=0xb5d00b70 fd=7: beginning connect.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [socket] - id=0xb5d00b70 fd=7: connecting to endpoint 3.131.31.52:443.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d01aa0: Scheduling (null) task for future execution at time 8129633861413
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d01ae0: Scheduling epoll_event_loop_unsubscribe_cleanup task for immediate execution
[INFO] [2021-02-18T19:57:17Z] [b684fb40] [socket] - id=0xb5d00b70 fd=7: connection success
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [socket] - id=0xb5d00b70 fd=7: local endpoint 10.0.2.15:39292
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [socket] - id=0xb5d00b70 fd=7: assigning to event loop 0xa4371f0
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [channel-bootstrap] - id=0xa44d200: client connection on socket 0xb5d00b70 completed with error 0.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [channel] - id=0xb5d01c70: Beginning creation and setup of new channel.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d01e30: Scheduling on_channel_setup_complete task for immediate execution
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d01ae0: Running epoll_event_loop_unsubscribe_cleanup task with <Running> status
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d01e30: Running on_channel_setup_complete task with <Running> status
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [channel] - id=0xb5d01c70: setup complete, notifying caller.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [channel] - id=0xb5d01c70: no message pool is currently stored in the event-loop local storage, adding 0xb5d01f80 with max message size 16384, message count 4, with 4 small blocks of 128 bytes.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [channel-bootstrap] - id=0xa44d200: channel 0xb5d01c70 setup succeeded: bootstrapping.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [socket-handler] - id=0xb5d12620: Socket handler created with max_read_size of 16384
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d12718: Scheduling tls_timeout task for future execution at time 8134691976802
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [tls-handler] - id=0xb5d12700: Alpn protocol negotiated as x-amzn-mqtt-ca
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [tls-handler] - id=0xb5d12700: Remote server name is a1ypu7uyt3br9h-ats.iot.us-east-2.amazonaws.com
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [channel-bootstrap] - id=0xa44d200: tls negotiation result 0 on channel 0xb5d01c70
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [mqtt-client] - id=0xa450e40: Connection successfully opened, sending CONNECT packet
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d2c800: Scheduling mqtt_connack_timeout task for future execution at time 8127847022119
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [mqtt-client] - id=0xa450e40: Adding username ?SDK=PythonV2&Version=0.9.15 to connection
Traceback (most recent call last):
  File "shadow.py", line 275, in <module>
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [tls-handler] - id=0xb5d12700: Alert code 0
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d01d88: Scheduling channel_shutdown task for immediate execution
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d01d88: Running channel_shutdown task with <Running> status
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [channel] - id=0xb5d01c70: beginning shutdown process
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [channel] - id=0xb5d01c70: handler 0xb5d12620 shutdown in read dir completed.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [tls-handler] - id=0xb5d12700: Shutting down read direction with error code 0
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [channel] - id=0xb5d01c70: handler 0xb5d12700 shutdown in read dir completed.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [channel] - id=0xb5d01c70: handler 0xa450e54 shutdown in read dir completed.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d01c84: Scheduling (null) task for immediate execution
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d01c84: Running (null) task with <Running> status
[INFO] [2021-02-18T19:57:17Z] [b684fb40] [mqtt-client] - id=0xa450e40: sending disconnect message as part of graceful shutdown.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [mqtt-client] - id=0xa450e40: failed to send courteous disconnect io message
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [channel] - id=0xb5d01c70: handler 0xa450e54 shutdown in write dir completed.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [tls-handler] - id=0xb5d12700: Shutting down write direction
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [channel] - id=0xb5d01c70: handler 0xb5d12700 shutdown in write dir completed.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [socket] - id=0xb5d00b70 fd=7: closing
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d01c40: Scheduling epoll_event_loop_unsubscribe_cleanup task for immediate execution
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d12674: Scheduling socket_handler_close task for immediate execution
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d01c40: Running epoll_event_loop_unsubscribe_cleanup task with <Running> status
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d12674: Running socket_handler_close task with <Running> status
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [channel] - id=0xb5d01c70: handler 0xb5d12620 shutdown in write dir completed.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d01c84: Scheduling (null) task for immediate execution
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d01c84: Running (null) task with <Running> status
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [channel] - id=0xb5d01c70: during shutdown, canceling task 0xb5d12718
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d12718: Running tls_timeout task with <Canceled> status
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [channel] - id=0xb5d01c70: during shutdown, canceling task 0xb5d2c800
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [task-scheduler] - id=0xb5d2c800: Running mqtt_connack_timeout task with <Canceled> status
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [channel-bootstrap] - id=0xa44d200: channel 0xb5d01c70 shutdown with error 0.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [channel] - id=0xb5d01c70: destroying channel.
[DEBUG] [2021-02-18T19:57:17Z] [b684fb40] [channel-bootstrap] - id=0xa44d200: releasing bootstrap reference
    connected_future.result()
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 432, in result
    return self.__get_result()
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
awscrt.exceptions.AwsCrtError: AwsCrtError(name='AWS_ERROR_MQTT_UNEXPECTED_HANGUP', message='The connection was closed unexpectedly.', code=5134)
[DEBUG] [2021-02-18T19:57:17Z] [b7b6bec0] [mqtt-client] - id=0xa450e40: user called disconnect.
[ERROR] [2021-02-18T19:57:17Z] [b7b6bec0] [mqtt-client] - id=0xa450e40: Connection is not open, and may not be closed
[DEBUG] [2021-02-18T19:57:17Z] [b7b6bec0] [mqtt-client] - id=0xa450e40: Last refcount on connection has been released, start destroying the connection.
[DEBUG] [2021-02-18T19:57:17Z] [b7b6bec0] [mqtt-client] - id=0xa450e40: Destroying connection
[DEBUG] [2021-02-18T19:57:17Z] [b7b6bec0] [mqtt-topic-tree] - tree=0xa450f94: Cleaning up topic tree
[DEBUG] [2021-02-18T19:57:17Z] [b7b6bec0] [mqtt-client] - client=0xa4ee030: Cleaning up MQTT client
[DEBUG] [2021-02-18T19:57:17Z] [b7b6bec0] [channel-bootstrap] - id=0xa44d200: releasing bootstrap reference
[DEBUG] [2021-02-18T19:57:17Z] [b7b6bec0] [channel-bootstrap] - id=0xa44d200: releasing bootstrap reference
[DEBUG] [2021-02-18T19:57:17Z] [b7b6bec0] [channel-bootstrap] - id=0xa44d200: destroying




Je me sens tellement stupide en ce moment, l'erreur pour moi était que je n'avais pas activé le certificat dans la console IoT. C'est une bêtise mais ça pourrait aider les autres

@hackaprende merci d'avoir partagé la solution à l'endroit où vous êtes bloqué.

En postant ici au cas où cela aiderait les futurs chercheurs, j'obtenais également l'erreur awscrt.exceptions.AwsCrtError: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly. et pour moi, il s'avère que je n'avais pas _activé_ le certificat d'objet AWS IoT. Après l'avoir créé, il y a une autre étape pour l'activer.

Cette page vous a été utile?
0 / 5 - 0 notes

Questions connexes

qcabrol picture qcabrol  ·  8Commentaires

victorct-pronto picture victorct-pronto  ·  3Commentaires

Sanrro10 picture Sanrro10  ·  16Commentaires

satay99 picture satay99  ·  6Commentaires

mkozjak picture mkozjak  ·  17Commentaires