I am using ANT task Copy to copy a zip file from one share to another
<copy file="\\server_share\nightly\xyz08022012.zip" todir="Z:\output\Nightly"/>
when this gets executed, I am getting the below exception
Failed to copy \server_share\nightly\xyz08022012.zip to Z:\output\Nightly\xyz08022012.zip due to java.io.FileNotFoundException Z:\output\Nightly\xyz08022012.zip (The system cannot find the path specified.)`
When I change the Z:\output\Nightly to C:\temp, the copy works
Z:\ points to a server share which is mounted on the server with different user credentials and the drive is made persistent. This work around is because of the fact that when the build runs, the build user does not have access to the output share
Hence I mapped the server share as a network drive with different credentials (the user who has read/write permission) and made this drive persistent
This is on a Windows 7 machine where the build is running.
I tried doing a copy manually and that worked
I looked into Ant Copy Task: Failed to copy due to java.io.FileNotFoundException but doesn't help me
Related
I have directory csv in context directory of docker build. I want to copy it into docker image in all circumstances (for empty directory in host an empty directory inside image is created, for nonempty directory in host it is copied with all content).
The COPY csv/* /csv/ gives COPY failed: no source files were specified error when the directory is empty.
Similar questions I found on SO are differing from my case in either setup or intention (multistage build, copying existing jar, certainly existing file) so I choose Q&A-style here rather than messing question with unrelated answer. This Github issue is also related.
The solution is to use
COPY csv/. /csv/
This question gave me a hint (although the behavior desired by me is unwanted for its OP).
In a Dockerfile I want to copy a file relative to my local home inside the images's home.
So I have tried many variations of:
COPY "~/.m2/settings.xml" "$HOME/.m2/settings2.xml"
But I get errors like
COPY failed: stat /var/lib/docker/tmp/docker-builder635958043/~/.m2/settings.xml: no such file or directory
How can I copy a file relative to my local home inside the image?
The source for the COPY command is the build context. The build context is included in the last argument to the docker build command, often a . which means the current directory. This location is sent to the docker engine before running any steps of the Dockerfile, using a tar file, in the default/classic builder. Therefore, to keep builds running fast, you want to keep this directory small by not sending over the entire hard drive contents. This is even more important when building locally since you could potentially start sending files recursively if you were to include docker's temporary directory in the folders being sent.
All this means you should move any files you want to include in the COPY source parameter to be inside the build context, typically the same location as your Dockerfile.
There's a problem with TFS everywhere plugin for Eclipse if I try to revert or restore a file under a source control and if the folder/file is mapped to a different volume than the actual project.
When I try to restore or revert it, I get an error:
java.io.IOException: Failed to rename /Users/*/*/*/*/.tf1/8/d54f18aa-bdce-4ab7-958a-01eaaf0c36c1.tmp to /Volumes/macOSData/*/*/*/*/*/some_file.cs. Check the file and directory permissions.
Log has additional line:
2018-07-31 12:44:39,814 WARN [ModalContext] (com.microsoft.tfs.util.FileHelpers) Main rename failed (source permissions problem?), trying to rename temp file back
There's no problem while I get specific version of the project, even with overriding existing files, so there permissions are fine, at least for getting files. Also, this does not happen when the file is on the same volume as the local TFS mapping.
Setting all permissions to 777 does fix the problem, but this marks all files with +x making them all "changed", making this solution unacceptable.
I tried mapping the base folder to a second drive (i.e. force creating a .tf folder on a second drive), but this doesn't help. The error will appear when I try to revert stuff on the main volume.
I tried using symlinks so the mapping stays within the same volume, but still no luck.
Is there any way to solve this? Or everything should be on the same volume?
After a whole day of digging around and poking with jshell, this appears to be a bug with File.renameTo() in Java on macOS. renameTo function silently fails without any exception even though there's no permission issue to write to the destination. This happens only when writing to a different volume.
I have submitted a pull request into TFS Everywhere repo on github with a workaround for this issue.
Anyone interested can compile plugin with this changes to get things working:
https://github.com/Microsoft/team-explorer-everywhere/pull/276
I'm trying to work with release in TFS, I add a task a "Copy Publish Artifact" to publish a file that will be generated in a release it gives me the error:
##[error]System.Management.Automation.ParameterBindingValidationException: Cannot bind argument to parameter 'StagingFolder' because it is null.
I test with the task "Windows machine file copy" it gives the error 53
Copy started for - '\\documents-oab.si.fr.intSraorange\alfresco\webdav\Sites\cc-dtp\documentLibrary\andbox_Auto /user:***** *****'
2018-05-07T08:43:15.7623208Z ##[error]System.Management.Automation.RuntimeException: Copying failed for resource :
2018-05-07T08:43:15.7623208Z
2018-05-07T08:43:15.7623208Z Failed to connect to the path \\documents-oab.si.fr.intSraorange\alfresco\webdav\Sites\cc-dtp\documentLibrary\andbox_Auto /user:***** ***** with the user ***** for copying.
2018-05-07T08:43:15.7623208Z System error 53 has occurred.
2018-05-07T08:43:15.7623208Z The network path was not found.
My questions is: how can i publish file generated in a release is there any method ??
You can not publish an artifact in a release using staging folder, because it really does not exist. It is a build variable only.
When you used the "Windows machine file copy", is is showing you in the log that "The network path was not found.".
Or it really does not exist or the user running the task nas no permission to access it.
To copy a file to one location to another you could:
Use a Windows Machine File Copy
Use a File copy task
Use a powershell command to copy files
Use a command line to copy files
I'm creating some Windows Container images that I need but the source file I want to ADD are in a network share \\myserver\myshare\here.
I've tried in any possible way but I always get the message error The system cannot find the path specified.
Is it because I have not yet found the right way to set it or is it that it is just not possible?
From the Docker site:
Multiple resource may be specified but if they are files or directories then they must be relative to the source directory that is being built (the context of the build).
Is that why I can't accomplish what I need?
Full error message: GetFileAttributesEx \\myserver\myshare\here\: The system cannot find the path specified.
Whatever you ADD or COPY must be in the docker build context.
When you do this:
docker build .
That directory param (the . in the example) is the context that is copied and sent to the Docker daemon. Then the docker daemon use those files to COPY or ADD. It won't use any file that is not in that context.
That is the issue that you are experiencing. I'm not sure how you can solve it anything than copying the files from \\myserver to your build directory.
ADD is capable of download files by providing an URL (should investigate if it supports Windows' shares)