Community FAQ
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
gsvarney
Engaged Sweeper
Hi,
I updated Lansweeper from 3.1 to 3.2 by copying all the new folders over the top of my installation. Then, as my service was lansweeper30.exe I renamed the lansweeper32.exe to lansweeper30.exe and also changed the config file to match. I added the needed active scanning line. Now, when the service starts, the log file quickly fills up with the following for many machines:

System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_TsysLastscan_tblComputers". The conflict occurred in database "Lansweeper", table "dbo.tblComputers", column 'Computername'.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Lansweeper31.sweeperthread.UpdateLastScan(clsComputer mycomputer, String section, clsThreadinfo Threadinfo, SqlConnection& sqlcon, DateTime startdate)

Is something messed up in my database or did I miss something? Looks like the scanner is working, but no new computers inventoried.

Server is running Vista Business 32bit, network is Windows 2003 R2 SP2.

Thanks,
Geoff
16 REPLIES 16
rmorgan
Engaged Sweeper
I am not clear on what you mine by the original script? I also upgraded from 3.1 and did nothing but update to the new service included with the latest premium user pack.

After researching my error log entries I found the post relating to the script that created the [tblADComputers] table. This cleaned up a lot of the errors, but I am still getting the following entry in the error log:

System.ArgumentException: Column 'LastActiveScan' does not belong to table mytable.
at System.Data.DataRow.GetDataColumn(String columnName)
at System.Data.DataRow.set_Item(String columnName, Object value)
at Lansweeper31.sweeperthread.LSActiveScan(clsComputer mycomputer, clsThreadinfo Threadinfo, SqlConnection& sqlcon)


This rapidly fills the log to the point that I have to turn off the Active Scanning feature.
My server is running Server 2003 Std.
gsvarney
Engaged Sweeper
Are you asking if he ran the original scripts that you run when you first set up the database? On mine, I'm upgrading to 3.2, so I didn't need to do that. But I also just tried the script rmorgan noted above and restarted the service. I get the same errors as before, the 'LastActiveScan' does not belong to table mytable one as well as a bunch of Invalid object name 'tblADComputers' entries. If this is working for others, there must be something simple I've missed.
Hemoco
Lansweeper Alumni
So you first ran the original script and afterwards the script found in the other post?
rmorgan
Engaged Sweeper
Ok, I haved solved half of my problem with the script below (from another post) but I am still getting the some errorlog entrys as gsvarney:

System.ArgumentException: Column 'LastActiveScan' does not belong to table mytable.
at System.Data.DataRow.GetDataColumn(String columnName)
at System.Data.DataRow.set_Item(String columnName, Object value)
at Lansweeper31.sweeperthread.LSActiveScan(clsComputer mycomputer, clsThreadinfo Threadinfo, SqlConnection& sqlcon)


Script:

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tblADComputers]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tblADComputers]
GO

CREATE TABLE [dbo].[tblADComputers] (
[Computername] [varchar] (300) NOT NULL ,
[Comment] [varchar] (500) NULL ,
[Company] [varchar] (256) NULL ,
[Description] [varchar] (256) NULL ,
[DNSHostname] [varchar] (500) NULL ,
[Location] [varchar] (500) NULL ,
[OperatingSystem] [varchar] (256) NULL ,
[OperatingSystemServicePack] [varchar] (256) NULL ,
[OperatingSystemVersion] [varchar] (256) NULL ,
[OU] [varchar] (1000) NULL ,
[Lastchanged] [datetime] NOT NULL ,
[sAMAccountType] [varchar] (50) NULL ,
[primaryGroupId] [varchar] (50) NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[tblADComputers] WITH NOCHECK ADD
CONSTRAINT [PK_tblADComputers] PRIMARY KEY CLUSTERED
(
[Computername]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[tblADComputers] ADD
CONSTRAINT [DF_tblADComputers_Lastchanged] DEFAULT (getdate()) FOR [Lastchanged]
GO
rmorgan
Engaged Sweeper
I too am getting similar errors:

9/9/2008 10:40:16 AM : BLOP1806L
System.Data.SqlClient.SqlException: Invalid object name 'tblADComputers'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
at Lansweeper31.sweeperthread.LSADcompsearch(clsComputer mycomputer, clsThreadinfo Threadinfo, SqlConnection& sqlcon)
-------------------------------------------------------------------------
gsvarney
Engaged Sweeper
No, I get nothing but the startup line (Database connection successful, starting up service) after disabling active scanning and restarting the service. What I had done originally after upgrading was delete all computers via the management console. Then I had lsclient still going for a little while. Then I disabled the group policy for that and turned on active scanning. Now these errors appear, and no more computers show up. There is one other error that happened a few times right before the above errors appeared (after starting the service for the first time after enabling active scanning):

System.ArgumentException: Column 'LastActiveScan' does not belong to table mytable.
at System.Data.DataRow.GetDataColumn(String columnName)
at System.Data.DataRow.set_Item(String columnName, Object value)
at Lansweeper31.sweeperthread.LSActiveScan(clsComputer mycomputer, clsThreadinfo Threadinfo, SqlConnection& sqlcon)

Geoff
Hemoco
Lansweeper Alumni
Do you also have this problem with active scanning disabled?

Archive

This board contains archived posts from the retired Lansweeper Forum and Insiders Community.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now