You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Gonzalo Bourdieu <go...@gmail.com> on 2006/06/08 23:07:43 UTC

Post-commit + Svn Update + Windows 2003 arghh

Hi,
tired of searching throught all the mailings lists archives, and googling
for hours,
i'd decide to ask for help, believe me that this is my last hope =D

Well, i have 3 machines involved in this problem:
1- my local machine where i have the development environment with a working
copy
runs on a Windows XP and i commit changes with Tortoise.

2- Repository machine,
Specs:
- Windows 2003
- Apache 2.0.58
- SVN 1.31
- Map Drive linking to the Test Server directory

3- Test Server where i have a working copy that needs to be updated
everytime i (or someone else)
make a commit to the repository.

Everything works fine, except the post-commit hook that is written in C#
with .net 2.0,
this post-commit, basically creates a process (svn update) and after that
writes a new line
in something that intends to be a log.

When i run post-commit.exe from command line, everything works fine, but
when it is
triggered by SVN, it writes the log, but doesn't make the svn update.
All paths are correct, and i've tried every solution found in the archive
without success

The output generated by svn update is empty (i realize this when i write it
on the log)
So i really don't know what it is.
I've tried to move the WC to the Repository server, thinking that some type
of permissions
where broking everything, but the Local WC wasn't update neither.

The only thing that i can imagine is that apache doesn't have permissions to
create a process, but i dont understand why there is no error.

any ideas?
Thanks in advance!

Re: Post-commit + Svn Update + Windows 2003 arghh

Posted by Andy Levy <an...@gmail.com>.
On 3/6/07, makeyunbad <ma...@gmail.com> wrote:
> 2006/6/9, Nathan Kidd <na...@spicycrypto.ca>:
> > Gonzalo Bourdieu wrote:
> > > I don't have any post-commit.bat, the post-commit hook is an .exe
> > >
> > > I'm using full paths to call svn so that couldn't be a problem (i think).
> > >
> > > the C# code is very simple, here you have it:
> > ...
> > >             // Z is the mapped drive
> > >             svnProgram.StartInfo.Arguments = "update Z:\\site\\project";
> >
> > Probably the user your svn service (svnserve / apache) runs under
> > doesn't have permission to see this Z:\ share.   There are definitely
> > permission issues between logged in / unlogged in users when it comes to
> > accessing mapped drives.
> >
> > -Nathan
> >
> I have the same problem as Gonzalo Bourdieu. I think this is a true
> reason for mapped drive. When he run post-commit.exe from command
> line, everything works fine. So is permission a true reason? If I can
> access the mapped drive, how can I config the permission?

If no user is logged in, the drive probably won't be mapped - you'll
need to use the UNC path. You also need to ensure that the user
account under which Apache/svnserve runs on the SVN server has the
permissions it needs to perform whatever operations it does on that
network share.

Or, you could start your hook script with net use to map the drive to
a letter, using another username.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Post-commit + Svn Update + Windows 2003 arghh

Posted by makeyunbad <ma...@gmail.com>.
2006/6/9, Nathan Kidd <na...@spicycrypto.ca>:
> Gonzalo Bourdieu wrote:
> > I don't have any post-commit.bat, the post-commit hook is an .exe
> >
> > I'm using full paths to call svn so that couldn't be a problem (i think).
> >
> > the C# code is very simple, here you have it:
> ...
> >             // Z is the mapped drive
> >             svnProgram.StartInfo.Arguments = "update Z:\\site\\project";
>
> Probably the user your svn service (svnserve / apache) runs under
> doesn't have permission to see this Z:\ share.   There are definitely
> permission issues between logged in / unlogged in users when it comes to
> accessing mapped drives.
>
> -Nathan
>
I have the same problem as Gonzalo Bourdieu. I think this is a true
reason for mapped drive. When he run post-commit.exe from command
line, everything works fine. So is permission a true reason? If I can
access the mapped drive, how can I config the permission?
mine:
windows 2003 sp1
svn 1.4.2

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Post-commit + Svn Update + Windows 2003 arghh

Posted by Nathan Kidd <na...@spicycrypto.ca>.
[Please keep replies on the list]

makeyunbad wrote:
>>
>> Probably the user your svn service (svnserve / apache) runs under
>> doesn't have permission to see this Z:\ share.   There are definitely
>> permission issues between logged in / unlogged in users when it comes to
>> accessing mapped drives.
> 
> I have the same problem as Gonzalo Bourdieu. I think this is a true
> reason for mapped drive. When he run post-commit.exe from command
> line, everything works fine. So is permission a true reason? 

When you run post-commit.exe from the command line it is running as the 
user you are logged in as.  When subversion runs post-commit.exe it runs 
  as the user the svn service (svnserve / apache) are running as 
(usually a completely different user).

> If I can
> access the mapped drive, how can I config the permission?

Configure what user is running your svn service as:

1. Start -> Run -> services.msc
2. Find your Subverison service in the list, right-click -> Properties
3. Log On tab -> Log on as: "This account"
4. Enter a user with rights to access the network resource.

You could also experiment with "Allow service to interact with desktop".

However, your setup will be much more robust if you can avoid requiring 
networked resources to be available in order for your hook scripts to 
successfully run.

