SQL Server Management Studio (SSMS) - Checkout doesn't work

If reporting a bug with the Agent Git or Agent SVN plug-ins please post the details here. Please do not post questions here.
Post Reply
jloesch
Posts: 4
Joined: Fri Aug 31, 2012 8:28 pm

SQL Server Management Studio (SSMS) - Checkout doesn't work

Post by jloesch » Fri Aug 31, 2012 8:54 pm

With "Lock files on check out" set to checked, if I was the last person to commit a change to the repository, checkout works. If someone else changed the file, and committed it to the repository, if fails with the message "File checked out to someone else," when nobody else has it checked out. It actually gets the lock, but doesn't seem to think it did.

With "Lock files on check out" set to not checked, checkout seems like it works, but more than one person can check files out at the same time, and only the last person to check out will be able to commit any changes. All others will think they committed changes, but it won't actually happen.

I have the latest version of both AgentSVN and TortoiseSVN. We're using the Local File protocol to access the repository. The other options are: "Mark files as read-only when not checked out": checked; "Use the built-in SVN client tools": checked

jussij
Site Admin
Posts: 2449
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Sat Sep 01, 2012 3:30 am

With "Lock files on check out" set to checked, if I was the last person to commit a change to the repository, checkout works. If someone else changed the file, and committed it to the repository, if fails with the message "File checked out to someone else," when nobody else has it checked out.

I am a little confused here. Did someone else change the file while you had it locked :?:

If so did they break the lock to make the change :?:

I suspect what you might be seeing is another issue and to be clear on this could you try the following:
  1. Turn on "Lock files on check out"
  2. Check out a file.
  3. This file is now shown as locked in TortoiseSVN to your user name (this is very important).
  4. Make a change to the file.
  5. Check in those file changes (I suspect this might fail with the "File checked out to someone else" message).
    If it does not fail the file will be shown in TortoiseSVN as not locked (again this is very important).
If that does work then it is working as expected.

But if it fails it suggests that there is a mismatch in User ID's (i.e. the user ID shown in the lock and the user ID of the local machine) and hence the reason for the message.
With "Lock files on check out" set to not checked, checkout seems like it works, but more than one person can check files out at the same time
That is correct.
only the last person to check out will be able to commit any changes. All others will think they committed changes, but it won't actually happen.

