cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
nexus_gooner
Engaged Sweeper

I'm getting this error when updating or deleting any IP / Range location. Any ideas how I can correct this?

Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. The statement has been terminated.

Lansweeper error.png

1 ACCEPTED SOLUTION
Obi_1_Cinobi
Lansweeper Tech Support
Lansweeper Tech Support

Hello there!

There is a known issue in the current Lansweeper version when deleting IP locations that are in use, and a fix should be included in one of our future releases. We recommend checking our changelog for bug ID: LAN-14512 when a new version is released to ensure that a fix was included. You can enable the update check in the Lansweeper web console under Configuration\Your Lansweeper License to be notified of any new releases.

You can find our changelog here: https://www.lansweeper.com/changelog.aspx

View solution in original post

5 REPLIES 5
NoMoss
Engaged Sweeper

Is there a workaround?

Obi_1_Cinobi
Lansweeper Tech Support
Lansweeper Tech Support

Hello there!

We have found a workaround for deleting the IP locations. Please make sure to take a backup before attempting to do so, and carefully test the results before moving on. Backup instructions can be found here:  https://www.lansweeper.com/knowledgebase/backing-up-your-installation/
 
To run the script on the database:

  • First, stop the following services:
    • The Lansweeper server service (on all your scanning servers).
    • The web server service on your Lansweeper web server. Your web server service is either World Wide Web Publishing Service (IIS) or IIS Express.
  • Run the below code on the database, either through the databasemaintenance tool in your Lansweeper installation's Tools folder or through SQL Server Management Studio directly.
  • Restart the services.
  • you should now be able to delete the IP location

Script (replace INSERT IP LOCATION NAME HERE with the name you'd like to delete):

Use lansweeperdb
DECLARE @counter INT;
Declare @locationID INT;
SET @locationID = (select top 1 LocationID from tsysiplocations where IPLocation='INSERT IP LOCATION NAME HERE')
SET @counter =
(
    SELECT COUNT(assetid)
    FROM tblassets
    WHERE locationid = @locationid
);
WHILE(@Counter >= 1)
    BEGIN
        UPDATE tblassets
          SET 
              tblassets.LocationID = -1
        WHERE Assetid IN
        (
            SELECT TOP 1 assetid
            FROM tblassets
            WHERE LocationID = @locationid
        );
        SET @counter = @counter - 1;
    END;

 

Rufinobr
Engaged Sweeper II

I'm getting a similar error when trying to import some IP Location ranges. Is this the same bug? 

Rufinobr_0-1673989082454.png

 

Obi_1_Cinobi
Lansweeper Tech Support
Lansweeper Tech Support

Hello there!

The first error on your screenshot is indeed the same bug. But I would contact technical support to check the second error message to ensure that this is part of the known issue.

To contact support: https://www.lansweeper.com/contact-support/

Obi_1_Cinobi
Lansweeper Tech Support
Lansweeper Tech Support

Hello there!

There is a known issue in the current Lansweeper version when deleting IP locations that are in use, and a fix should be included in one of our future releases. We recommend checking our changelog for bug ID: LAN-14512 when a new version is released to ensure that a fix was included. You can enable the update check in the Lansweeper web console under Configuration\Your Lansweeper License to be notified of any new releases.

You can find our changelog here: https://www.lansweeper.com/changelog.aspx