Unable to revert or restore changes in a folder mapped to a different Volume (macOS) - tfs

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

Related

Changing JENKINS_HOME to another hard disk

I tried many tutorials I found on the internet on how to change the location of my JENKINS_HOME.
I still encountered these errors:
On the jenkins app - Unable to create the home directory ‘/mnt/2fe95e40-f8ba-418e-804c-0a25571f7b0c/jenkins’. This is most likely a permission problem.
On the jenkins logs - SEVERE hudson.util.BootFailure#publish: Failed to initialize Jenkins
hudson.util.NoHomeDir
In the the tutorials they are saying that one of the reasons to change the JENKINS_HOME is the issue of the disk space, but their steps were always to change the directory to a new /home/<new_folder>. They are still using the same drive, they just change the folder it does not fix their disk space problem.
Does anyone know how to use the another hard disk as the new JENKINS_HOME? Without having to use
SymLink or Symbolic Link that point to another drive.
I am using Ubuntu 18.04.1 x64
Thanks.
I would do a fresh install on the new hard disk, then make a backup from the old location and restore it on the new disk.
If you do not agree with this approach you should check which user has permission on the Jenkins files and folders on the new hard disk.
stat [yourfilename or yourfolder]
Compare with JENKINS_USER variable in etc/default/jenkins.
Change the user if needed on the new location:
chown -R your_user /var/lib/jenkins
You will need to restart Jenkins and maybe reboot the machine.
As a second option, maybe Jenkins can not create its home directory in the new place. You can create the directory manually and then change JENKINS_HOME to point to it.
More info:
https://wiki.jenkins.io/display/JENKINS/Administering+Jenkins
https://askubuntu.com/questions/175054/how-to-find-owner-and-group-of-a-directory
Run jenkins job as another user
Can't get Jenkins to start using Tomcat

Jenkins console output has an error with log permissions

My jenkins setup is not overly complicated, there are just a bit over 200 jobs; the problem I'm having is as follows:
The jobs folder is mounted on NFS drive;
Some of the jobs are creating log file fine, but then it is loosing permissions completely (it becomes 000), resulting in an error on the console regarding log file permissions:
I've checked and rechecked permissions on the folder and all the jobs, but nothing is there stands out that could explain what's the cause of the problem. It's not an issue on its own, but some of the jobs are quite important, and without manually fixing permissions, they can't be debugged.
Any hints would be welcome.
I had the same issue, it's more than likely that your version control (e.g Perforce/SVN) sets log files to read only permissions when synced.
An easy work around to this problem is to add an "Execute Windows Batch Command" build step where you cd into the directory containing your log file and change it's permissions.
Use the commands:
cd
attrib -r
This will alter the permissions of your log file and allow your jobs to write to the file. I'm sure there's other ways of dealing with this issue but this is a pretty quick and easy way.

"Project file changed" issue in PhpStorm during working remotely

I have CIFS mounted folder on my PC, where houses a PHP project.
And very often dialog box appears with the message:
Project file /path/to/mounted/directory/.idea/workspace.xml" has been
changed externally. It is recommended to reload project for changes to
take effect.
I don't make any changes in this file, but PhpStorm thinks sometimes that file was changed and shows this dialog.
This directory mounts on system startup, and this is the corresponding fstab string:
//host/path /media/server cifs _netdev,credentials=/home/user/.smbcredentials,iocharset=utf8,sec=ntlm,uid=1000,gid=1000 0 0
This mount settings I've made today. Before that the directory was mounted through sshfs and all was OK without this annoying dialog box.
How can I resolve this problem?
I've found a current solution, I hope that this can help everyone that is encountering this issue.
**Go** to Settings (File->Settings (Ctrl+Alt+S) )
and reach Appearance & Behavior-> System Settings
uncheck all 4 options of Synchronization.
This is how I managed to fix this problem, now I don't have to
reverse commit,
No dialog box that the project has been modified externally and no workspace.xml popping up in SourceTree.

Git clone error in Xcode

Up until now I've been using Xcode with Subversion for my code repositories with no problem. Now I'm working on a project that uses a Git repository stored at GitHub, so I figured I'd go clone that repository to my local machine and get started.
In Xcode, I add the repository then tell it to Clone -- The machine chews on this for a while, and if I use the Finder I can see the files being placed in the target directory (which is a newly-created, empty directory on my system). After a while though, I get an error message:
fatal: destination path '/Users/myname/Documents/ProjectName' already exists and is not an empty directory.
I have tried this three times now, each time starting with an empty target directory, and it gives the same error message each time, so I know it has to be something I am doing wrong, or have not set up properly.
Thinking that perhaps something was going wrong and the system was trying to do a second clone operation (to a now non-empty directory) I tried canceling and trying a build, but some files are missing from the project -- so not all of it made it down to my system.
My searches on this issue turn up several hits for people doing the clone via command line and showing this error message, but not through the Xcode interface.
Does anyone have any suggestions about what might be going wrong?

trigger.io [Error 5] Access is denied

I just recently updated to the new version of forge, did not change anything on my setting and when I went to build my app I got an error that said it could not find the file..
so I made the copy of aapt file and put it in a directory where trigger said it was looking (the docs said trigger.io should have moved this file for me already but Im guessing it did not)
After I moved this file and ran the build again it looked like it found the file but now I get [Error 5] Access is denied.
I have checked the permissions on the folder as I am the admin and I have full permissions and I have launched trigger as an administrator and still nothing.
Thanks.
So again from what I can tell this is a problem with the python script that calls aapt.
When you look at the script it points only to aapt, this means its looking for a directory and not the aapt.exe file itself so the first thing that happens is
1) forge says it cant find the aapt directory, this is why you are getting the error message "cant find aapt tool"
2) by adding the directory you would get the access denied because then the script is trying to run all these commands on just the directory (this was the problem I ran into), by making the change below you do not need to create a directory, just leave everything how it is but add the exe and it should work
After doing some testing I found that by adding .exe to the pythong script in android_tasks.py the build was able to run successfully
if you look on line 35 of android_tasks.py and change 'appt' to 'appt.exe' it should build for you
this is what it looks like for me
path.join(sdk, 'build-tools', '*','aapt.exe')
Hope this helps

Resources