Gerrit version 2.14.4 online reindexing stuck - gerrit

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.

Related

How is electron-updater able to find my repository?

I have a repository that utilizes electron-updater for auto update. The weird thing is, it has no any code whatsoever pointing where the release updates are stored (I store it in GitHub releases), but somehow the autoUpdater.checkForUpdatesAndNotify() still works. There is github remote origin but I doubt it's being used by electron-updater to find the repository. I don't use any GitHub token either.
The way I release update:
Increase the version in package.json
Run electron-builder, producing .AppImage
Create new release draft in my repository's GitHub releases
Upload the .AppImage file to the draft's assets and modify the draft's tag
Download the previous release, and then open it
Voila! The update works. But how?
It's worth mentioning that if latest-linux.yml is missing from the latest release's asset, it will throw 404 error and refuse to update despite knowing the latest version's tag.
Here's the repository I'm talking about: https://github.com/SnekNOTSnake/fresh-update/releases
Also, is this how normal people release their electron app? I tried the electron-builder --publish way, but it's troublesome compared to the manual steps above.
Thanks to Caramiriel in the comment section above for the enlightenment.
How electron-updater knows where to find the repository is from resources/app-update.yml inside the produced .AppImage file.
The app-update.yml file is produced by electron-builder using the information from git remote get-url origin (if available).
I proved it by changing the origin's url to https://github.com/SnekNOTSnake/tofu-tracker.git and build the AppImage, and (surprisingly enough) the repo's value became tofu-tracker.

Can't run Rails app after "deploying" hidden file

I was trying to hide my credentials before pushing the repository publicly, as I should.
For that, I've used this resource, which worked perfectly on development mode.
For short, I've assigned global variables inside a ".api_keys.rb" file, called them on the appropriate file (devise.rb on this case) and added it to .gitignore.
Then I pushed it to GitHub. Later on, I needed to clone this one last commit. But then when I try running it, it responds with "cannot load such file -- /path/.api_keys.rb".
What am I missing? I can provide any more details if needed. Thank you.
Adding a file to .gitignore means that the file is removed from the repository and only exists locally because the file is ignored by git completely.
Because it is not stored in your git repository anymore it is not available to remote servers or other developers when pulling the repository from GitHub.
To fix this your need to remove the file from .gitignore and push it again when it still exists on your machine or you need to recreate it.
Btw the way to store, for example, API keys securely in Rails is to use encrypted files. I suggested reading in the [Rails Guides about Environmental Security and Custom Credentials].(https://edgeguides.rubyonrails.org/security.html#environmental-security)

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?

Git push fails to github: failed to read object

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

git clone problem

i have create clone of project on local machine with
git clone git#github.com:test/abc.git
Now i want to deploy my project on my ubuntu server .
so i have created a script which install git on my ubuntu server.
And now i want to deploy my rails project on server.
like git clone git#github.com:test/abc.git but i have not set ssh key on my server.
Is there any way i can create clone without set up ssh key on my server.
Is compulsotion that we have to create to ssh each on every server?
What if i have 20 server ? i need to set up ssh key for every server to clone?
Is there any way just ask the password than it will create a clone?
Or any other way?
You can use the read-only version. Next to the name of your repository you can select the http protocol. This url can be used without ssh key. If it is a private repository you'll need to add your username to the url.
$ git clone http://myname#github.com:test/abc.git
Initialized empty Git repository in /Users/myname/Projects/abc/.git/
password:
Then you type your password and a bit later you have your clone. A disadvantage is that you need to enter your password if you use a private repo.
Although I fail to see the problem of adding a few ssh-keys. If you really need to deploy to 20 servers you might consider thinking of using a packaging method with good OS support for automatic updating.
It is a mistake to try to use a configuration management tool in order to deploy an installation. Do you really intend to update the code from each of those 20 systems? Why then are you granting them write access to the code?
Create a tarball or use whatever package management systems are available in the language you are developing in (e.g. in Perl, you could use Dist::Zilla, Module::Install or ExtUtils::MakeMaker).
We created a php script which built RPMs (and Using Alien also built DEBs) for updating our 200+ machine fleet. As a url like "http://repo/fetch/rpm/" was called a script checked if there had been a new git tag inserted in package_name repository and if so use an RPM template we created on a per repo basis (typically put in .build/rpm.spec) to build the RPM, save it to a local cache directory and read the contents out as a file header.
I realize for your application that won't work since you're using GitHub - but it's just an idea for those who have their own remote repositories. A cron on the boxes would query once a day those URLs and run rpm -Uvh on the output.
For your instance it might be wise to tarball each release and either put that in a public accessible URL or create a script to rsync it to each server + exec
If you're deploying rails projects, you should check out Capistrano - http://www.capify.org/index.php/Getting_Started

Resources