-Nathan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Post-commit + Svn Update + Windows 2003 arghh

Posted by Nathan Kidd <na...@spicycrypto.ca>.
Gonzalo Bourdieu wrote:
> I don't have any post-commit.bat, the post-commit hook is an .exe
> 
> I'm using full paths to call svn so that couldn't be a problem (i think).
> 
> the C# code is very simple, here you have it:
...
>             // Z is the mapped drive
>             svnProgram.StartInfo.Arguments = "update Z:\\site\\project";

Probably the user your svn service (svnserve / apache) runs under 
doesn't have permission to see this Z:\ share.   There are definitely 
permission issues between logged in / unlogged in users when it comes to 
accessing mapped drives.

-Nathan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Post-commit + Svn Update + Windows 2003 arghh

Posted by Gonzalo Bourdieu <go...@gmail.com>.
I don't have any post-commit.bat, the post-commit hook is an .exe

I'm using full paths to call svn so that couldn't be a problem (i think).

the C# code is very simple, here you have it:

            String strCmd = "C:\\Program Files\\Subversion\\bin\\svn.exe";
            System.Console.OutputEncoding = Encoding.ASCII;

            Process svnProgram = new Process();
            svnProgram.StartInfo.FileName = strCmd;
            svnProgram.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
            svnProgram.StartInfo.RedirectStandardInput = false;
            svnProgram.StartInfo.RedirectStandardOutput = true;
            svnProgram.StartInfo.UseShellExecute = false;
            svnProgram.StartInfo.CreateNoWindow = true;
            // Z is the mapped drive
            svnProgram.StartInfo.Arguments = "update Z:\\site\\project";


            try
            {
                svnProgram.Start();
                string resultado = svnProgram.StandardOutput.ReadToEnd();

                svnProgram.WaitForExit();
                //System.Console.Write(resultado);

                svnProgram.Close();
                //System.Console.WriteLine("Anduvo todo OK");

                FileStream fileStream = new
FileStream(@"O:\repositories\projects\hooks\testing.txt", FileMode.Append);
                StreamWriter w = new StreamWriter(fileStream);
                w.WriteLine(resultado);
                w.WriteLine("-------------------");
                w.Flush();
                w.Close();
            }
            catch(SystemException e)
            {
                //System.Console.WriteLine(e.Message);
            }

Thanks!
Gonzalo


On 6/9/06, allan@muly.dk <al...@muly.dk> wrote:
>
> Quoting Gonzalo Bourdieu <go...@gmail.com>:
>
> > Everything works fine, except the post-commit hook that is written in C#
> > with .net 2.0,
> > this post-commit, basically creates a process (svn update) and after
> that
> > writes a new line
> > in something that intends to be a log.
> >
> > When i run post-commit.exe from command line, everything works fine, but
> > when it is
> > triggered by SVN, it writes the log, but doesn't make the svn update.
> > All paths are correct, and i've tried every solution found in the
> archive
> > without success
> >
> > The output generated by svn update is empty (i realize this when i write
> it
> > on the log)
> > So i really don't know what it is.
> > I've tried to move the WC to the Repository server, thinking that some
> type
> > of permissions
> > where broking everything, but the Local WC wasn't update neither.
> >
> > The only thing that i can imagine is that apache doesn't have
> permissions to
> > create a process, but i dont understand why there is no error.
>
> maybe you can post your post.commit.bat file [or its essentials] which
> presumably starts the c# hook exe file?
>
> so your 'svn update' command works in the sense that is actuallty run, or
> ?
> otherwise you might try the full path to svn.exe
>
> ./a
>
>
>

Re: Post-commit + Svn Update + Windows 2003 arghh

Posted by al...@muly.dk.
Quoting Gonzalo Bourdieu <go...@gmail.com>:

> Everything works fine, except the post-commit hook that is written in C#
> with .net 2.0,
> this post-commit, basically creates a process (svn update) and after that
> writes a new line
> in something that intends to be a log.
>
> When i run post-commit.exe from command line, everything works fine, but
> when it is
> triggered by SVN, it writes the log, but doesn't make the svn update.
> All paths are correct, and i've tried every solution found in the archive
> without success
>
> The output generated by svn update is empty (i realize this when i write it
> on the log)
> So i really don't know what it is.
> I've tried to move the WC to the Repository server, thinking that some type
> of permissions
> where broking everything, but the Local WC wasn't update neither.
>
> The only thing that i can imagine is that apache doesn't have permissions to
> create a process, but i dont understand why there is no error.

maybe you can post your post.commit.bat file [or its essentials] which  
presumably starts the c# hook exe file?

so your 'svn update' command works in the sense that is actuallty run, or ?
otherwise you might try the full path to svn.exe

./a


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Post-commit + Svn Update + Windows 2003 arghh

Posted by Steve Williams <st...@kromestudios.com>.
Gonzalo Bourdieu wrote:
> When i run post-commit.exe from command line, everything works fine, 
> but when it is
> triggered by SVN, it writes the log, but doesn't make the svn update.
> All paths are correct, and i've tried every solution found in the 
> archive without success

So you have a post-commit.exe?  Is it expecting environment variables to 
be set?  Hooks run with no environment, so PATH is not set.

-- 
Sly



This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org