SQL Server connector is throwing an object reference error on every record

Every record in my map is failing with the message "Object reference not set to an instance of an object." There are no additional details, such as a stack trace. No further details are available in the rolling.log file of the agent.


When I debug the map, the object reference error appears to be thrown after using the SQL Server connector to perform a lookup.


My source data is a new connector that I've written. This new connector is running on an on-premise agent. For each record that my source connection returns, there's a Lookup block that calls SQL Server, and finally, an update block with the HubSpot connector. Something crashes after it gets the record from my source data and hits the Lookup block. HubSpot is never updated due to the object reference error.


What's really strange is that the map runs successfully with no errors when "Process all records on each run" is selected under the "Net Change" tab of the Query block of that map. Selecting "Process only records created or updated since the last run, based on the value of the specified field" and choosing a field will cause the object reference error to throw on every record. I do not understand why that makes a difference -- both ways of querying the data will grab records, and the records are not any different.


During debugging, I am able to confirm that the records can be successfully fetched from my custom connector -- but any attempt to query SQL Server causes the error to be thrown.

(3) Answers