Comparison document is not loaded

Discussion of open issues, suggestions and bugs regarding database management and development tools for SQL Server
Post Reply
mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

Comparison document is not loaded

Post by mango333 » Tue 22 Dec 2015 19:23

I am getting this error when I attempt to run at the command line, using an .scomp for the comparison.

================================================================================
Devart dbForge Schema Compare for SQL Server v4.0.32
================================================================================
Started at: 12/22/2015 1:05:08 PM.
/schemacompare /compfile:"C:\Comparisons\operations.scomp" /sync log:"C:\Comparisons\Logs\operations.log"

Comparison document is not loaded.

I have verified the .scomp document exists and it loads just fine through the GUI.

mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

Re: Comparison document is not loaded

Post by mango333 » Tue 22 Dec 2015 20:41

I've found a little more information on this. It seems to be permissions related. The OS is MS Server 2012. The user attempting access to the .scomp was not the user that created the .scomp file. I opened Schema Compare with the credentials of the user that required access, was able to open the .scomp in the UI, delete the old .scomp and save the new .scomp. I suddenly was able to access the .scomp file through the command line again. Weird

.jp
Devart Team
Posts: 345
Joined: Wed 09 Sep 2009 06:55
Location: devart

Re: Comparison document is not loaded

Post by .jp » Wed 23 Dec 2015 11:18

Hello.

Thanks for the post!

There are two ways available.

1. You can specify a user name and password in *.scomp as the following:
- open *.scomp using any text editor
- find <ConnectionString>
- specify User ID = sa; Password = sa
- save *.scomp

2. You can use the following command:
/schemacompare /source server:SqlServer1 user:sa password:sa database:db1 /target server:SqlServer2 user:sa password:sa database:db2 /sync:"D:\compare_result.sql"

Best Regards.

mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

Re: Comparison document is not loaded

Post by mango333 » Wed 23 Dec 2015 15:20

Thanks jp, but it's not the connection strings. It seems related to the ownership of the .scomp file. Once I changed ownership to the intended user, everything seems to work OK. I can't tell if this is an application issue or Windows Server 2012 permissions "feature".

mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

Re: Comparison document is not loaded

Post by mango333 » Wed 23 Dec 2015 20:15

I think I have it figured out.

The error appears to only be generated when the domain account the command line is executed under is logged off the machine. This doesn't make sense to me.

Sounds like I may need to put in a support ticket to get this resolved. Thoughts

alexa

Re: Comparison document is not loaded

Post by alexa » Thu 24 Dec 2015 14:45

Could you please provide us the following information:

1. User permissions on loading the *.scomp file when you get the error.
2. User permissions on correct loading the *.scomp file.
3. Screenshot of the error.

Also, please check that, if the user permissions are equal, the error happens only when "Authentication = <SQL Server authentication>" or, in case "Authentication = <Windows authentication>", the error also happens?

mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

Re: Comparison document is not loaded

Post by mango333 » Thu 24 Dec 2015 17:12

A screenshot, or rather, a modified copy\paste of the output is at the top of this thread. The error simply states, "The comparison document could not be loaded". Not very helpful.

The .scomp file uses Integrated Security. The only difference is that the domain account is not logged onto the machine when it errors. If the user is logged in, the comparison loads just fine.

mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

Re: Comparison document is not loaded

Post by mango333 » Thu 24 Dec 2015 17:58

I've inspected the .scomp xml, the registry connection values, the server and database permissions. I don't see anything that would generate the error, which seems to point to the xml "document" not being loaded, or an inability to load it.

SQL Agent, via proxy, calls a batch file containing the command line call to the schema compare tool, using the .scomp. Proxy account has sysadmin permissions on the server; both OS and SQL. If there was a kerberos issue or some other permissions issue, I would expect to see an unauthorized or authentication error. Instead we see a failure to load an xml document.

alexa

Re: Comparison document is not loaded

Post by alexa » Fri 25 Dec 2015 13:00

Please note that the Windows authentication can work only if the user has logged in. So, you have to either log in or specify an SQL Server user in the *.scomp schema comparison document.

mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

Re: Comparison document is not loaded

Post by mango333 » Mon 28 Dec 2015 16:17

I understand Windows authentication, which is why a proxy account exists on the SQL instance calling the command. The proxy is set up with the credentials of the intended Windows user. The issue isn't authentication; it has something to do with the way Schema Compare is handling the .scomp file when the user isn't physically logged into a machine.

alexa

Re: Comparison document is not loaded

Post by alexa » Tue 29 Dec 2015 10:08

dbForge handles the .scomp file on behalf of the user that is used to run dbForge.

mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

Re: Comparison document is not loaded

Post by mango333 » Tue 29 Dec 2015 20:36

That's what I was assuming based on what I was seeing in the xml and registry. I was trying to refresh a build environment with an automated schema-only refresh from production, using an .scomp file to handle the connections, compare, and sync options. Worked great so long as the account used for the process was actually logged into the machine. As soon as the user logged out and someone else logged in, the process broke.

That stinks :cry:

I've moved on and am handling the process with an argument file and embedding the connections, still using Integrated Security, and it's working. But I don't have any control over the sync options with this method. Is there any way to dictate sync options with an argument file, similar to what an .scomp does?

alexa

Re: Comparison document is not loaded

Post by alexa » Thu 21 Jan 2016 11:34

Sorry for the delay on this.

Please make sure you are using the latest version 4.1 https://www.devart.com/dbforge/sql/sche ... nload.html

alexa

Re: Comparison document is not loaded

Post by alexa » Thu 21 Jan 2016 12:34

Also, we recommend you to create a connection with the comp\autoAcct user.

alexa

Re: Comparison document is not loaded

Post by alexa » Thu 21 Jan 2016 12:37

Is there any way to dictate sync options with an argument file, similar to what an .scomp does?
Please see https://www.devart.com/dbforge/sql/sche ... ration.htm

Post Reply