-
Notifications
You must be signed in to change notification settings - Fork 310
Open
Description
Describe the bug
Dataloader occasionally fails to obtain token even when the OAuth flow (web server) completes successfully within the 60 sec timeframe. It does acquire the token sometimes.
To Reproduce
It's very sporadic unfortunately but I (and some of my users) are more likely to get the error when behind a VPN (corporate or non-corporate VPN). Salesforce org has single sign-on configured with Azure (with MFA).
Steps to reproduce the behavior:
- Launch Dataloader v64.1.0
- Click "Export" or any operation to open the login wizard.
- In the login wizard, choose "OAuth" and either option for Environment as long as SSO is enabled.
- Click "Login"
Expected behavior
The login wizard acquires a token and proceed with operation.
Current behaviour
Occasional error message: "OAuth WebServer with PKCE flow failed. Please try again or use Username Password"
Screenshots
Desktop:
- OS: macOS Sequoia 15.6
- Version 64.1.0
Additional context
config.properties
#Salesforce Data Loader Config
#Wed Sep 03 13:11:07 PDT 2025
sfdc.endpoint.Production=https\://REDACTED.my.salesforce.com/
sfdc.ui.wizard.width=607
sfdc.ui.wizard.height=547
sfdc.ui.wizard.xoffset=193
sfdc.ui.wizard.yoffset=224
log4j2.properties
#Logging config
#Wed Sep 03 12:21:57 PDT 2025
name=Salesforce Data Loader
monitorInterval=5
property.basePath=${sys\:java.io.tmpdir}
appender.rolling.type=RollingFile
appender.rolling.name=fileAppender
appender.rolling.fileName=${basePath}/sdl.log
appender.rolling.filePattern=${basePath}/sdl-%d{yyyy-MM-dd}.log
appender.rolling.layout.type=PatternLayout
appender.rolling.layout.pattern=%d %-5p [%t] %C{2} %M (%F\:%L) - %m%n
appender.rolling.policies.type=Policies
appender.console.type=Console
appender.console.name=STDOUT
appender.console.layout.type=PatternLayout
appender.console.layout.pattern=%d %-5p [%t] %C{2} %M (%F\:%L) - %m%n
appender.rolling.policies.size.type=SizeBasedTriggeringPolicy
appender.rolling.policies.size.size=100KB
rootLogger.level=DEBUG
rootLogger.appenderRef.rolling.ref=fileAppender
rootLogger.appenderRef.stdout.ref=STDOUT
sdl.log
2025-09-03 12:46:37,221 INFO [main] action.OperationInfoUIHelper instantiateWizard (OperationInfoUIHelper.java:113) - Instantiating wizard: extract
2025-09-03 12:46:41,232 INFO [Thread-7] oauth.OAuthFlowHandler handleOAuthLogin (OAuthFlowHandler.java:62) - Starting OAuth flow
2025-09-03 12:46:41,233 INFO [Thread-7] oauth.OAuthFlowHandler handleOAuthLogin (OAuthFlowHandler.java:65) - Attempting OAuth WebServer with PKCE flow, launching browser for login
2025-09-03 12:46:41,234 DEBUG [Thread-7] util.OAuthServerFlow <init> (OAuthServerFlow.java:104) - Using port 7171 for OAuth callback server
2025-09-03 12:46:41,235 DEBUG [Thread-7] util.OAuthServerFlow generatePKCEParameters (OAuthServerFlow.java:210) - Generated PKCE parameters - state: y3ZkkXjC_NEWtxAeWsIEow
2025-09-03 12:46:41,237 INFO [Thread-7] util.OAuthServerFlow startCallbackServer (OAuthServerFlow.java:230) - OAuth callback server started on localhost:7171
2025-09-03 12:46:41,238 INFO [Thread-7] util.OAuthServerFlow performOAuthFlow (OAuthServerFlow.java:143) - Opening browser for OAuth authorization: https://REDACTED.my.salesforce.com//services/oauth2/authorize?response_type=code&client_id=DataLoaderPartnerUI%2F&redirect_uri=http%3A%2F%2Flocalhost%3A7171%2FOauthRedirect&scope=api&state=y3ZkkXjC_NEWtxAeWsIEow&code_challenge=i1tISCoUMDUAFHL5Lt36rmOcTIG0CdjC59jbugW5APA&code_challenge_method=S256
2025-09-03 12:46:41,238 INFO [Thread-7] util.OAuthServerFlow performOAuthFlow (OAuthServerFlow.java:144) - OAuth client_id: DataLoaderPartnerUI/
2025-09-03 12:46:41,238 INFO [Thread-7] util.OAuthServerFlow performOAuthFlow (OAuthServerFlow.java:145) - OAuth redirect_uri: http://localhost:7171/OauthRedirect
2025-09-03 12:46:41,239 DEBUG [Thread-7] ui.URLUtil openURL (URLUtil.java:41) - trying to use desktop.browse() method
2025-09-03 12:46:41,272 INFO [Thread-7] util.OAuthServerFlow performOAuthFlow (OAuthServerFlow.java:157) - Waiting for OAuth authorization (timeout: 60 seconds)...
2025-09-03 12:47:22,827 DEBUG [HTTP-Dispatcher] util.OAuthServerFlow$CallbackHandler handle (OAuthServerFlow.java:392) - Received OAuth callback: /OauthRedirect?code=aPrxehJTnWq6wuEeASP5oUb0ISFVC0g_2Ni5nUxxvsFSj8VwcXYR69u38BZnnL7WqfAHixvX1w%3D%3D&state=y3ZkkXjC_NEWtxAeWsIEow
2025-09-03 12:47:22,829 INFO [HTTP-Dispatcher] util.OAuthServerFlow$CallbackHandler handle (OAuthServerFlow.java:425) - Authorization code received successfully
2025-09-03 12:47:22,830 INFO [Thread-7] util.OAuthServerFlow exchangeCodeForTokens (OAuthServerFlow.java:286) - Exchanging authorization code for tokens
2025-09-03 12:47:22,830 INFO [Thread-7] util.OAuthServerFlow exchangeCodeForTokens (OAuthServerFlow.java:293) - Token exchange using client_id: DataLoaderPartnerUI/, redirect_uri: http://localhost:7171/OauthRedirect
2025-09-03 12:47:22,831 DEBUG [Thread-7] util.OAuthServerFlow exchangeCodeForTokens (OAuthServerFlow.java:310) - Using public client (Connected App) with PKCE only
2025-09-03 12:47:22,832 DEBUG [Thread-7] protocol.RequestAddCookies process (RequestAddCookies.java:123) - CookieSpec selected: default
2025-09-03 12:47:22,833 DEBUG [Thread-7] protocol.RequestAddCookies process (RequestAddCookies.java:168) - Cookie [version: 0][name: BrowserId][value: Q9rRXIj-EfCSERU2WNKUFQ][domain: salesforce.com][path: /][expiry: Thu Sep 03 12:43:28 PDT 2026] match [(secure)REDACTED.my.salesforce.com:443/services/oauth2/token]
2025-09-03 12:47:22,833 DEBUG [Thread-7] protocol.RequestAddCookies process (RequestAddCookies.java:168) - Cookie [version: 0][name: CookieConsentPolicy][value: 0:1][domain: REDACTED.my.salesforce.com][path: /][expiry: Thu Sep 03 12:44:09 PDT 2026] match [(secure)REDACTED.my.salesforce.com:443/services/oauth2/token]
2025-09-03 12:47:22,833 DEBUG [Thread-7] protocol.RequestAddCookies process (RequestAddCookies.java:168) - Cookie [version: 0][name: LSKey-c$CookieConsentPolicy][value: 0:1][domain: REDACTED.my.salesforce.com][path: /][expiry: Thu Sep 03 12:44:09 PDT 2026] match [(secure)REDACTED.my.salesforce.com:443/services/oauth2/token]
2025-09-03 12:47:22,834 DEBUG [Thread-7] protocol.RequestAuthCache process (RequestAuthCache.java:77) - Auth cache not set in the context
2025-09-03 12:47:22,834 DEBUG [Thread-7] conn.PoolingHttpClientConnectionManager requestConnection (PoolingHttpClientConnectionManager.java:267) - Connection request: [route: {s}->https://REDACTED.my.salesforce.com:443][total available: 3; route allocated: 1 of 5; total allocated: 3 of 10]
2025-09-03 12:47:22,836 DEBUG [Thread-7] conn.Wire wire (Wire.java:87) - http-outgoing-2 << "[read] I/O error: Read timed out"
2025-09-03 12:47:22,837 DEBUG [Thread-7] conn.PoolingHttpClientConnectionManager leaseConnection (PoolingHttpClientConnectionManager.java:312) - Connection leased: [id: 2][route: {s}->https://REDACTED.my.salesforce.com:443][total available: 2; route allocated: 1 of 5; total allocated: 3 of 10]
2025-09-03 12:47:22,837 DEBUG [Thread-7] conn.LoggingManagedHttpClientConnection setSocketTimeout (LoggingManagedHttpClientConnection.java:88) - http-outgoing-2: set socket timeout to 0
2025-09-03 12:47:22,838 DEBUG [Thread-7] execchain.MainClientExec execute (MainClientExec.java:255) - Executing request POST /services/oauth2/token HTTP/1.1
2025-09-03 12:47:22,838 DEBUG [Thread-7] execchain.MainClientExec execute (MainClientExec.java:260) - Target auth state: UNCHALLENGED
2025-09-03 12:47:22,838 DEBUG [Thread-7] execchain.MainClientExec execute (MainClientExec.java:266) - Proxy auth state: UNCHALLENGED
2025-09-03 12:47:22,838 DEBUG [Thread-7] conn.LoggingManagedHttpClientConnection onRequestSubmitted (LoggingManagedHttpClientConnection.java:133) - http-outgoing-2 >> POST /services/oauth2/token HTTP/1.1
2025-09-03 12:47:22,839 DEBUG [Thread-7] conn.LoggingManagedHttpClientConnection onRequestSubmitted (LoggingManagedHttpClientConnection.java:136) - http-outgoing-2 >> User-Agent: Salesforce Web Service Connector For Java/1.0
2025-09-03 12:47:22,839 DEBUG [Thread-7] conn.LoggingManagedHttpClientConnection onRequestSubmitted (LoggingManagedHttpClientConnection.java:136) - http-outgoing-2 >> client_id: DataLoaderPartnerUI/
2025-09-03 12:47:22,840 DEBUG [Thread-7] conn.LoggingManagedHttpClientConnection onRequestSubmitted (LoggingManagedHttpClientConnection.java:136) - http-outgoing-2 >> Sforce-Call-Options: client=DataLoaderPartnerUI/64.1.0
2025-09-03 12:47:22,840 DEBUG [Thread-7] conn.LoggingManagedHttpClientConnection onRequestSubmitted (LoggingManagedHttpClientConnection.java:136) - http-outgoing-2 >> Content-Length: 265
2025-09-03 12:47:22,840 DEBUG [Thread-7] conn.LoggingManagedHttpClientConnection onRequestSubmitted (LoggingManagedHttpClientConnection.java:136) - http-outgoing-2 >> Content-Type: application/x-www-form-urlencoded
2025-09-03 12:47:22,840 DEBUG [Thread-7] conn.LoggingManagedHttpClientConnection onRequestSubmitted (LoggingManagedHttpClientConnection.java:136) - http-outgoing-2 >> Host: REDACTED.my.salesforce.com
2025-09-03 12:47:22,840 DEBUG [Thread-7] conn.LoggingManagedHttpClientConnection onRequestSubmitted (LoggingManagedHttpClientConnection.java:136) - http-outgoing-2 >> Connection: Keep-Alive
2025-09-03 12:47:22,840 DEBUG [Thread-7] conn.LoggingManagedHttpClientConnection onRequestSubmitted (LoggingManagedHttpClientConnection.java:136) - http-outgoing-2 >> Cookie: BrowserId=Q9rRXIj-EfCSERU2WNKUFQ; CookieConsentPolicy=0:1; LSKey-c$CookieConsentPolicy=0:1
2025-09-03 12:47:22,840 DEBUG [Thread-7] conn.LoggingManagedHttpClientConnection onRequestSubmitted (LoggingManagedHttpClientConnection.java:136) - http-outgoing-2 >> Accept-Encoding: gzip,deflate
2025-09-03 12:47:22,840 DEBUG [Thread-7] conn.Wire wire (Wire.java:73) - http-outgoing-2 >> "POST /services/oauth2/token HTTP/1.1[\r][\n]"
2025-09-03 12:47:22,840 DEBUG [Thread-7] conn.Wire wire (Wire.java:73) - http-outgoing-2 >> "User-Agent: Salesforce Web Service Connector For Java/1.0[\r][\n]"
2025-09-03 12:47:22,840 DEBUG [Thread-7] conn.Wire wire (Wire.java:73) - http-outgoing-2 >> "client_id: DataLoaderPartnerUI/[\r][\n]"
2025-09-03 12:47:22,841 DEBUG [Thread-7] conn.Wire wire (Wire.java:73) - http-outgoing-2 >> "Sforce-Call-Options: client=DataLoaderPartnerUI/64.1.0[\r][\n]"
2025-09-03 12:47:22,841 DEBUG [Thread-7] conn.Wire wire (Wire.java:73) - http-outgoing-2 >> "Content-Length: 265[\r][\n]"
2025-09-03 12:47:22,841 DEBUG [Thread-7] conn.Wire wire (Wire.java:73) - http-outgoing-2 >> "Content-Type: application/x-www-form-urlencoded[\r][\n]"
2025-09-03 12:47:22,841 DEBUG [Thread-7] conn.Wire wire (Wire.java:73) - http-outgoing-2 >> "Host: REDACTED.my.salesforce.com[\r][\n]"
2025-09-03 12:47:22,841 DEBUG [Thread-7] conn.Wire wire (Wire.java:73) - http-outgoing-2 >> "Connection: Keep-Alive[\r][\n]"
2025-09-03 12:47:22,841 DEBUG [Thread-7] conn.Wire wire (Wire.java:73) - http-outgoing-2 >> "Cookie: BrowserId=Q9rRXIj-EfCSERU2WNKUFQ; CookieConsentPolicy=0:1; LSKey-c$CookieConsentPolicy=0:1[\r][\n]"
2025-09-03 12:47:22,841 DEBUG [Thread-7] conn.Wire wire (Wire.java:73) - http-outgoing-2 >> "Accept-Encoding: gzip,deflate[\r][\n]"
2025-09-03 12:47:22,841 DEBUG [Thread-7] conn.Wire wire (Wire.java:73) - http-outgoing-2 >> "[\r][\n]"
2025-09-03 12:47:22,841 DEBUG [Thread-7] conn.Wire wire (Wire.java:87) - http-outgoing-2 >> "grant_type=authorization_code&client_id=DataLoaderPartnerUI%2F&code=aPrxehJTnWq6wuEeASP5oUb0ISFVC0g_2Ni5nUxxvsFSj8VwcXYR69u38BZnnL7WqfAHixvX1w%3D%3D&redirect_uri=http%3A%2F%2Flocalhost%3A7171%2FOauthRedirect&code_verifier=kWopOF0-AL6r41Yzi00A4h34EVgtEsEZYW9vDi94yMk"
2025-09-03 12:47:22,873 DEBUG [Thread-7] conn.Wire wire (Wire.java:87) - http-outgoing-2 << "[read] I/O error: Connection reset"
2025-09-03 12:47:22,873 DEBUG [Thread-7] conn.LoggingManagedHttpClientConnection close (LoggingManagedHttpClientConnection.java:79) - http-outgoing-2: Close connection
2025-09-03 12:47:22,873 DEBUG [Thread-7] conn.LoggingManagedHttpClientConnection shutdown (LoggingManagedHttpClientConnection.java:96) - http-outgoing-2: Shutdown connection
2025-09-03 12:47:22,873 DEBUG [Thread-7] execchain.ConnectionHolder abortConnection (ConnectionHolder.java:129) - Connection discarded
2025-09-03 12:47:22,873 DEBUG [Thread-7] conn.PoolingHttpClientConnectionManager releaseConnection (PoolingHttpClientConnectionManager.java:351) - Connection released: [id: 2][route: {s}->https://REDACTED.my.salesforce.com:443][total available: 2; route allocated: 0 of 5; total allocated: 2 of 10]
2025-09-03 12:47:22,874 ERROR [Thread-7] util.OAuthServerFlow exchangeCodeForTokens (OAuthServerFlow.java:380) - Failed to exchange authorization code for tokens
java.net.SocketException: Connection reset
at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:318)
at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:346)
at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:796)
at java.base/java.net.Socket$SocketInputStream.implRead(Socket.java:1116)
at java.base/java.net.Socket$SocketInputStream.read(Socket.java:1103)
at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:489)
at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:483)
at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:70)
at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1462)
at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:1068)
at org.apache.http.impl.conn.LoggingInputStream.read(LoggingInputStream.java:84)
at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:137)
at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:153)
at org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:280)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163)
at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:157)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at com.salesforce.dataloader.client.transport.HttpTransportImpl.getContent(HttpTransportImpl.java:234)
at com.salesforce.dataloader.client.transport.HttpTransportImpl.simplePost(HttpTransportImpl.java:415)
at com.salesforce.dataloader.client.transport.SimplePostImpl.post(SimplePostImpl.java:74)
at com.salesforce.dataloader.util.OAuthServerFlow.exchangeCodeForTokens(OAuthServerFlow.java:320)
at com.salesforce.dataloader.util.OAuthServerFlow.performOAuthFlow(OAuthServerFlow.java:162)
at com.salesforce.dataloader.util.OAuthServerFlow.performOAuthFlow(OAuthServerFlow.java:114)
at com.salesforce.dataloader.oauth.OAuthFlowHandler.handleOAuthLogin(OAuthFlowHandler.java:71)
at com.salesforce.dataloader.ui.AuthenticationRunner.loginAsync(AuthenticationRunner.java:108)
at com.salesforce.dataloader.ui.AuthenticationRunner.lambda$login$0(AuthenticationRunner.java:90)
at java.base/java.lang.Thread.run(Thread.java:1575)
2025-09-03 12:47:22,875 INFO [Thread-7] util.OAuthServerFlow stopCallbackServer (OAuthServerFlow.java:255) - OAuth callback server stopped
2025-09-03 12:47:22,876 ERROR [Thread-7] oauth.OAuthFlowHandler handleOAuthLogin (OAuthFlowHandler.java:103) - OAuth WebServer with PKCE flow failed
Metadata
Metadata
Assignees
Labels
No labels