cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
apap
Engaged Sweeper III
While deploying a package we have about a dozen nodes that return the following error:
Unexpected failure while connecting to Asset. Object reference not set to an instance of an object.

We are on Version 6.0.100.29
and all the nodes that we are pushing to are Windows 7
1 ACCEPTED SOLUTION
erodriguez wrote:
I know this is an old post but how did this get resolved. I am having the same issue. Although once in a while my deployment goes through. Been dealing with support and everything seems to checkout. Not sure what to do at this point. Please advise.


To get back on the topic of this thread: I've seen object reference errors thrown during deployments in cases where the RemoteDeployment_x64.exe file that gets written to the local computer during deployments is not accessible. This can be due to a firewall, anti-virus, etc. This file gets written to the C:\Windows\LsDeployment folder during the deployment process.

View solution in original post

11 REPLIES 11
Lee-Kinetic
Engaged Sweeper II
I know this is old as well, but I ran into this error today with a system that was offline for about a month. When I looked at the date of the c:\Windows\LsDeployment\ (and the files within), they were modified over a month ago. I just deleted this folder/files and tried my deployment again and it worked.
protectthyenter
Engaged Sweeper
Hello,

This is what Lansweeper sent me to fix the issue:

The technical details of the error as seen in your website log indicate that the error is related to asset/user relations.

Your Summary screenshot doesn't show the asset/user relation section of the tab, but we assume the problem assets have one or more asset/user relations of which the Active Directory user no longer exists. You do indicate you terminated a user. One other customer has reported the object reference error under these circumstances. Ordinarily, if an Active Directory user is deleted from Lansweeper, either manually or through cleanup options, its relations are removed as well. This mechanism is broken in Lansweeper 7.2 for cleanup options, resulting in relations remaining in the database even though the user was removed.

We had already reported the aforementioned issue to our developers. The case has ID LAN-4114 in our system and will be referred to as such in our changelog once fixed: https://www.lansweeper.com/changelog/

At the moment, we unfortunately don't have an estimated release date for a fix. For now, you can resolve the issue by manually deleting the faulty relations from the database. To do this, you can run the script below in the Script Execution tab of this tool: Program Files (x86)\Lansweeper\Tools\DatabaseMaintenance.exe. Replace what we've highlighted with the ID of the asset that's in error. An asset's ID is visible in the URL of its Lansweeper webpage.

We recommend backing up your installation prior to running any scripts: https://www.lansweeper.com/knowledgebase/backing-up-your-installation/
On an unrelated note, we would also recommend updating to the latest 7.2 build (7.2.100.33) by following these instructions: https://www.lansweeper.com/knowledgebase/updating-your-installation/

