FreeRDP / FreeRDP

FreeRDP is a free remote desktop protocol library and clients
http://www.freerdp.com/
Apache License 2.0
10.81k stars 14.76k forks source link

Freerdp fails to connect with "ERRCONNECT_CONNECT_CANCELLED" #8305

Closed beerdedfellow closed 1 year ago

beerdedfellow commented 1 year ago

Describe the bug I am attempting to use freerdp with a gateway. The tunnel looks to be correctly provisioned through the gateway[1], but then when making the attempt to connect to the target device I get the ERRCONNECT_CONNECT_CANCELLED error and my user session crashes[2]. It might be interesting to note that my user session crashes and I have to log back in when I execute freerdp directly, but not when using RoyalTSX (though I get the exact same error).

[1]

[12:47:28:967] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.tsg] - TSG_STATE_INITIAL -> TSG_STATE_INITIAL
[12:47:28:007] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:28:007] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.tsg] - TsProxyCreateTunnelReadResponse: TSG_PACKET_TYPE_CAPS_RESPONSE
[12:47:28:007] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.tsg] - TSG_STATE_INITIAL -> TSG_STATE_CONNECTED
[12:47:28:007] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.tsg] - TsProxyAuthorizeTunnelWriteRequest
[12:47:28:043] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:28:043] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.tsg] - TsProxyAuthorizeTunnelReadResponse: TSG_PACKET_TYPE_RESPONSE
[12:47:28:043] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.tsg] - TSG_STATE_CONNECTED -> TSG_STATE_AUTHORIZED
[12:47:28:043] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.tsg] - TsProxyMakeTunnelCallWriteRequest
[12:47:28:043] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.tsg] - TsProxyCreateChannelWriteRequest
[12:47:28:091] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:28:091] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.tsg] - TsProxyCreateChannelReadResponse
[12:47:28:091] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.tsg] - TSG_STATE_AUTHORIZED -> TSG_STATE_CHANNEL_CREATED
[12:47:28:091] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.tsg] - TsProxySetupReceivePipeWriteRequest
[12:47:28:091] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.tsg] - TSG_STATE_CHANNEL_CREATED -> TSG_STATE_PIPE_CREATED
[12:47:28:091] [14459:061fa000] [INFO][com.freerdp.core.gateway.tsg] - TS Gateway Connection Success

[2]

