command line Error: Unable to connect to a repository at URL

Compares and synchronizes SQL Server databases, backups and scripts.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, eddie davis, Anu Deshpande, Michelle Taylor, alice.easey, james.billings, chengvoon.tong

command line Error: Unable to connect to a repository at URL

Postby ddorval » Fri Nov 30, 2012 2:51 pm

I finally got migration scripts to work from the command line but after moving the updated command to the build script it fails on the build machine.

I copied the actual sqlcompare command used from the log and replaced the local paths with network paths (so I'd be reusing the same folders/files) except for /scriptfile and it worked fine. I then cleared the Authentication Data in Tortoise SVN and now I get the same error running from my machine.

I am specifying the following switches:
/scripts1:"local database folder of branch being built"
/scripts2:"local database folder of Trunk"
/scriptfile:"file name/path of output"
/options:Default,IgnoreTSQLT
/force
/migrationsfolder:"local migration folder of branch"
/scriptsfolderxml:"local file with contents from db extended property"
/revision1:"revision number of branch"
/revision2:"revision number of trunk"
/versionusername1:"username"
/versionpassword1:"password"
/versionusername2:"username"
/versionpassword2:"password"

I've verified the username and password are correct. svn info with the url from the error and the username and password specified works.

Our build system actually copies the branch being build to a new branch with the build number then gets that branch for the build. To save having to maintain the /scriptsfolderxml file I thought I could be clever and update that file as part of the build with the url of the build branch. Doing this didn't give an Error but also didn't use the migration scripts . :(

It would also be nice to not have to specify the /scriptsfolderxml since that url is also in the migrationScript file.
ddorval
 
Posts: 8
Joined: Thu Nov 08, 2012 9:13 pm

Postby Brian Donahue » Tue Dec 04, 2012 4:36 pm

If SVN is configured to use Windows Authentication, it doesn't seem to matter what you use for the versionusername/password. If you have "enterprise" (paid-for) SVN server, you will want to check the logs to see who you are actually logging in as.

With Windows Auth, I am guessing Windows transparently logs in as the user running the command, because I can change these options to invalid users and passwords, and it still works.

If you are using the SVN authentication database, please let me know and I'll forward this support query on to someone who can help.
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby ddorval » Tue Dec 04, 2012 4:44 pm

I'm not sure how we have SVN configured. I know we use our network credentials to login to svn but we do have to actually login. Our build server is not on the domain anyway so I do not think it is using Windows Authentication. As a work around I created a console application that uses sharpsvn to do an svn info command and cache the credentials. Adding that to the msbuild script before the call to sqlcompare allows sqlcompare to work.

I don't know all the details about how all the different svn's work but when testing at the command line all I had to do was call svn info and then sqlcompare would work but when running inside an msbuild script svn info wasn't enough and I had to write a program to use sharpsvn.
ddorval
 
Posts: 8
Joined: Thu Nov 08, 2012 9:13 pm

Postby Brian Donahue » Tue Dec 04, 2012 4:48 pm

I guess you need to grant access to SVN for whatever user is running MSBUILD or get that process to impersonate another user that has access. I don't know enough about your setup to say how you would go about that.
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby ddorval » Tue Dec 04, 2012 4:58 pm

I am using svn credentials that have access, that's why it works once the credentials are cached. It would be nice to be able to specify the credentials to use for svn when connecting for migration scripts. SVN isn't using Windows Authentication.
ddorval
 
Posts: 8
Joined: Thu Nov 08, 2012 9:13 pm

Postby Brian Donahue » Wed Dec 12, 2012 4:43 pm

Nobody has provided me with an answer to this question, but as far as I can tell from looking at the source code, the SVN credentials are always got from the SharpSVN API. The SQL Source Control code is invoked to bind to SVN and that code only seems to retrieve cached credentials, and if none are present, it should show a prompt. It seems to remember the last username, though, so possibly the username command-line option will get it to connect as the right user.

So something between SQL Compare and SQL Source Control seems to have broken down. But I could be misunderstanding the code. I can't get a comment in-house from anyone as to what is going on.

In the meantime, I suppose making a connection to SVN using SQL Source Control should repopulate the cache and that may fix the problem.
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby ddorval » Thu Dec 20, 2012 4:24 pm

As a work around I wrote a command line application that also uses SharpSVN to connect to svn with the sole purpose of caching the credentials for sqlcompare. We are running sqlcompare.exe from within an msbuild script being executed using the msbuild api objects (not msbuild.exe) within a .net Windows Service...so there is many layers of no UI.
ddorval
 
Posts: 8
Joined: Thu Nov 08, 2012 9:13 pm


Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 1 guest