Trying to clone a remote repository using LibGit2Sharp v.0.18.1.0 throws this exception:
LibGit2Sharp.LibGit2SharpException: Failed to mmap. Invalid handle value: The volume for a file has been externally altered so that the opened file is no longer valid.
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
at LibGit2Sharp.Core.Ensure.ZeroResult(Int32 result)
at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts)
at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options)
Using the same url and workdir, I have successfully cloned the repository both using Git Bash and SourceTree. But for my task I need to do it programatically, and LibGit2Sharp seemed like a good choice.
Update: Somehow the error changed, now I get around 20KB of the remote repository and then this error:
A first chance exception of type 'System.AccessViolationException' occurred in LibGit2Sharp.dll
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Update 2: The AccessViolationException was caused by a different cause (trying to clone with an emtpy string as remote url!)
TL;DR
This is an issue with LibGit2Sharp v0.18.1. This will be fixed in the upcoming v0.19 (See PR #798).
More detailed information
It looks like Stash sends empty packets to keep the connection alive while the repository is being fetched. The embedded version of libgit2 in LibGit2Sharp v0.18.1 was thus trying to map a zero length file, causing the error.
It's been fixed meanwhile in libgit2 with commit libgit2/libgit2#bc8a08868.
Update
The Pull Request has been merged and the issue is fixed in the now released LibGit2Sharp v0.19. This issue should no longer happen.
Related
I am trying to pull a repository using Jenkins, by default Jenkins create a long and unreadable workspace name. I am getting this error because of that :
Caused by: com.microsoft.tfs.core.exceptions.TECoreException: The
specified path, file name, or both are too long. The fully qualified
file name must be less than 260 characters, and the directory name must
be less than 248 characters.
Could any one please help me how can I resolve this issue, does adding any parameter in config file will help?
Found the solution, just add this argument in jenkins.xml and restart jenkins and issue will be resolved.
-Djenkins.branch.workspaceLocatorImpl.PATH_MAX=0
Anecdotal thoughts, but two options would be:
Ensure you check out the repo files 'closer' to the root of the underlying filesystem so the repo can contain longer filenames/paths (e.g. use C:\code and not something like C:\company\project\jenkins...)
Consider anything in your repo that is causing such a long filename - personally I've seen this when using NodeJS and the node_modules folder is tracked in source control, going multiple folders deep
How do i know that online reindexing is done ?
I had a repository with name datadelivery-feed-tcp-c++ which I moved to datadelivery-feed-tcp-cpp and deleted the datadelivery-feed-tcp-c++ repository.
But On kicking online reindexing it gives a lot of below warning.It is stuck at this warning.
[2017-09-28 07:00:27,300] [Index-Batch-3] WARN com.google.gerrit.server.index.change.StalenessChecker : error checking staleness of 8737 in datadelivery-feed-tcp-c%252B%252B
org.eclipse.jgit.errors.RepositoryNotFoundException: repository not found: Invalid name: datadelivery-feed-tcp-c%252B%252B
I have tried flushing cache also
ssh -p 29418 host gerrit flush-caches --all
How do I resolve it ?
EDIT : By renaming a repo I meant, I have cloned it and imported all the data into other project, verified it and then removed it using delete project plugin
I think you already had changes in the datadelivery-feed-tcp-c++ repository and you just renamed it at the filesystem, correct? You can't do that because you need to adjust the database data accordingly. The better way to rename a repository is doing the following:
1) Clone the original repository (with all existing changes) creating a new one with the new name. Use the importer plugin to do that.
2) Remove the original repository (and all related changes). Use the delete-project plugin to do that.
Notes:
i) In your current case, first rename the repository back to the original name at the filesystem.
ii) You can download the plugins here.
I'm using this Publish over CIFS Plugin and I contiinous get an error, even though the copy succeeds. What I'm trying to do is to copy all the contents of a build results directory, all all it's assets, to the remove host. However I get an error message that I can't explain, and the on-line help is failing me.
On the Transfers Section I have only 1 block and this is the setup
Source files: build/123.456/**
Remove prefix: build/
Remote directory: builds/this_release/Latest/
Below are the error messages I get.
CIFS: Connecting from host [my-host]
CIFS: Connecting with configuration [to-host] ...
CIFS: Disconnecting configuration [to-host] ...
ERROR: Exception when publishing, exception message [A Transfer Set must contain Source files - if you really want to include everything, set Source files to **/ or **\]
Build step 'Send build artifacts to a windows share' changed build result to UNSTABLE
What I don't understand is that files under the 'build/123.456/', and sub-directories, get copied as I wanted but still I get an error. Any suggestions on how to correct that ? I've tried removing the '**' and it still works, but I still get an error.
Actually I've found the reason for my error.
I had a second (empty) Transfer Set defined on my job, with no fields filled in
This Set was the reason for the error message.
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?
The story:
I've been developing a RoR-app in both my desktop and laptop. It was quite handy to commit changes made on another, push them to github and fetch & merge on other.
The starting point is this: I committed latest changes on my desktop, pushed them to github and then fetched and merged them into my laptop. Then, I made some commits on laptop and pushed to github. Took the changes, merged to my desktop (with --no-ff). THEN, happened the probable source of all mischiefs: I reverted the desktop to commit where it was before the latest fetch & merge. Made some development work with it, committed, pushed to github. In the laptop, I did the revert as well, though I reverted it to a commit which was made somewhere between the latest fetch from github, fetched again and merged those. Some error messages came after reverting desktop and laptop both, but things worked still fairly well and I kept working on both machines.
Until now. I tried to push from my laptop to github, which gives the following output:
Counting objects: 106, done.
error: unable to find 5a2a4ac...
error: unable to find bc36923...
error: unable to find ecb0d86...
error: unable to find f76d194...
error: unable to find f899df7...
Compressing objects: 100% (64/64), done.
fatal: failed to read object 5a2a4ac... : Invalid argument
error: failed to push some refs to 'git#github:username/repo.git'
So, the question is, what exactly took place here?
EDIT: It seems that because of suspending my laptop and moving it from place to place in that state screwed up the hard drive somehow. The fsck output is unavailable because we worked around the problem and kept on working, but IIRC some branches and commits were dangling, including that commit which git failed to read. - Teemu
I have run into these kinds of issues.
Rather than spending hours trying to resolve and fix these issues, my 'solution' is usually to take the code I want, copy it into a new directory, delete the .git files and then create a new github for it and then connect the two as usual.
Although this may not be a specific answer to the details you raise, I find that there can be a number of ways that git/github issues can happen and rather than wishing I was a 'git expert' now (it's happening but it takes time), I do the above and continue with my actual application development.
The problem you have is that you are trying to read objects that are not part of your 'tree'. They exist but they have been orphaned. However, git allows you to merge one project to another so this is one way you can keep your commits without starting again, something like the following:
git remote add -f somename git://somegitplace.com/user/some.git
git merge -s ours --no-commit somename/master
git read-tree --prefix=ext/somename -u somename/master
git commit -m 'external merge'
git pull -s subtree somename master
Hope that helps. Let me know if not and we can attack it again