CSWeb Error connecting to sync server

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Forum rules
New release: CSPro 8.0
Post Reply
wesnich
Posts: 11
Joined: June 5th, 2019, 11:16 pm

CSWeb Error connecting to sync server

Post by wesnich »

I am trying to sync the Data Viewer with our CSWeb server. I enter my connection settings and the Connect button works bringing up a list of dictionaries. I select a dictionary and receive the "Error connecting to sync server" message.

I can get a token from my credentials and see the dictionary list so I know I can connect. The server logs show HTTP 206 responses that correspond with the "Network error" messages in my sync.log. There is nothing in the api.log file for these requests. I have included my sync.log output below.

Any ideas what is wrong? What I should look at to track down the issue?

sync.log output
05/06/2019 23:11:35.968 INFO: Connect to server https:// host.com /api using saved credentials
05/06/2019 23:11:35.968 INFO: Connect to server https:// host.com /api
05/06/2019 23:11:35.968 INFO: Set listener
05/06/2019 23:11:35.968 INFO: On start
05/06/2019 23:11:35.000 INFO: Call connect
05/06/2019 23:11:43.562 INFO: Server API version: 1.1
05/06/2019 23:11:43.562 INFO: Connection successful. Server id: https:// host.com:443 /api/
05/06/2019 23:11:43.562 INFO: Downloading dictionary list
05/06/2019 23:11:43.765 INFO: Downloading dictionary list complete
05/06/2019 23:12:28.062 INFO: Downloading dictionary file: HOUSEHOLD_DICT
05/06/2019 23:12:28.375 INFO: Downloading dictionary file complete
05/06/2019 23:12:28.718 INFO: Syncing data: household.csdb direction GET universe ""
05/06/2019 23:12:28.718 INFO: First time GET with this server
05/06/2019 23:12:28.718 INFO: Start case download with chunk size of 100
05/06/2019 23:12:29.828 ERROR: Network error:
05/06/2019 23:12:29.828 INFO: Retrying. Attempt #1
05/06/2019 23:12:29.375 ERROR: Network error:
05/06/2019 23:12:29.375 INFO: Retrying. Attempt #2
05/06/2019 23:12:30.765 ERROR: Network error:
05/06/2019 23:12:30.765 INFO: Retrying. Attempt #3
05/06/2019 23:12:32.437 ERROR: Network error:
05/06/2019 23:12:34.187 ERROR: Error syncing data: 100119
05/06/2019 23:12:34.187 INFO: Disconnecting from server
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: CSWeb Error connecting to sync server

Post by josh »

The 206 should be treated as success by CSEntry - it means partial content. What is strange is that the log file should contain some text for the message other than just "Network error" but for some reason the error is blank. If you are able to share the server url, username and password I could run it on my machine in the debugger and see if I can get more details. You can send them via private message or email to cspro@lists.census.gov.
wesnich
Posts: 11
Joined: June 5th, 2019, 11:16 pm

Re: CSWeb Error connecting to sync server

Post by wesnich »

josh helped find a solution for this. Posting it for anyone else that may need it.

The issue was our server was not responding to the the close notify during dictionary case download. This is not obvious from the sync.log of the Data Viewer. It doesn't show up when I test in PostMan either. Test with the curl command that comes with Win 10 because it uses WinSsl like the cs pro software.

I ran the GET cspro/api/dictionaries/{dict_name}/cases and sent a bearer token for authorization. The output from curl will be the json data followed by an error: curl: (56) Failure when receiving data from the peer. Setting the --trace-ascii flag you can see something similar to this:
== Info: schannel: schannel_recv cleanup
== Info: schannel: server closed abruptly (missing close_notify)
== Info: Closing connection 0
== Info: schannel: shutting down SSL/TLS connection with csprostage.wesdemo.com port 443
== Info: schannel: clear security context handle

This setup works when using curl with OpenSsl but not WinSsl.

The solution was to configure our Apache server with ssl-accurate-shutdown:
BrowserMatch "CSPro sync" ssl-accurate-shutdown

CSPro sync is the user agent value sent by the Data Viewer.

Hope this is helpful to someone.
Post Reply