Aws-iot-device-sdk-python-v2: message ='接続が予期せず閉じられました。'、code = 5134 region us-west-1

作成日 2021年02月01日  ·  7コメント  ·  ソース: aws/aws-iot-device-sdk-python-v2

以下の[]を[x]に変更して確認し、バグであることを確認します。

既知の問題

  • [X] ATSデータ型エンドポイントを使用しています:エンドポイントは<prefix>-ats.iot.<region>.amazonaws.comのようになります
    xxxxxxxxx-ats.iot.us-west-1.amazonaws.com

バグを説明する
「はじめに-デバイスの登録」を通過しました
証明書、秘密鍵、公開鍵、およびCAを取得しました

SDKのバージョン番号
2(python3)

プラットフォーム/OS/デバイス
何でSDKを実行していますか?
Ubuntu

再現する(観察された行動)
動作を再現する手順(コードを共有してください)
単純なpub/subサンプル
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-詳細デバッグ

 [デバッグ][2021-02-01T06:03:41Z] [00007fc75343a700] [task-scheduler] --id = 0x7fc744013750:すぐに実行するようにsocket_handler_closeタスクをスケジュールします
 [デバッグ][2021-02-01T06:03:41Z][00007fc75343a700][タスクスケジューラ]-id=0x7fc7440021b0:epoll_event_loop_unsubscribe_cleanupタスクを実行していますスターテス
 [デバッグ][2021-02-01T06:03:41Z][00007fc75343a700][タスクスケジューラ]-id=0x7fc744013750:socket_handler_closeタスクを実行していますスターテス
 [デバッグ][2021-02-01T06:03:41Z][00007fc75343a700][チャネル]-id=0x7fc744002770:書き込みディレクトリでのハンドラー0x7fc7440136b0のシャットダウンが完了しました。
 [デバッグ][2021-02-01T06:03:41Z] [00007fc75343a700] [task-scheduler] --id = 0x7fc744002798:即時実行のための(null)タスクのスケジューリング
 [デバッグ][2021-02-01T06:03:41Z][00007fc75343a700][タスクスケジューラ]-id=0x7fc744002798:実行中(null)タスクスターテス
 [デバッグ][2021-02-01T06:03:41Z][00007fc75343a700][チャネル]-id=0x7fc744002770:シャットダウン中に、タスク0x7fc744013920をキャンセルします
 [デバッグ][2021-02-01T06:03:41Z][00007fc75343a700][タスクスケジューラ]-id=0x7fc744013920:tls_timeoutタスクを実行していますスターテス
 [デバッグ][2021-02-01T06:03:41Z][00007fc75343a700][チャネル]-id=0x7fc744002770:シャットダウン中に、タスク0x7fc74402de40をキャンセルします
 [デバッグ][2021-02-01T06:03:41Z][00007fc75343a700][タスクスケジューラ]-id=0x7fc74402de40:mqtt_connack_timeoutタスクを実行していますスターテス
 [デバッグ][2021-02-01T06:03:41Z] [00007fc75343a700] [channel-bootstrap] --id = 0x10f7550:チャネル0x7fc744002770がエラー0でシャットダウンしました。
 [デバッグ][2021-02-01T06:03:41Z][00007fc75343a700][チャネル]-id=0x7fc744002770:チャネルを破棄しています。
 [デバッグ][2021-02-01T06:03:41Z] [00007fc75343a700] [channel-bootstrap]-id = 0x10f7550:ブートストラップ参照を解放します
トレースバック(最後の最後の呼び出し):
 ファイル"pubsub.py"、行130、
 connect_future.result()
 ファイル"/usr/lib/python3.6/concurrent/futures/_base.py"、行432、結果
 self .__ get_result()を返します
 __get_resultのファイル"/usr/lib/python3.6/concurrent/futures/_base.py"、行384
 self._exceptionを上げる
 awscrt.exceptions.AwsCrtError:AwsCrtError(name ='AWS_ERROR_MQTT_UNEXPECTED_HANGUP'、message ='接続が予期せず閉じられました。'、code = 5134)
 [デバッグ][2021-02-01T06:03:41Z] [00007fc75814b740] [mqtt-client]-id = 0x12fbb80:ユーザーがdisconnectと呼ばれました。
 [エラー][2021-02-01T06:03:41Z] [00007fc75814b740] [mqtt-client]-id = 0x12fbb80:接続が開いていないため、閉じられない可能性があります
 [デバッグ][2021-02-01T06:03:41Z] [00007fc75814b740] [mqtt-client] --id = 0x12fbb80:接続の最後のrefcountが解放されました、接続の破棄を開始します。
 [デバッグ][2021-02-01T06:03:41Z] [00007fc75814b740] [mqtt-client]-id = 0x12fbb80:接続を破棄しています

予想される行動
何が起こると予想したかについての明確で簡潔な説明。
継続的に公開されるメッセージ

ログ/出力
必要に応じて、ログまたはエラー出力を追加します。

