Red Gate forums :: View topic - Error: Object reference not set to an instance of an object.
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Packager 6
SQL Packager 6 forum

Error: Object reference not set to an instance of an object.

Search in SQL Packager 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
JackLocke



Joined: 13 Jun 2012
Posts: 17

PostPosted: Wed Jun 13, 2012 8:16 pm    Post subject: Error: Object reference not set to an instance of an object. Reply with quote

Hi All,
I am currently evaluating SQL Packager for my company. And one of the feature we are interested in is to have ability to call SQL Packager via CLI and integrate it in our installer.

Currently I am trying to generate exe for update database by comparing two versions of database. I am using following command,

"C:\Program Files (x86)\Red Gate\SQL Packager 6\SQLPackag
er.exe" /database1:NEW /database2:OLD /location:"C:\Users\Administrator\Desktop
\test" /name:TestPKG /makeexe

And following is output of that command, (excluding database object details)

SQL Packager Command Line V6.4.0.8
==============================================================================
Copyright c Red Gate Software Ltd 1999-2008

TRIAL STATUS: You have 13 days left in your trial.
Serial Number:

Registering data sources
Creating mappings
Comparing
Applying Command Line Items
Creating SQL

Summary Information
==============================================================================
DB1 = (local).NEW
DB2 = (local).OLD

Object type Name DB1 DB2
<includes db objects>
.......
.......
.......
.......
.......
.......
.......
.......
.......
Registering databases
Mapping
Comparing databases
Error: Object reference not set to an instance of an object.

I dont understand why I am getting object reference error here. It is local instance and user is administrator of that instance.

Thanks,
Jack
Back to top
View user's profile Send private message
chriskelly



Joined: 19 Apr 2010
Posts: 328
Location: Cambridge, UK

PostPosted: Thu Jun 14, 2012 10:59 pm    Post subject: Reply with quote

Please can you confirm the version of SQL Server that you are attempting to use the tool with?
_________________
Chris Kelly
Technical Support Engineer
Back to top
View user's profile Send private message
JackLocke



Joined: 13 Jun 2012
Posts: 17

PostPosted: Fri Jun 15, 2012 1:44 pm    Post subject: Re: Reply with quote

chrisk5 wrote:
Please can you confirm the version of SQL Server that you are attempting to use the tool with?

I am using SQL Server 2008R2 Std edition on Windows Server 2008 R2
Back to top
View user's profile Send private message
chriskelly



Joined: 19 Apr 2010
Posts: 328
Location: Cambridge, UK

PostPosted: Thu Jun 21, 2012 5:05 pm    Post subject: Reply with quote

The "Object reference not set to an instance of an object." error message is rather generic error message, so I think we need some more information to decide what has gone wrong.

Would it be possible for you to try running a comparison in SQL Compare with the same two databases. I would like to know whether you encounter the same error message or if the comparison goes through. If you are able to recreate the same error message, please can you follow these steps.

- enable error logging, as described in this document:
http://www.red-gate.com/SupportCenter/Content/SQL_Data_Compare/knowledgebase/logging_and_log_files
- recreate the error message one more time.
- disable error logging, as described in the above document (the file can grow very quickly so please try not to leave this running too long).
- locate the log file and send to support@red-gate.com quoting the support ticket number F0061318.

If you have any problems, then please let me know (either by email or posting back here).
_________________
Chris Kelly
Technical Support Engineer
Back to top
View user's profile Send private message
JackLocke



Joined: 13 Jun 2012
Posts: 17

PostPosted: Fri Jun 22, 2012 5:02 pm    Post subject: Re: Reply with quote

chrisk5 wrote:
The "Object reference not set to an instance of an object." error message is rather generic error message, so I think we need some more information to decide what has gone wrong.

Would it be possible for you to try running a comparison in SQL Compare with the same two databases. I would like to know whether you encounter the same error message or if the comparison goes through. If you are able to recreate the same error message, please can you follow these steps.