[12:47:28:091] [14459:061fa000] [DEBUG][com.freerdp.core.nego] - Routing token looks correctly terminated - use verbatim
[12:47:28:091] [14459:061fa000] [DEBUG][com.freerdp.core.nego] - RequestedProtocols: 3
[12:47:28:192] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:28:192] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:28:193] [14459:061fa000] [DEBUG][com.freerdp.core.nego] - RDP_NEG_RSP
[12:47:28:193] [14459:061fa000] [DEBUG][com.freerdp.core.nego] - RDP_NEG_RSP::flags = { [0x01] |EXTENDED_CLIENT_DATA_SUPPORTED }
[12:47:28:193] [14459:061fa000] [DEBUG][com.freerdp.core.nego] - selected_protocol: 2
[12:47:28:193] [14459:061fa000] [DEBUG][com.freerdp.core.nego] - state: NEGO_STATE_FINAL
[12:47:28:193] [14459:061fa000] [DEBUG][com.freerdp.core.nego] - Negotiated NLA security
[12:47:28:193] [14459:061fa000] [DEBUG][com.freerdp.core.nego] - nego_security_connect with PROTOCOL_HYBRID
[12:47:28:294] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:28:294] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:28:395] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:28:395] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:28:395] [14459:061fa000] [DEBUG][com.winpr.sspi] - InitSecurityInterfaceExA
[12:47:28:395] [14459:061fa000] [DEBUG][com.freerdp.core.nla] - nla_client_init 411 : packageName=Negotiate ; cbMaxToken=12256
[12:47:28:396] [14459:061fa000] [DEBUG][com.winpr.sspi.NTLM] - change state from NTLM_STATE_INITIAL to NTLM_STATE_INITIAL
[12:47:28:396] [14459:061fa000] [DEBUG][com.winpr.sspi.NTLM] - change state from NTLM_STATE_INITIAL to NTLM_STATE_NEGOTIATE
[12:47:28:396] [14459:061fa000] [DEBUG][com.winpr.sspi.NTLM] - Write flags [0xe20882b7] NTLMSSP_NEGOTIATE_UNICODE|NTLMSSP_NEGOTIATE_OEM|NTLMSSP_REQUEST_TARGET|NTLMSSP_NEGOTIATE_SIGN|NTLMSSP_NEGOTIATE_SEAL|NTLMSSP_NEGOTIATE_LM_KEY|NTLMSSP_NEGOTIATE_NTLM|NTLMSSP_NEGOTIATE_ALWAYS_SIGN|NTLMSSP_NEGOTIATE_EXTENDED_SESSION_SECURITY|NTLMSSP_NEGOTIATE_VERSION|NTLMSSP_NEGOTIATE_128|NTLMSSP_NEGOTIATE_KEY_EXCH
[12:47:28:396] [14459:061fa000] [DEBUG][com.winpr.sspi.NTLM] - change state from NTLM_STATE_NEGOTIATE to NTLM_STATE_CHALLENGE
[12:47:28:396] [14459:061fa000] [DEBUG][com.freerdp.core.nla] - Client: Sending Authentication Token
[12:47:28:396] [14459:061fa000] [DEBUG][com.freerdp.core.nla] - NLA.negoToken (length = 40):
[12:47:29:501] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:29:501] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:29:501] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:29:501] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:29:501] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:29:501] [14459:061fa000] [DEBUG][com.freerdp.core.nla] - CredSSP protocol support 6, peer supports 6
[12:47:29:501] [14459:061fa000] [DEBUG][com.winpr.sspi.NTLM] - Read flags [0xe2898235] NTLMSSP_NEGOTIATE_UNICODE|NTLMSSP_REQUEST_TARGET|NTLMSSP_NEGOTIATE_SIGN|NTLMSSP_NEGOTIATE_SEAL|NTLMSSP_NEGOTIATE_NTLM|NTLMSSP_NEGOTIATE_ALWAYS_SIGN|NTLMSSP_TARGET_TYPE_DOMAIN|NTLMSSP_NEGOTIATE_EXTENDED_SESSION_SECURITY|NTLMSSP_NEGOTIATE_TARGET_INFO|NTLMSSP_NEGOTIATE_VERSION|NTLMSSP_NEGOTIATE_128|NTLMSSP_NEGOTIATE_KEY_EXCH
[12:47:29:501] [14459:061fa000] [DEBUG][com.winpr.sspi.NTLM] - change state from NTLM_STATE_CHALLENGE to NTLM_STATE_AUTHENTICATE
[12:47:29:502] [14459:061fa000] [DEBUG][com.winpr.sspi.NTLM] - Write flags [0xe288b235] NTLMSSP_NEGOTIATE_UNICODE|NTLMSSP_REQUEST_TARGET|NTLMSSP_NEGOTIATE_SIGN|NTLMSSP_NEGOTIATE_SEAL|NTLMSSP_NEGOTIATE_NTLM|NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED|NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED|NTLMSSP_NEGOTIATE_ALWAYS_SIGN|NTLMSSP_NEGOTIATE_EXTENDED_SESSION_SECURITY|NTLMSSP_NEGOTIATE_TARGET_INFO|NTLMSSP_NEGOTIATE_VERSION|NTLMSSP_NEGOTIATE_128|NTLMSSP_NEGOTIATE_KEY_EXCH
[12:47:29:502] [14459:061fa000] [DEBUG][com.winpr.sspi.NTLM] - change state from NTLM_STATE_AUTHENTICATE to NTLM_STATE_FINAL
[12:47:29:502] [14459:061fa000] [DEBUG][com.freerdp.core.nla] - Client: Sending Authentication Token
[12:47:29:502] [14459:061fa000] [DEBUG][com.freerdp.core.nla] - NLA.negoToken (length = 524):
[12:47:29:502] [14459:061fa000] [DEBUG][com.freerdp.core.nla] - NLA.pubKeyAuth (length = 48):
[12:47:29:605] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:29:605] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:29:605] [14459:061fa000] [DEBUG][com.freerdp.core.nla] - Client: Sending PubKeyAuth Token
[12:47:29:605] [14459:061fa000] [DEBUG][com.freerdp.core.nla] - NLA.authInfo (length = 115):
[12:47:29:708] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:29:708] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:34:754] [14459:061fa000] [DEBUG][com.freerdp.core.gateway.rts] - Reading PDU type PTYPE_RESPONSE
[12:47:34:755] [14459:061fa000] [ERROR][com.freerdp.core] - freerdp_abort_connect:freerdp_set_last_error_ex ERRCONNECT_CONNECT_CANCELLED [0x0002000B]
[12:47:38:663] [14459:061fa000] [ERROR][com.freerdp.core.connection] - Timeout waiting for activation
[12:47:38:663] [14459:061fa000] [DEBUG][com.freerdp.core] - rdp_check_fds() - -1
[12:47:38:663] [14459:061fa000] [INFO][com.freerdp.client.common] - Network disconnect!
[12:47:38:663] [14459:061fa000] [INFO][com.freerdp.client.common] - Attempting reconnect (1 of 3)
[12:47:38:663] [14459:061fa000] [WARN][com.freerdp.client.common] - Autoreconnect aborted by user
[12:47:38:697] [14459:061fa000] [ERROR][com.freerdp.client.common] - Maximum reconnect retries exceeded      