Delete
From tblAssetUserRelations
Where tblAssetUserRelations.AssetID = 506 And tblAssetUserRelations.IsLocalUser =
0 And tblAssetUserRelations.Username Is Not Null And
tblAssetUserRelations.Userdomain + '\' + tblAssetUserRelations.Username Not In
(Select tblADusers.Userdomain + '\' + tblADusers.Username From tblADusers)


You should also be able to resolve the issue for all assets at once by running the modified script below. Again though, back up your database first, to be safe. The script below deletes all relations between assets and domain users where the domain user is no longer present in tblADusers.

Delete
From tblAssetUserRelations
Where tblAssetUserRelations.IsLocalUser =
0 And tblAssetUserRelations.Username Is Not Null And
tblAssetUserRelations.Userdomain + '\' + tblAssetUserRelations.Username Not In
(Select tblADusers.Userdomain + '\' + tblADusers.Username From tblADusers)
pte wrote:
Hello,

This is what Lansweeper sent me to fix the issue:

The technical details of the error as seen in your website log indicate that the error is related to asset/user relations.

Your Summary screenshot doesn't show the asset/user relation section of the tab, but we assume the problem assets have one or more asset/user relations of which the Active Directory user no longer exists. You do indicate you terminated a user. One other customer has reported the object reference error under these circumstances. Ordinarily, if an Active Directory user is deleted from Lansweeper, either manually or through cleanup options, its relations are removed as well. This mechanism is broken in Lansweeper 7.2 for cleanup options, resulting in relations remaining in the database even though the user was removed.

We had already reported the aforementioned issue to our developers. The case has ID LAN-4114 in our system and will be referred to as such in our changelog once fixed: https://www.lansweeper.com/changelog/

At the moment, we unfortunately don't have an estimated release date for a fix. For now, you can resolve the issue by manually deleting the faulty relations from the database. To do this, you can run the script below in the Script Execution tab of this tool: Program Files (x86)\Lansweeper\Tools\DatabaseMaintenance.exe. Replace what we've highlighted with the ID of the asset that's in error. An asset's ID is visible in the URL of its Lansweeper webpage.

We recommend backing up your installation prior to running any scripts: https://www.lansweeper.com/knowledgebase/backing-up-your-installation/
On an unrelated note, we would also recommend updating to the latest 7.2 build (7.2.100.33) by following these instructions: https://www.lansweeper.com/knowledgebase/updating-your-installation/

Delete
From tblAssetUserRelations
Where tblAssetUserRelations.AssetID = 506 And tblAssetUserRelations.IsLocalUser =
0 And tblAssetUserRelations.Username Is Not Null And
tblAssetUserRelations.Userdomain + '\' + tblAssetUserRelations.Username Not In
(Select tblADusers.Userdomain + '\' + tblADusers.Username From tblADusers)


You should also be able to resolve the issue for all assets at once by running the modified script below. Again though, back up your database first, to be safe. The script below deletes all relations between assets and domain users where the domain user is no longer present in tblADusers.

Delete
From tblAssetUserRelations
Where tblAssetUserRelations.IsLocalUser =
0 And tblAssetUserRelations.Username Is Not Null And
tblAssetUserRelations.Userdomain + '\' + tblAssetUserRelations.Username Not In
(Select tblADusers.Userdomain + '\' + tblADusers.Username From tblADusers)



Important note here: the main post here is about an object reference error received when deploying. The issue that was resolved via your support ticket was about receiving an object reference error when editing assets. Two very different things.

I would advise against running this script unless recommended to by us.
erodriguez
Engaged Sweeper
I know this is an old post but how did this get resolved. I am having the same issue. Although once in a while my deployment goes through. Been dealing with support and everything seems to checkout. Not sure what to do at this point. Please advise.
erodriguez wrote:
I know this is an old post but how did this get resolved. I am having the same issue. Although once in a while my deployment goes through. Been dealing with support and everything seems to checkout. Not sure what to do at this point. Please advise.


To get back on the topic of this thread: I've seen object reference errors thrown during deployments in cases where the RemoteDeployment_x64.exe file that gets written to the local computer during deployments is not accessible. This can be due to a firewall, anti-virus, etc. This file gets written to the C:\Windows\LsDeployment folder during the deployment process.
erodriguez wrote:
I know this is an old post but how did this get resolved. I am having the same issue. Although once in a while my deployment goes through. Been dealing with support and everything seems to checkout. Not sure what to do at this point. Please advise.


Check out the latest post for an answer to your question
Bruce_B
Lansweeper Alumni
I'd recommend mailing into support@lansweeper.com for this so we can do some debugging if necessary, please include the following:
  • A summary of the issue
  • Program Files (x86)\Lansweeper\Service\Errorlog.txt
  • An export of Deployment\Installer Logs
  • A testconnection.exe output for an asset for which this issue exists, run testconnection.exe directly from your Lansweeper server towards the FQDN of the asset, using your scanning credentials.
apap
Engaged Sweeper III
All packages tried have failed on this small set of nodes ( the packages work fine elsewhere ).
Deleting and re-adding did not work. Everything adds and scans fine but same deployment error msg.
RandomAdmin
Engaged Sweeper
are the trouble computers having an issue with other deployments or just this one? I have had a similar problem in the past and had to delete and then re-add the asset to fix it.