Jet Data Manager: BC Account Sync Error Caused by Repository Corruption
Summary
A Jet Data Manager (JDM) project can enter an unrecoverable state in which any attempt to select a Business Central (BC) account, or to save the project, fails with an "Object reference not set to an instance of an object" error (sometimes displayed as "Instance is not an object"). The error typically first appears immediately after a BC adapter synchronization that adds a new account, and then blocks further work on the entire project, not only the adapter that was synchronized. This article documents the diagnostic signals that confirm the underlying cause as Jet Project Repository database corruption, and provides the three viable resolution paths in order of preference.
Note: This article applies specifically to Jet Data Manager and only when the error persists after both project-version rollback and JDM version rollback against the same repository backup. If the error can be resolved by a project-version rollback alone, the repository itself is not corrupt and this article does not apply. The same error text appears in other Jet products, such as Hubble. Those errors have different causes and are not covered here.
Symptoms
The primary and secondary symptoms below are the fingerprint of Jet Project Repository corruption. When several are present together, treat the repository itself as suspect rather than the project design.
Primary symptoms
The error "Object reference not set to an instance of an object" (or, in some translations, "Instance is not an object") is raised when the user attempts to select any BC account on any BC adapter within a specific JDM project.
The same error is raised when the user attempts to save the project. The project becomes effectively read-only from a persistence standpoint.
The error started immediately after a BC adapter synchronization that added at least one new account (either a real account or a test account).
The affected adapter is one specific BC adapter. Other BC adapters within the same project may be re-syncable when the sync only removes deleted test accounts, but any adapter with an added account triggers the error.
Secondary symptoms (highly indicative of database-level corruption)
Rolling the project back to a version captured before the first occurrence of the error still reproduces the error.
Opening the same repository from an older, previously known-good JDM version (for example, opening from a 20.10.3x installation after upgrading to 20.10.72.x) still reproduces the error.
Attempting to toggle project settings, such as the "Team Development" checkbox, returns a "failure to obtain lock" error.
The behavior is not user- or session-specific. Only one user is working on the project at the time, but the errors persist across restarts and different users.
Code inspection of the project (searching for orphaned or unpopulated object references) does not identify a design-level cause.
Cause
The Jet Project Repository is the SQL database that stores every persisted artifact of a Jet Data Manager project, including adapters, mappings, project settings, work-item state, and the internal object graph. Corruption of this database causes JDM to read partial or inconsistent state on load, which surfaces to the user as null-reference exceptions. Because the same underlying data is loaded regardless of the project version selected, and regardless of which JDM version opens the repository, the corruption is opaque to project-level rollback and to JDM version rollback.
A specific trigger commonly reported alongside this corruption is a BC adapter synchronization that adds a new account. The synchronization writes new records into the repository, and if those writes complete against an already-fragile state, or interact with a schema change between JDM minor versions, the repository can enter a state that JDM can no longer read cleanly.
Diagnostic Signals: Is the Repository Actually Corrupt?
Before pursuing the resolution paths below, confirm the repository is genuinely corrupt rather than a simpler issue. Answer each question in order.
Does the error persist after "Save and Reload" of the project? If no, the issue is transient. Do not proceed. If yes, continue.
Does the error persist after rolling the project back to a version captured before the first occurrence? If no, this is a project-design issue introduced by a specific change. Investigate the delta. If yes, continue.
Does the error persist when opening the repository from a previously installed older JDM version (if available)? If no, the issue is specific to the current JDM version and should be treated as a compatibility issue. If yes, continue.
Are project settings unable to be toggled (for example, "Team Development"), with a "failure to obtain lock" error? If yes, this is a strong signal of database-level corruption.
Has code inspection of the project (searching for orphaned references) failed to identify a design-level cause? If yes, the corruption is not visible in the project XML or metadata. It is at the database layer.
If questions 1 through 5 are all answered "yes," the Jet Project Repository database is corrupt. Proceed to the Resolution section.
Resolution
There are three viable resolution paths, listed in recommended order. Path A is the fastest and least invasive when a suitable SQL backup exists. Path B avoids the need for a database restore but is time-intensive. Path C is used when neither of the first two paths is feasible.
Caution: Before doing anything else: Take a full SQL backup of the current Jet Project Repository database, even in its corrupted state. This preserves your options, including the ability to escalate to insightsoftware Engineering for forensic analysis, and prevents further degradation.
Path A (Recommended): Point-in-time restore of the Jet Project Repository database
This is the shortest path to recovery when a suitable backup is available.
Identify a database backup taken before the first occurrence of the error. In the source case, the trigger event was a BC adapter synchronization on a known date. Use the day immediately prior to that event as the target restore point.
Coordinate with the SQL administrator to restore the Jet Project Repository database from that backup. On SQL Azure, use point-in-time restore. On on-premises SQL Server, restore from the most recent backup preceding the trigger event.
Restore to a new database name first (for example, a name ending in _Restore) to allow validation without overwriting the corrupted database.
Point Jet Data Manager to the restored database and open the project.
Verify that saving succeeds and that the BC account sync can be repeated without triggering the error.
Once verification passes, cut over the JDM configuration to use the restored database as the primary Jet Project Repository database.
Caution: Data loss note: Restoring from a pre-corruption backup discards every change made to the project after the backup was taken, including intentional work. Reconcile that lost work manually after cutover, typically by re-applying the deliberate changes from the notes or version history of the project.
Path B: Export project metadata and re-import to a fresh repository
Use this path when no suitable pre-corruption SQL backup exists but the project can still be opened enough to export its metadata.
Provision a fresh Jet Project Repository database on the same SQL instance (or on SQL Azure).
From the corrupted JDM project, select File > Export to save the project settings as an XML file. If Export is grayed out, the project predates this function. Use the legacy Export/Import Quick Cube Project functions instead. If the export fails entirely, this path is not viable. Proceed to Path C.
In JDM, connect to the newly provisioned empty repository.
Select File > Import and import the exported XML file into the fresh repository.
Verify that saving the imported project succeeds and that BC adapter sync completes without error.
Re-run the specific BC account synchronization that originally triggered the corruption, and confirm it now completes cleanly.
This path avoids the need for a SQL restore but requires the corrupted repository to be readable enough to export. It also loses any state stored purely at the repository level and not captured by the project export, such as work-item state.
For more on export and import, see Export and Import Jet Data Manager Projects.
Path C: Escalate to insightsoftware Engineering
Use this path when neither Path A nor Path B is feasible. This is typically the case when no pre-corruption backup exists and the corruption is severe enough to prevent project export.
Take a full SQL backup of the corrupted Jet Project Repository database (a fresh copy, separate from any backup taken earlier).
Open a support case with insightsoftware, referencing this article, and mark the case as requiring engineering review for repository corruption.
Provide the backup file as an attachment to the case, or via a secure file transfer channel arranged with Support.
Include the JDM version installed on the client, the SQL server version hosting the repository, the exact error text, and the trigger sequence (which BC adapter, which account was added).
Provide the results of the Diagnostic Signals section of this article so Engineering can confirm the corruption assessment.
Prevention and Best Practices
Take regular scheduled backups of the Jet Project Repository database, retained for at least the duration of a typical development sprint. Daily backups with a two-week retention window will materially reduce the risk of unrecoverable corruption.
Take an explicit Jet Project Repository backup immediately before any JDM upgrade. The JDM installer prompts to upgrade the repository schema, and a backup taken immediately before this operation provides a known clean point.
Take an explicit backup before large-scale operations that write to the repository, such as initial synchronization of a new BC adapter, bulk account import, or schema mapping changes.
Where multiple developers work on the same project, enable Team Development mode and use work items rather than allowing concurrent direct edits. This does not by itself prevent repository-level corruption, but it reduces the number of concurrent write paths that can contribute.
Retain older JDM installations for a short period after upgrading, so a repository can be opened by the previous JDM version if the upgraded version encounters issues. This is useful for diagnosis, though as this case shows, it does not rescue an already-corrupted repository.
Frequently Asked Questions
-
The error message text mentions "Instance is not an object." Is this the same issue?
"Instance is not an object" is a translated or alternate rendering of the same underlying null-reference exception ("Object reference not set to an instance of an object"). When the message is raised from JDM during BC account selection or project save, treat the two phrasings as equivalent.
-
Only one user has been working on the project. Why does the "Team Development" setting matter?
The Team Development flag is a project-level configuration stored inside the repository itself. A "failure to obtain lock" error when attempting to toggle it is diagnostically useful even when no other user is working on the project, because it indicates the repository is inconsistent at the database layer, not merely at the concurrency layer. It is not a signal of contention with another user.
-
Would upgrading Jet Data Manager to the newest version resolve this?
No. A JDM upgrade will not repair a corrupted repository. The newer version reads the same corrupted state and produces the same errors. In the source case, upgrading from 20.10.3x to 20.10.72.x did not resolve the error, and opening the same repository from the older version also failed. The corruption is at the database layer, below the application version.
-
Can we simply re-add the new BC account manually and skip the corrupt entry?
No. Once the repository is corrupt, any subsequent write against it, including manual re-add attempts, will either fail with the same error or extend the corruption. The repository must be repaired, restored, or replaced before further writes are attempted.
-
Is there a scripted repair we can run against the SQL database ourselves?
There is no supported customer-facing repair script for Jet Project Repository corruption. Deep database repair falls under Path C above, where insightsoftware Engineering analyzes the specific corruption and performs the repair directly. Customer-side attempts to modify the repository schema or data are not supported and can make Engineering repair infeasible.
Additional Information
The "Object reference not set to an instance of an object" error text on its own is generic. The persistence of the error across project-level and JDM-version rollbacks, together with the "failure to obtain lock" behavior on settings toggles, is what identifies the cause as repository-level corruption specifically.
When the Jet Project Repository database is hosted on SQL Azure, point-in-time restore is available up to the retention window configured on the server (7, 14, or 35 days depending on the service tier). Confirm the available retention with your SQL Azure administrator before committing to Path A.
Repository corruption in JDM is not a common failure mode. When it does occur, capture the trigger event carefully (which adapter, which account, which JDM version, which SQL host). This information helps insightsoftware identify patterns across cases.