To Reproduce Execute freerdp. Example command: /usr/local/bin/xfreerdp /cert-ignore /cert-tofu /auto-reconnect /auto-reconnect-max-retries:3 /clipboard /bpp:16 /size:1280x960 /log-level:DEBUG /g:xxx.gateway.xxx.com /gd:XXXXXXXXX /gu:xxxxxxxx /gp:xxxxxxxxxxxxxxxx /v:vts.xxx.xxx.xx.io:3389 /t:vts.xxx.xxx.xxx.io /d:XXXXXXXX /p:xxxxxxxxxxxxxxxxxx /u:xxxxxxxxxxxx

Expected behavior Connection successful. User session does not crash.

Screenshots image

Application details

Environment (please complete the following information):

Additional context Troubleshooting with internal teams, nothing yet identified.

akallabeth commented 1 year ago

[12:47:38:663] [14459:061fa000] [ERROR][com.freerdp.core.connection] - Timeout waiting for activation check your server configuration.

beerdedfellow commented 1 year ago

I didn’t assume the connectivity issue was the fault of freerdp, but why is it crashing my GUI?

Sent via mobile

On Oct 12, 2022, at 10:42 PM, akallabeth @.***> wrote:

 Closed #8305 as completed.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

akallabeth commented 1 year ago

@beerdedfellow which crash are you talking about? you just added a screenshot of some UI to display error return codes?

beerdedfellow commented 1 year ago

I can’t share a screenshot unfortunately because the entire GUI session crashes and I have to log back in. The screenshot I shared was from royalTSX, a gui that uses freerdp as a plug-in.

I’ve since gotten royalTSX to work, but still get the same failure message and GUI crash when executing xfreerdp on the command line. Presumably this is because it’s offering an ssh key (this was the problem with royal), but I’m not sure why freerdp would do that. I’m not specifying a key and no keys were loaded into my ssh agent (but why would ssh matter?). Any chance ssh keys interact with freerdp for some reason?

Appreciate the help.

Sent via mobile

On Oct 13, 2022, at 8:07 AM, akallabeth @.***> wrote:

 @beerdedfellow which crash are you talking about? you just added a screenshot of some UI to display error return codes?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

akallabeth commented 1 year ago

@beerdedfellow ssh key? which GUI are we talking about? (mac? that would be even more strange there as xfreerdp is X11 and could at most crash XQuartz) and nothing in the log indicates something other than a normal program termination.