- enable error logging, as described in this document:
http://www.red-gate.com/SupportCenter/Content/SQL_Data_Compare/knowledgebase/logging_and_log_files
- recreate the error message one more time.
- disable error logging, as described in the above document (the file can grow very quickly so please try not to leave this running too long).
- locate the log file and send to support@red-gate.com quoting the support ticket number F0061318.

If you have any problems, then please let me know (either by email or posting back here).


Hi,
I can generate exe,C# app or .sql script if I use GUI for same databases and log doesn't show any error. But if I try to do this via CLI, and enable logging for execution by including /verbose switch in command. So my new command looks like this,

Quote:
"C:\Program Files (x86)\Red Gate\SQL Packager 6\SQLPackager.exe" /database1:NEW /u1:sa /p1:superpassword /database2:OLD /u2:sa /p2:superpassword /location:"C:\Users\Administrator\Desktop\test" /name:TestPKG /makeexe /verbose


This will display whole sql script generated by packager based on comparison. But this doesn't show me anything extra for error. I understand that this error is very generic and it is difficult to pin point actual issue. But as you can see my original post this error comes right after

Quote:

Comparing database (local).NEW with database (local).OLD...
Registering databases
Mapping
Comparing databases


And I think it might give you a clue about what could be wrong here.

Thanks,
Jack
Back to top
View user's profile Send private message
DGapp



Joined: 27 Jun 2012
Posts: 2

PostPosted: Wed Jun 27, 2012 6:42 pm    Post subject: Reply with quote

I get this error fairly frequently myself, and it almost always happens when there are newer table(s) and stored procs, and most often when the newer table(s) have no data on them. Usually I can exclude them and move on and some point later it works fine. I haven't been able to exactly pin it down, but it's almost always the "build" process when new tables are included or the very next one after they were introduced. It's quite frustrating
Back to top
View user's profile Send private message
JackLocke



Joined: 13 Jun 2012
Posts: 17

PostPosted: Wed Jun 27, 2012 8:24 pm    Post subject: Re: Reply with quote

DGapp wrote:
I get this error fairly frequently myself, and it almost always happens when there are newer table(s) and stored procs, and most often when the newer table(s) have no data on them. Usually I can exclude them and move on and some point later it works fine. I haven't been able to exactly pin it down, but it's almost always the "build" process when new tables are included or the very next one after they were introduced. It's quite frustrating


It is indeed very frustrating issue. And strangest most thing is if I do exactly same thing in UI, it works just fine ! But I don't want to use UI, we want to automate this thing using CLI.

And say if it solves my issue by excluding new updates then what's point of even using this sofware because that's the whole point of having this product, no ?

By looking at their current response, I wonder how is RedGate's after sales support ...

Thanks anyway. I am glad to see that I am not the only one with similar issue.

Jack
Back to top
View user's profile Send private message
DGapp



Joined: 27 Jun 2012
Posts: 2

PostPosted: Wed Jun 27, 2012 8:33 pm    Post subject: Reply with quote

Well, to be honest, they've been very good to me overall. For some reason, SQLPackager has always been a thorn in my side and is solely used for automation purposes which makes it even worse when it doesn't work with such "generic" errors...but the UI components work fine.

Previously, I was able to encounter similar or the same errors using the UI components (SQL Compare and SQL Data Compare), but no longer. I'm hoping it's just related to using older comparison libraries and that we'll see a new SQL Packager using new comparison libraries, or automation of the individual actual products.

But, like I said overall RedGate has been really good to me and I couldn't do a lot of things without them or their tools; in case that helps ease your concern at all.
Back to top
View user's profile Send private message
dmcaldwell



Joined: 02 Mar 2013
Posts: 2
Location: Dawsonville, GA

PostPosted: Sat Mar 02, 2013 6:14 pm    Post subject: Command Line errors Reply with quote

I'm getting the same issue with SQL Packager. I've experienced the same problems with SQL Data Compare and it seems to happen when it's doing the mapping portion.

C:\Program Files (x86)\Red Gate\SQL Packager 6>sqlpackager.exe /db1:WAP-Official /n:WAPOfficialPackage /exe /options:d,idn,k

Registering databases
Mapping
Error: Object reference not set to an instance of an object.

Is anyone at Red-Gate working on this problem?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group