Consortium Reader for Elector

Consortium Reader for Elector

This is the reader that uses the 2022 protocol specification.
For the legacy parser see the Consortium Parser page that uses the previous data specification.

Table of Contents:

Setup

The reader needs to be pointed at the correct database and have the correct authentication (user Id and password) information to make the right connections. To do this use
File menu - Preferences.

image-20250122-221723.png

Import / Synch Ridings, Parties, Candidates

The menu item - File - Synchronize Database will connect to the election data server and pull in the riding, party and candidate data. Then it compares it to what is in the selected Elector Database and makes updates and adds missing records as appropriate.

  • Inserts missing

    • Parties (by party code)

    • Ridings (by riding number)

    • Candidates by comparing

      • riding number and party code

      • (then if necessary) candidate last name

      • (then if necessary) candidate first name

  • Updates

    • Riding Poll Counts and Elector Counts

    • Candidate ballot order values

  • Logs

    • Candidates found in the Elector database that are not in the Consortium data feed.

Running

When it starts the reader displays:

  • The database it’s connected to

  • the election name and date that it is processing

in the bottom status bar: (updates every 5 seconds approximately)

  • the number of reports in the Queue to be processed

  • the last report it processed and the time it processed it at

  • if the reader is up-to-date or not

image-20250428-141150.png

 

Logs

The logs always start with the version number of the application when it launches.

Info: Consortium Reader for Elector Launched - Version 1.0.1.0

When you start the reader it generates a log like:

1/22/2025 17:10:00 Info: Started reading the datafeed 1/22/2025 17:10:00 Info: SELECT ID, cnd_ridingID, cnd_datafeedID FROM elc_candidates WHERE cnd_date = '2025-01-21' AND cnd_datafeedID IS NOT NULL 1/22/2025 17:10:00 Info: {"recordType":"begin","beginServerTime":"2025-01-22T17:10:00-0500","electionName":"2025 Federal General Election","beginOptions":{"heartbeat":true,"latestOnly":false,"startAt":1}}

When you stop the reader it generates a log like:

1/22/2025 10:10:06 Info: Stopped reading datafeed

Heartbeat

You may see heartbeat messages logged and these just help to indicate that the parser is still able to receive updates from the server.

1/22/2025 16:25:24 Info: {"recordType":"heartbeat","heartbeatTime":"2025-01-22T16:25:24-0500"}

Final Reports

Each time a riding gets its final report (when total polls = polls reporting) it logs the record with its riding number.

Final report for 18 with 211 of 211 polls. {"ballotOrderVotes":[9858,21758,1054,1121,11895],"dataSourceId":"E","isAdvancePollCountingComplete":1,"isAllCountingComplete":1,"leadingParties":["LIB"],"numPolls":"211","numPollsFinishedReporting":"211","recordType":"vote","voteDistrictId":"18","voteRecordId":8897,"voteRecordTime":"2025-04-28 10:35:57"}

Dropped Connections

If the application loses it’s connection to the server you may see entries like this:

1/22/2025 9:54:55 Exception: ReadBuffer(): Unable to read data from the transport connection: The connection was closed. 1/22/2025 9:54:55 Info: ReadBuffer(): done 1/22/2025 9:55:54 Info: ReadBuffer not running. Restarting. 1/22/2025 9:55:55 Info: {"recordType":"begin","beginServerTime":"2025-01-22T09:55:55-0500","electionName":"2025 Federal General Election","beginOptions":{"heartbeat":false,"latestOnly":false,"startAt":3431}}

Debug Logging

For greater details in the logs - turn on the Debug Logging option in the menu
Help - Diagnostics - Debug Logging

If there is a checkmark beside it then it is enabled.

Debug Logging Messages

When Debug is enabled, it reports each record as it processes it. That way if it has an error in the processing or stops working you can know what it was doing when that happened. Example:

1/22/2025   16:24:54    Debug:      [3,{"ballotOrderVotes":[27,22,381,372],"dataSourceId":"E","isAdvancePollCountingComplete":0,"isAllCountingComplete":0,"leadingParties":["NDP"],"numPolls":60,"numPollsFinishedReporting":2,"recordType":"vote","voteDistrictId":6,"voteRecordId":3,"voteRecordTime":"2025-01-21 13:02:11"}] 1/22/2025   16:24:54    Debug:      Processing record: 3

Exceptions

If you see exception type messages in the log - this indicates an unexpected error in processing. The example below happened when the part of the consortium server processes had crashed:

1/22/2025 10:09:07 Exception: bgWorkerReadBuffer_DoWork(): Unexpected character encountered while parsing value: <. Path '', line 0, position 0. 1/22/2025 10:09:07 Exception: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> 1/22/2025 10:09:08 Exception: <html><head> 1/22/2025 10:09:09 Exception: <title>502 Proxy Error</title> 1/22/2025 10:09:10 Exception: </head><body> 1/22/2025 10:09:11 Exception: <h1>Proxy Error</h1> 1/22/2025 10:09:12 Exception: <p>The proxy server received an invalid 1/22/2025 10:09:13 Exception: response from an upstream server.<br /> 1/22/2025 10:09:14 Exception: The proxy server could not handle the request <em><a href="/results/elections/9/votes">GET&nbsp;/results/elections/9/votes</a></em>.<p> 1/22/2025 10:09:15 Exception: Reason: <strong>Error reading from remote server</strong></p></p> 1/22/2025 10:09:16 Exception: <hr> 1/22/2025 10:09:17 Exception: <address>Apache Server at test2.mediaelections.ca Port 80</address> 1/22/2025 10:09:18 Exception: </body></html>

Data Report Logs

Each time a new data report is received from the data feed - there is a option that enables writing the records to a local log file name report{date}.txt.

In the settings.ini file add an entry in the Log section

  • WriteReportLog=True

[Log] DebugLogEnabled=False WriteReportLog=True

If this is enabled it will save a copy of each record into the file as it receives it.

{"recordType":"begin","beginServerTime":"2025-04-28T10:36:59-0400","electionName":"2025 Federal General Election","beginOptions":{"heartbeat":true,"latestOnly":true,"startAt":1}} {"ballotOrderVotes":[17916,11636,357,5019],"dataSourceId":"E","isAdvancePollCountingComplete":1,"isAllCountingComplete":1,"leadingParties":["LIB"],"numPolls":"203","numPollsFinishedReporting":"203","recordType":"vote","voteDistrictId":"1","voteRecordId":3677,"voteRecordTime":"2025-04-28 10:12:54"} {"ballotOrderVotes":[7250,14821,344,343,8227],"dataSourceId":"E","isAdvancePollCountingComplete":1,"isAllCountingComplete":0,"leadingParties":["LIB"],"numPolls":"177","numPollsFinishedReporting":"160","recordType":"vote","voteDistrictId":"2","voteRecordId":8893,"voteRecordTime":"2025-04-28 10:35:56"} {"ballotOrderVotes":[10519,12358,2261],"dataSourceId":"E","isAdvancePollCountingComplete":1,"isAllCountingComplete":0,"leadingParties":["CON"],"numPolls":"233","numPollsFinishedReporting":"196","recordType":"vote","voteDistrictId":"3","voteRecordId":9048,"voteRecordTime":"2025-04-28 10:36:37"} ...