Skip to content
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

Crash after connection interruption due to an authorization error #11

Open
Octogonapus opened this issue May 17, 2022 · 0 comments
Open
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@Octogonapus
Copy link
Owner

Octogonapus commented May 17, 2022

I experienced a crash after a connection interruption due to an authorization error (due to publishing to a topic I didn't have permissions for). I'm not sure if this is a bug in my wrapper or in the C libraries.

AWSCRT v0.1.0. Julia v1.7.2.

mqtt_client = MQTTClient(
    ClientTLSContext(
        create_client_with_mtls(
            certificate_pem,
            private_key;
            ca_filepath = joinpath(@__DIR__, "AmazonRootCA1.pem"),
        ),
    ),
)
mqtt_connection = MQTTConnection(mqtt_client)
t = connect(
    mqtt_connection,
    terraform_output(env, "endpoint_url"),
    8883,
    mqtt_client_id;
    on_connection_interrupted = (conn, error_code) -> begin
        @warn "MQTT connection interrupted: $(AWSCRT.aws_err_string(error_code))"
    end,
    on_connection_resumed = (conn, return_code, session_present) -> begin
        @info "MQTT connection resumed" return_code session_present
        if !session_present
            # the server forgot all our subscriptions, so we have to resubscribe from our end
            resub_task = resubscribe_existing_topics(conn)
            @async begin
                resub_task_result = fetch(resub_task)
                @info "Resubscribed existing topics" resub_task_result
            end
        end
    end,
)
┌ Warning: MQTT connection interrupted: AWS Error 5134: libaws-c-mqtt: AWS_ERROR_MQTT_UNEXPECTED_HANGUP, The connection was closed unexpectedly.
└ @ Main REPL[174]:7
┌ Info: MQTT connection resumed
│   return_code = AWS_MQTT_CONNECT_ACCEPTED::aws_mqtt_connect_return_code = 0x00000000
└   session_present = false

Fatal error condition occurred in /workspace/x86_64-linux-gnu-libgfortran3-cxx11/destdir/include/aws/common/array_list.inl:338: !list->length || list->data
Exiting Application
################################################################################
Stack trace:
################################################################################
/home/salmon/.julia/artifacts/92d49a7c9ad8f335cef3f3863856a100fdb18f04/lib/libawscrt.so(aws_backtrace_print+0x41) [0x7ff664b188b1]
/home/salmon/.julia/artifacts/92d49a7c9ad8f335cef3f3863856a100fdb18f04/lib/libawscrt.so(aws_fatal_assert+0x43) [0x7ff664b087d3]
/home/salmon/.julia/artifacts/92d49a7c9ad8f335cef3f3863856a100fdb18f04/lib/libawscrt.so(+0x67532) [0x7ff664ae7532]
/home/salmon/.julia/artifacts/92d49a7c9ad8f335cef3f3863856a100fdb18f04/lib/libawscrt.so(+0xf75cb) [0x7ff664b775cb]
/home/salmon/.julia/artifacts/92d49a7c9ad8f335cef3f3863856a100fdb18f04/lib/libawscrt.so(+0xfd0e5) [0x7ff664b7d0e5]
/home/salmon/.julia/artifacts/92d49a7c9ad8f335cef3f3863856a100fdb18f04/lib/libawscrt.so(+0xd93b6) [0x7ff664b593b6]
/home/salmon/.julia/artifacts/92d49a7c9ad8f335cef3f3863856a100fdb18f04/lib/libawscrt.so(+0x9b4de) [0x7ff664b1b4de]
/home/salmon/.julia/artifacts/92d49a7c9ad8f335cef3f3863856a100fdb18f04/lib/libawscrt.so(+0xe4338) [0x7ff664b64338]
/home/salmon/.julia/artifacts/92d49a7c9ad8f335cef3f3863856a100fdb18f04/lib/libawscrt.so(+0x99133) [0x7ff664b19133]
/lib64/libpthread.so.0(+0x92a5) [0x7ff723a3a2a5]
/lib64/libc.so.6(clone+0x43) [0x7ff723962323]

signal (6): Aborted
@Octogonapus Octogonapus added bug Something isn't working question Further information is requested labels May 17, 2022
@Octogonapus Octogonapus self-assigned this May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant