+ Start a Discussion
RalphCallawayRalphCallaway 

Trapdoor Fails Silently Consistently for Certain Orgs

I use trapdoor for a ton of different orgs. I've run into an issue now for two orgs where when I login nothing happens. I don't get an error message that the crendentials are expired and the browser doesn't open.

It's fairly rare, but it happens 100% of the time for these orgs. Login history in salesforce shows a successful login from Trapdoor.

I've tried deleting the credentails directly from Trapdoor, and also from KeyChain. But I still have the same issue after I add the credentials back to Trapdoor.

Anyone encountered this and have suggestions for a fix? Is there any logging done by trapdoor that can be used to troubleshoot?
RalphCallawayRalphCallaway
This also appears to be a machine specific issue, I had a colleague add the credentials to trapdoor on another machine and login worked as expected. Very strange 
RalphCallawayRalphCallaway
Got the following suggestions from the twittersphere
@ralphatccc sounds odd, I’d start by reviewing the console log /Applications/Utilities/Console.app when you trigger the login
@ralphatccc Also make sure you have the latest version as that’s the only one with the TLS 1.2 support in it.
@ralphatccc v1.10

Confirmed v1.10. Console logs show trapdoor is getting an unexpected response from salesforce, not sure why.
2/7/17 2:45:09.611 PM Trapdoor[5750]: response XML not valid SOAP, root element should be Envelope, but was html
2/7/17 2:45:09.613 PM Trapdoor[5750]: (
	0   CoreFoundation                      0x00007fff96e2a03c __exceptionPreprocess + 172
	1   libobjc.A.dylib                     0x00007fff9393176e objc_exception_throw + 43
	2   Trapdoor                            0x000000010439d565 Trapdoor + 54629
	3   Trapdoor                            0x000000010439412f Trapdoor + 16687
	4   Trapdoor                            0x0000000104392297 Trapdoor + 8855
	5   Trapdoor                            0x00000001043927f1 Trapdoor + 10225
	6   Trapdoor                            0x0000000104392a11 Trapdoor + 10769
	7   libsystem_trace.dylib               0x00007fff96773cd7 _os_activity_initiate + 75
	8   AppKit                              0x00007fff90102eb1 -[NSApplication sendAction:to:from:] + 452
	9   AppKit                              0x00007fff90102c4e -[NSMenuItem _corePerformAction] + 382
	10  AppKit                              0x00007fff9010297c -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 114
	11  libsystem_trace.dylib               0x00007fff96773cd7 _os_activity_initiate + 75
	12  AppKit                              0x00007fff901c9b00 -[NSMenu performActionForItemAtIndex:] + 131
	13  AppKit                              0x00007fff9033794f -[NSApplication _sendDockMenuCommand:withTag:modifierFlags:] + 244
	14  HIToolbox                           0x00007fff9974688c _ZL12DockCallbackjjPvS_ + 1845
	15  HIServices                          0x00007fff933a7257 _DCXDoMenuCommand + 47
	16  HIServices                          0x00007fff933c7cf8 _XDoMenuCommand + 44
	17  HIServices                          0x00007fff93394119 mshMIGPerform + 199
	18  CoreFoundation                      0x00007fff96d46c79 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
	19  CoreFoundation                      0x00007fff96d46beb __CFRunLoopDoSource1 + 475
	20  CoreFoundation                      0x00007fff96d38767 __CFRunLoopRun + 2375
	21  CoreFoundation                      0x00007fff96d37bd8 CFRunLoopRunSpecific + 296
	22  HIToolbox                           0x00007fff9972b56f RunCurrentEventLoopInMode + 235
	23  HIToolbox                           0x00007fff9972b2ea ReceiveNextEventCommon + 431
	24  HIToolbox                           0x00007fff9972b12b _BlockUntilNextEventMatchingListInModeWithFilter + 71
	25  AppKit                              0x00007fff8ff3f8ab _DPSNextEvent + 978
	26  AppKit                              0x00007fff8ff3ee58 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 346
	27  AppKit                              0x00007fff8ff34af3 -[NSApplication run] + 594
	28  AppKit                              0x00007fff8feb1244 NSApplicationMain + 1832
	29  libdyld.dylib                       0x00007fff99a025c9 start + 1
)

 
RalphCallawayRalphCallaway
Logs from salesforce login history for the above login
Login Time (Central Daylight Time): 2/7/17 15:45
Login Type: Partner Product
Status: Success
BrowserUnknown
PlatformiOS/Mac
ApplicationMac Trapdoor
Client Version1.1
API TypeSOAP Partner
API Version17
Login URLwww.salesforce.com
TLS ProtocolTLS 1.2
TLS Cipher SuiteECDHE-RSA-AES256-SHA384
RalphCallawayRalphCallaway
Raw html response after using debug version of trapdoor
2/9/17 11:12:57.017 AM Trapdoor[2852]: got unparsable response






<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 405 Only POST allowed</title>
</head>
<body><h2>HTTP ERROR 405</h2>
<p>Problem accessing /services/Soap/u/17.0/ORG_ID_REDACTED. Reason:
<pre>    Only POST allowed</pre></p><hr /><i><small>Powered by Jetty://</small></i><br/>




<!-- Body events -->
<script type="text/javascript">function bodyOnLoad(){if(window.PreferenceBits){window.PreferenceBits.prototype.csrfToken="null";};}function bodyOnBeforeUnload(){}function bodyOnFocus(){}function bodyOnUnload(){}</script>
			
</body>
</html>


<!--
...................................................................................................
...................................................................................................
...................................................................................................
...................................................................................................
-->

 
RalphCallawayRalphCallaway
not sure why, but seems like we have a pattern, the target org is on the same pod as another org with my domain. somewhere in the flow there is a 302 redirect that is saying to use the my domain for a separate org, which appears to be causing a downstream issue

perhaps 302 redirects could just be ignored? or is there a cookie cache somewhere that could be cleared so salesforce doesn't redirect to mydomain unless the request is truly for that org?

redacted log, important things to note "<redacted_org_id>" is for the target org, but the "<redacted_my_domain>" is for a different org id on the same data center/pod. so it doesn't make any sense for https://na22.salesforce.com/services/Soap/u/17.0/<redacted_org_id>, to redirect to https://<redacted_my_domain>.my.salesforce.com/services/Soap/u/17.0/<redacted_org_id>
2/13/17 11:33:41.338 PM Trapdoor[40912]: NSURLConnection: willSendRequest POST https://www.salesforce.com/services/Soap/u/17.0
2/13/17 11:33:42.185 PM Trapdoor[40912]: didRecvResponse statusCode 200
headers {
    "Cache-Control" = "s-maxage=0";
    "Content-Encoding" = gzip;
    "Content-Length" = 764;
    "Content-Type" = "text/xml; charset=utf-8";
    Date = "Tue, 14 Feb 2017 06:33:41 GMT";
    Vary = "Accept-Encoding";
}
2/13/17 11:33:42.187 PM Trapdoor[40912]: NSURLConnection: willSendRequest POST https://na22.salesforce.com/services/Soap/u/17.0/<redacted_org_id>
2/13/17 11:33:42.523 PM Trapdoor[40912]: NSURLConnection: willSendRequest GET https://<redacted_my_domain>.my.salesforce.com/services/Soap/u/17.0/<redacted_org_id>
2/13/17 11:33:42.523 PM Trapdoor[40912]: redirect received from server <NSHTTPURLResponse: 0x60800003d620> { URL: https://na22.salesforce.com/services/Soap/u/17.0/<redacted_org_id> } { status code: 302, headers {
    "Content-Length" = 0;
    Date = "Tue, 14 Feb 2017 06:33:42 GMT";
    Location = "https://<redacted_my_domain>.my.salesforce.com/services/Soap/u/17.0/<redacted_org_id>";
} }
2/13/17 11:33:42.523 PM Trapdoor[40912]: statusCode 302 headers {
    "Content-Length" = 0;
    Date = "Tue, 14 Feb 2017 06:33:42 GMT";
    Location = "https://<redacted_my_domain>.my.salesforce.com/services/Soap/u/17.0/<redacted_org_id>";
}
2/13/17 11:33:42.956 PM Trapdoor[40912]: didRecvResponse statusCode 405
headers {
    "Content-Security-Policy" = "referrer origin-when-cross-origin";
    "Content-Security-Policy-Report-Only" = "default-src https:; script-src https: 'unsafe-inline' 'unsafe-eval'; style-src https: 'unsafe-inline'; img-src https: data:; frame-ancestors 'self' *.salesforce.com *.force.com; font-src https: data:; connect-src 'self' https:; report-uri /_/ContentDomainCSPNoAuth?type=mydomain; base-uri http://<redacted_my_domain>.my.salesforce.com/ex/405.jsp";
    "Content-Type" = "text/html; charset=UTF-8";
    Date = "Tue, 14 Feb 2017 06:33:42 GMT";
    "Public-Key-Pins-Report-Only" = "pin-sha256=\"9n0izTnSRF+W4W4JTq51avSXkWhQB8duS2bxVLfzXsY=\"; pin-sha256=\"6m4uJ26w5zoo/DLDmYNWG1dWpZ8/GSCPe6SBri8Euw0=\"; max-age=86400; report-uri=\"https://calm-dawn-26291.herokuapp.com/hpkp-report/00DA0000000ZBk9\";";
    "Strict-Transport-Security" = "max-age=31536000; includeSubDomains";
    "Transfer-Encoding" = Identity;
}
2/13/17 11:33:42.956 PM Trapdoor[40912]: request send to https://na22.salesforce.com/services/Soap/u/17.0/<redacted_org_id>
<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/' xmlns='urn:partner.soap.sforce.com'><s:Header><SessionHeader><sessionId>REDACTED</sessionId></SessionHeader><CallOptions><client>MacTrapdoor/1.10</client></CallOptions></s:Header><s:Body><describeGlobal></describeGlobal></s:Body></s:Envelope>
2/13/17 11:33:42.957 PM Trapdoor[40912]: got unparsable response






<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 405 Only POST allowed</title>
</head>
<body><h2>HTTP ERROR 405</h2>
<p>Problem accessing /services/Soap/u/17.0/<redacted_org_id>. Reason:
<pre>    Only POST allowed</pre></p><hr /><i><small>Powered by Jetty://</small></i><br/>




<!-- Body events -->
<script type="text/javascript">function bodyOnLoad(){if(window.PreferenceBits){window.PreferenceBits.prototype.csrfToken="null";};}function bodyOnBeforeUnload(){}function bodyOnFocus(){}function bodyOnUnload(){}</script>
			
</body>
</html>


<!--
...................................................................................................
...................................................................................................
...................................................................................................
...................................................................................................
-->
2/13/17 11:33:42.957 PM Trapdoor[40912]: response XML not valid SOAP, root element should be Envelope, but was html
2/13/17 11:33:42.959 PM Trapdoor[40912]: (
	0   CoreFoundation                      0x00007fff94f6303c __exceptionPreprocess + 172
	1   libobjc.A.dylib                     0x00007fff91a6a76e objc_exception_throw + 43
	2   Trapdoor                            0x00000001078d2939 -[ZKBaseClient sendRequest:returnRoot:] + 1041
	3   Trapdoor                            0x00000001078c9306 -[ZKSforceClient describeGlobal] + 264
	4   Trapdoor                            0x00000001078c7460 -[AppController describeSomethingWithUrls:] + 64
	5   Trapdoor                            0x00000001078c79ba -[AppController launchSalesforceForClient:andCredential:] + 68
	6   Trapdoor                            0x00000001078c7bda -[AppController completeLogin:] + 188
	7   libsystem_trace.dylib               0x00007fff948accd7 _os_activity_initiate + 75
	8   AppKit                              0x00007fff8e23beb1 -[NSApplication sendAction:to:from:] + 452
	9   AppKit                              0x00007fff8e23bc4e -[NSMenuItem _corePerformAction] + 382
	10  AppKit                              0x00007fff8e23b97c -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 114
	11  libsystem_trace.dylib               0x00007fff948accd7 _os_activity_initiate + 75
	12  AppKit                              0x00007fff8e302b00 -[NSMenu performActionForItemAtIndex:] + 131
	13  AppKit                              0x00007fff8e47094f -[NSApplication _sendDockMenuCommand:withTag:modifierFlags:] + 244
	14  HIToolbox                           0x00007fff9787f88c _ZL12DockCallbackjjPvS_ + 1845
	15  HIServices                          0x00007fff914e0257 _DCXDoMenuCommand + 47
	16  HIServices                          0x00007fff91500cf8 _XDoMenuCommand + 44
	17  HIServices                          0x00007fff914cd119 mshMIGPerform + 199
	18  CoreFoundation                      0x00007fff94e7fc79 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
	19  CoreFoundation                      0x00007fff94e7fbeb __CFRunLoopDoSource1 + 475
	20  CoreFoundation                      0x00007fff94e71767 __CFRunLoopRun + 2375
	21  CoreFoundation                      0x00007fff94e70bd8 CFRunLoopRunSpecific + 296
	22  HIToolbox                           0x00007fff9786456f RunCurrentEventLoopInMode + 235
	23  HIToolbox                           0x00007fff978642ea ReceiveNextEventCommon + 431
	24  HIToolbox                           0x00007fff9786412b _BlockUntilNextEventMatchingListInModeWithFilter + 71
	25  AppKit                              0x00007fff8e0788ab _DPSNextEvent + 978
	26  AppKit                              0x00007fff8e077e58 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 346
	27  AppKit                              0x00007fff8e06daf3 -[NSApplication run] + 594
	28  AppKit                              0x00007fff8dfea244 NSApplicationMain + 1832
	29  libdyld.dylib                       0x00007fff97b3b5c9 start + 1
)