This should not be the case and if you are seeing this behaviour then we have a bug :(

What should happen is Agent SVN should just commit the changes and where possible just merge in the changes into repository version.

Now what can happen, depending on what gets changed, you can create a merge conflict error and this will fail the check in.

Those conflicts will have to be fix by hand using a merge tool just like SVN proper.
The other options are: "Mark files as read-only when not checked out": checked; "Use the built-in SVN client tools": checked
Also to help identify the cause of this issue could you turn on the debug option as well.

You can then locate the log file using the ... button.

If you then recreate the "File checked out to someone else" message and send me the log file I will get a better idea of what might be going wrong.

Cheers Jussi

jussij
Site Admin
Posts: 2449
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Tue Sep 04, 2012 6:23 am

There did appear to be a bug in the file locking code in Agent SVN :(

This issue should be fixed in the latest version found here: http://www.zeusedit.com/agent/bin/asvn-v221.zip

Cheers Jussi

jloesch
Posts: 4
Joined: Fri Aug 31, 2012 8:28 pm

Post by jloesch » Tue Sep 04, 2012 5:08 pm

That updated did indeed fix the locking problem. Based on the changes in output in the debug info file, my guess as to what was happening appears to have been correct. Since we now have the behavior we need here, my coworker doesn't want to spend any more time testing, so I can't verify the behavior without the locking, as that takes 2.

I will tell you what I saw happening (what I remember, anyway).
  • Person A and Person B both have "Lock Files on check out" un-checked.
    Person A checks out a file - AgentSVN property added to file in svn, with "checked out to Person A".
    Person B checks out same file - AgentSVN property on file replaced with "checked out to Person B".
    Both make changes to their local copies.
    Person A checks in the file - AgentSVN property removed from file, and changes committed to repository.
    Person B checks in the file - tries to remove AgentSVN property, it fails, and so the commit of changes to the repository don't happen, but the user is never notified. It looks like the check in worked.
Sorry I can't test it more, and provide debug output.

jussij
Site Admin
Posts: 2449
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Wed Sep 05, 2012 5:33 am

Person B checks in the file - tries to remove AgentSVN property, it fails, and so the commit of changes to the repository don't happen, but the user is never notified. It looks like the check in worked.

In the process of fixing and testing the locking issue I too came across this issue.

The problem was any time the commit failed (i.e. on conflict errors for example) the error was not being trapped correctly, so the file incorrectly appeared to be checked.

This issue should also be fixed in that latest version found here: http://www.zeusedit.com/agent/download.html

Cheers Jussi

danielarturo
Posts: 3
Joined: Wed Feb 20, 2013 6:38 pm

Post by danielarturo » Wed Feb 20, 2013 6:42 pm

Hi there

I'm using version 2.25 and still having same issue, this is my issue:
User A add a new solution to SVN
User B Opens Solucion and Check-Out a File
User B Gets an error message telling that someone else is working on that file
When i check in repo-browser found that the file is locket by User B

Is there any Fix?

jussij
Site Admin
Posts: 2449
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Wed Feb 20, 2013 10:05 pm

Is there any Fix?
Can you please do the following:
  1. Start the Agent SVN configuration tool
  2. Turn on the "Help debug the SVN setup ..." option.
  3. Click on the ... button to bring up the log file. Inside this file will be the file location.
  4. Start SSMS and replicate the issue you are seeing.
  5. Send me the debug log file produced as an attachment. Use the e-mail button below.
With that log file it should be fairly easy to get to the bottom of this issue.

Cheers Jussi

jussij
Site Admin
Posts: 2449
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Mon Feb 25, 2013 1:10 am

From the log file provided it appeared the local user logon and the subversion logon where not the same.

With the lock file on check-out option enabled this causes problems with the check-out because Agent SVN sees the file as being locked by someone else and as such it fails the check-out.

In this case the options are:

(1) Make sure the logal and subversion user ids are the same
(2) Turn of the Agent SVN file locking option.

Cheers Jussi

danielarturo
Posts: 3
Joined: Wed Feb 20, 2013 6:38 pm

Post by danielarturo » Mon Feb 25, 2013 5:27 pm

The subversion user id and agent svn user are the same, but in some point when Agent SVN checks the lock status it uses the machine name insted of the configured user

jussij
Site Admin
Posts: 2449
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Mon Feb 25, 2013 10:10 pm

Unfortunately the protion of the log file that you sent thru did not contain the call to the SccOpenProject function, which is the function that establishes the user ID for the session. So it was not possible to determine what user ID the IDE thinks should be used for the session.

But from the small portion of the log file that was provided the user ids where not the same and that was causing the problem with the check out.

As to why the user details are getting out of synch, I can't tell. That information was not in the portion of the log file provided.

Cheers Jussi

danielarturo
Posts: 3
Joined: Wed Feb 20, 2013 6:38 pm

Post by danielarturo » Mon Feb 25, 2013 11:50 pm

Hi Jussi

I sent you the complete log that the plug in gave in, as an adittional data in the mail i included a print screen of the plugin configuration, when i cheched Tools > Options > Source Control > Plug-in settings, the first time that i entered after installing Agent SVN the Login ID was "Usuario 1" (Machine name) but i changed to "jalba" before start working with source control

Somehome the plug-in doesnt take that change and still using "usuario 1" for some operations, but everytime i check the setting the login still be "jalba"

How can i help you to fix this issue ?

Regards

jussij
Site Admin
Posts: 2449
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Tue Feb 26, 2013 1:29 am

How can i help you to fix this issue?

Are you using SSMS with an active/open project file :?:

If I follow the instructions in SSMS the tutorial to create a test project I see the following information in the log file when I open that project in SSMS:

Code: Select all

>> SccOpenProject
>> *   Command: svn.exe --non-interactive --version --quiet 
>> * Directory: C:\Documents and Settings\JussiJ\Desktop\
>> Process started.
>> Process running....
>>    1.7.2
>> Process completed with exit code: 0
>> Result: 0
>> Caller Name: VssProvider
>> Log File: C:\Documents and Settings\JussiJ\Local Settings\Application Data\Xidicone\Agent SVN\AgentSVN.log
>> User ID: JussiJ
>> Current User ID: JussiJ
>> *   Command: svn.exe --non-interactive info "file:///C:/Temp/Testing/SVN Repo/SQL Server Scripts1/trunk"
>> * Directory: C:\Documents and Settings\JussiJ\My Documents\SQL Server Management Studio\Projects\SQL Server Scripts1
>> Process started.
>> Process running....
>>    Path: trunk
>>    URL: file:///C:/Temp/Testing/SVN%20Repo/SQL%20Server%20Scripts1/trunk
>>    Repository Root: file:///C:/Temp/Testing/SVN%20Repo
>>    Repository UUID: 79f04d11-e90e-e142-9755-5689727864a7
>>    Revision: 100
>>    Node Kind: directory
>>    Last Changed Author: JussiJ
>>    Last Changed Rev: 100
>>    Last Changed Date: 2013-02-25 10:56:30 +1100 (Mon, 25 Feb 2013)
>>    
>> Process completed with exit code: 0
>> Result: 0
I did not see this call to SccOpenProject in the log file you sent me :(

Cheers Jussi

Post Reply
kuchnie warszawa opinie

Who is online

Users browsing this forum: No registered users and 14 guests