You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2005/02/10 01:44:31 UTC

DO NOT REPLY [Bug 33480] New: - Please update doc with this note on why VSSGET gets SSDIR error

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33480>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33480

           Summary: Please update doc with this note on why VSSGET gets
                    SSDIR error
           Product: Ant
           Version: 1.6.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Documentation
        AssignedTo: dev@ant.apache.org
        ReportedBy: apache_bugzilla@mcnelly.org


If I run my ant script manually, no problems, but if I schedule it to run via
the Windows 'at' command, I get the error:

  [vssget] No VSS database (srcsafe.ini) found. Use the
  SSDIR environment variable or run netsetup.
  BUILD FAILED

I was unable to find the solution on the net, so (sigh) I had to debug it
myself.  If you could add a hint in the ant doc, I am sure others would
appreciate it.

The Reason Why
--------------
If the VSS database is on a remote machine, the ant process needs to access
network resources.  If you run the script manually, ant (like any other Windows
user process) uses your creds to access the network.  But depending on how you
schedule the job to run, Windows will prevent the ant script from accessing
network resources.

How To Fix It
-------------
There's a number of ways.  One way is to add something like this to the ant script:

  <property name="vss.share" value="\\serverName\shareName"/>
  <property name="netcmd.user"  value="domain\foo"/>
  <property name="netcmd.pass"  value="bar"/>

  <target name="init">

    <!-- Get rid of old share, if any.  Tolerate share not being there -->
    <exec dir="${basedir}" executable="cmd.exe" failonerror="false">
      <arg line="/c net use ${vss.share} /delete"/>
    </exec>

    <!-- Map new share -->
    <exec dir="${basedir}" executable="cmd.exe" failonerror="true">
      <arg line="/c net use ${vss.share} ${netcmd.pass} /U:${netcmd.user}"/>
    </exec>

  </target>

  <target name="allDone">
    <!-- Get rid of old share, if any -->
    <exec dir="${basedir}" executable="cmd.exe" failonerror="true">
      <arg line="/c net use ${vss.share} /delete"/>
    </exec>
  </target>

As a minimum, it'd be nice if the doc just noted if you try to run an ant script
as a background job (hint: daily builds), make sure the process has the ability
to access network resources, or you'll get the error mentioned above.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org