あなたの個人情報を消毒することを忘れないでください

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

追加のコンテキスト
ここに問題に関する他のコンテキストを追加します。

これは少しばかげて混乱しているようです...
image
管理コンソールにIoTコアと呼ばれる2つの異なるものがあるのはなぜですか?
私は現在私たちで働いています-西1(北カリフォルニア)地域..。
そのうちの1つについてはIoTCoreがサポートされていないと表示されます。次に、もう1つのアイコンをクリックすると、サポートされていると表示されます。説明していただけますか?
image

そして、これが私たちで機能するものです-west-1
image
それとも機能しませんか? 根本的な問題です...それは機能しますが機能しません...:P

closed-for-staleness guidance

最も参考になるコメント

今はとても馬鹿げていると感じています。私にとってのエラーは、IoTコンソールで証明書をアクティブ化していないことでした。 これは愚かなことですが、他の人を助けることができます

全てのコメント7件

使用しているpython3とUbuntuのバージョンは何ですか? また、IAMポリシーにどの権限を使用していますか? 接続に問題があるようです。ポリシーが問題であることを除外するために、 AWSIoTFullAccessから始めることをお勧めします。 後で実際に必要なアクションとリソースのみに制限するようにしてください。

AWSIoTFullAccess:

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

あなたが言及した追加のコンテンツに関しては、それらの1つはURLにiotがあり、もう1つはiotv2があります。 あなたのために働いているのはどれですか?

応答jmklixをありがとう。
あなたが提案したのは、特にMQTT用ですか?
WebSocketを機能させましたが、.awsクレデンシャルのみを使用しました。これは、私たちのユースケースでは望ましくないと思います。
WebSocketは、mqttが消費する証明書ファイル(xxxx.pem xxx.private.key xxx.public.key)を使用して認証および承認できますか?

はい私はURLiot/ iot2に追いつきました...2つのiotコアバージョンの違いを説明するドキュメントはありますか?
2つのクライアントpythonsdksafaikもあります-1つはpython2.7用で、もう1つはpython 3用ですが、さらに違いはありますか? それらは、iotおよびiot2コアバージョンと緊密にペアになっていますか? それらは相互互換性がありますか、それとも下位互換性がありますか? このためのドキュメントはありますか?

はい、MQTT用です。 いいえ、Webソケットで証明書ファイルを使用することはできません

AWSコンソールですでに作成されているIoT thingsのポリシーを編集できます。 thingを選択し、サブサイドバーでセキュリティを選択します。 そこに証明書が表示され、その証明書を選択する必要があります。 それが開いたら、サブサイドバーでポリシーを選択します。 次に、そのポリシーを選択し、最後にEdit policy documentをクリックして、前にリストしたAWSIoTFullAccessを貼り付けます。 デフォルトのポリシーは、v2SDKでは機能しません。 さらに説明が必要な場合はお知らせください。

iot urlは、iotv2が表示されなくなり、まもなく削除されるため、使用するURLです。 pythonとiotsdkは互いに独立しており、関係はありません。 iotv1はpython2および3をサポートしますが、iotv2はpython3のみをサポートします。iotsdkは相互互換性または下位互換性がなく、v2apiのドキュメントはここにあります。

同じ問題があります。上記のポリシー@jmklixを使用し、新しい証明書を手動で作成し、それをIoT Thingとポリシーにリンクして、次のように.pem、秘密鍵、ルートCAをダウンロードしました。

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

shadow.pyの例では、-certは.pem形式である必要があるため、726290b105-certificate.pemも試してみました。

pubsub.pyの例でも同じエラーが発生します。

Python3でRaspberrypiを使用しています。

PyPIを使用してインストールし、ソースを使用してインストールしてみました。

このエラーは、shadow.pyの例のconnected_future.result()で発生します。

ipc_greengrass.pyサンプルに似たMQTTを使用して公開するコンポーネントがあり、うまく機能します。

私の疑いは、キー、証明書、および--rood-caを含めるときに何か間違ったことをしていることです。 私はファイラーのフォーマットを再確認しましたが。 このエラーが発生します:

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)

--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




今はとても馬鹿げていると感じています。私にとってのエラーは、IoTコンソールで証明書をアクティブ化していないことでした。 これは愚かなことですが、他の人を助けることができます

@hackaprende行き詰まった場所への解決策を共有してくれてありがとう。

これが将来の検索者に役立つ場合に備えて、ここに投稿すると、エラーawscrt.exceptions.AwsCrtError: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.も発生しました。私にとっては、AWSIoTモノの証明書を_アクティブ化_していないことがわかりました。 それを作成した後、それをアクティブ化するための別のステップがあります。

このページは役に立ちましたか?
0 / 5 - 0 評価

関連する問題

banuprathap picture banuprathap  ·  10コメント

satay99 picture satay99  ·  6コメント

victorct-pronto picture victorct-pronto  ·  3コメント

qcabrol picture qcabrol  ·  8コメント

mkozjak picture mkozjak  ·  17コメント