The system cannot find the specified drive in Jenkins

后端 未结 9 2427
半阙折子戏
半阙折子戏 2021-02-15 15:17

I want to copy some files from a network shared drive (mounted at my local machine as drive Z). I have written a Batch file to copy the contents of Z drive into my local drive.

9条回答
  •  再見小時候
    2021-02-15 15:47

    A similar issue showed up for us on Jenkins slaves set up on Windows Server 2008 following this documentation. The Jenkins agent failed to access the mounted network drives even after configuring the agent service with the correct user credentials.

    Troubleshooting:

    1. Jenkins could access the mounted network drives by their drive letters when connected via the JNLP agent (Launch agent via Java Web Start).
    2. It stops recognizing the drive letters soon after we install the agent as a Windows service. Configuring the correct user credentials and restarting the agent does not help.
    3. We could still access the drives via the command line while logged in to the machine with the above user.
    4. Stop the agent service from services.msc and then uninstall it by running the command jenkins-slave.exe uninstall. The slave is disconnected at this point.
    5. Reconnect the slave by launching the JNLP agent via Java Web Start. The agent can now access the network drives again.

    Synopsis:

    Do not install the slave agent as a Windows service to keep accessing your mounted network drives using drive letters. But this is highly unreliable as the agent might fail to restart after a machine reboot. Alternatively, see if Jenkins can access them via \\.

提交回复
热议问题