Gulpfile, Rsync,RsyncWrapper, Rsync Exits with code 12 - vagrant

Im trying to use gulp to handle my rysnc task from a local dev environment to a running vagrant machine.
The gulp task is set up like this:
var rsync = require('rsyncwrapper').rsync;
var secrets = require('./secrets.json');
// ###Rsync
// Ran from gulp
gulp.task('deploy', function() {
rsync({
ssh: true,
src: './website/',
dest: secrets.servers.dev.rsyncDest,
recursive: true,
syncDest: true,
exclude: ['node_modules'],
args: ['--verbose'],
privateKey: './.vagrant/machines/default/virtualbox/private_key',
onStdout: function (data) {
console .log (data.toString ());
}
},function (error,stdout,stderr,cmd) {
if ( error ) {
// failed
console.log(error.message);
} else {
// success
console.log("folder synced!");
}
});
});
The secrets.json contains the path to my destination vagrant machine:
{
"servers": {
"dev": {
"rsyncDest": "vagrant#192.168.2.101:/opt/webiste"
}
}
}
The rest of my gulp file works without issue, a normal vagrant rsync also works to transfer the file across.
However, when I run my task deploy, I simply get: Rsync Exited with code 12.
After some googling I found that this means the protocol stream has failed but I am unsure as even where to begin trying to fix this issue.
Any help would be greatly appreciated!

I encountered the same problem. It occurred when I destroyed and rebuilt my vagrant machine, but I left the old key in ~/.ssh/known_hosts file. The error message gulp-rsync isn't helpful. If you try to login directly you'll get an error like this:
>> ssh vagrant#192.168.50.104
###########################################################
# WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! #
###########################################################
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
87:9b:39:02:b8:96:6b:21:01:fa:b5:42:5f:0a:0b:f7.
Please contact your system administrator.
Add correct host key in /Users/me/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/me/.ssh/known_hosts:36
RSA host key for 192.168.50.104 has changed and you have requested strict checking.
Host key verification failed.
To fix it, edit the file ~/.ssh/known_hosts. Remove the line for the host key of your vagrant machine. In my case, it was line beginning with 192.158.50.104.
The next time you run gulp-rsync, you'll have to type yes at the prompt.

Related

failed to install greenplum command center when running gpccinstall

I downloaded greenplum-cc-web-4.6.1-LINUX-x86_64.zip for my greenplum db with 5.18, and followed this link (https://gpcc.docs.pivotal.io/460/topics/setup-collection-agents.html) to install command center. Everything is OK while there is a failure about gpccinstall. It showed following errors:
RunCommandOnEachHost fail on host: client-gp03.bj
Error when unzip remote binary on sdw3 bin/gpccws
bin/ccagent
bin/gpcc
conf/app.conf
gpcc_path.sh
bin/start_agent.sh
bin/queryinfocat.sh
bin/gpcc_md5
ccdata/
alert-email/alertTemplate.html
alert-email/send_alert.sh.sample
languages/
languages/zh.json
languages/en.json
Error when unzip remote binary on client-gp00.bj bin/gpccws
bin/ccagent
bin/gpcc
conf/app.conf
gpcc_path.sh
bin/start_agent.sh
bin/queryinfocat.sh
bin/gpcc_md5
ccdata/
alert-email/alertTemplate.html
alert-email/send_alert.sh.sample
languages/
languages/zh.json
languages/en.json
Error when unzip remote binary on client-gp01.bj bin/gpccws
bin/ccagent
bin/gpcc
conf/app.conf
gpcc_path.sh
bin/start_agent.sh
bin/queryinfocat.sh
bin/gpcc_md5
ccdata/
alert-email/alertTemplate.html
alert-email/send_alert.sh.sample
languages/
languages/zh.json
languages/en.json
Error when unzip remote binary on client-gp02.bj bin/gpccws
bin/ccagent
bin/gpcc
conf/app.conf
gpcc_path.sh
bin/start_agent.sh
bin/queryinfocat.sh
bin/gpcc_md5
ccdata/
alert-email/alertTemplate.html
alert-email/send_alert.sh.sample
languages/
languages/zh.json
languages/en.json
Error when unzip remote binary on client-gp03.bj Warning: the ECDSA host key for 'client-gp03.bj' differs from the key for the IP address '10.136.173.8'
Offending key for IP in /home/gpadmin/.ssh/known_hosts:10
Matching host key in /home/gpadmin/.ssh/known_hosts:17
tar: bin/gpccws: Cannot open: File exists
tar: Exiting with failure status due to previous errors
RunCommandOnEachHost failure happened
Can anyone encounter this issue before? I did some search in google and pivotal community, but failed to find some solution. Any help is appreciated.
BTW, when I ignored above errors, and continued, I found the gpcc web server can be started successfully. And when I logged in, only "Query Monitor" UI section show one warning: "GPCC is no longer receiving updates. Check your network status or gpcc status and refresh this page.", other part of UI seems OK.
From here:
Error when unzip remote binary on client-gp03.bj Warning: the ECDSA host key for 'client-gp03.bj' differs from the key for the IP address '10.136.173.8'
Offending key for IP in /home/gpadmin/.ssh/known_hosts:10
Matching host key in /home/gpadmin/.ssh/known_hosts:17
tar: bin/gpccws: Cannot open: File exists
tar: Exiting with failure status due to previous errors
You have duplicate ssh fingerprint keys in your /home/gpadmin/.ssh/known_hosts file. I recommend removing both lines 10 and 17 from that file, then running ssh-keyscan client-gp03.bj >> /home/gpadmin/.ssh/known_hosts
After this is complete, try ssh-ing to the host, to see that the fingerprint error is cleared up, and if so, try the gpcc installation again.

Yocto build broken when setting a remote rpm repository with https

I have generated a Yocto image to be used on all my target devices. When that image is running on target devices, it must be able to be updated using a rpm remote repository through https protocol.
To try doing that, I have added a dnf bbappend to my custom layer:
$ cat recipes-devtools/dnf/dnf_%.bbappend
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += " \
file://yocto-adv-rpm.repo \
"
do_install_append () {
install -d ${D}/etc/yum.repos.d
install -m 0600 ${WORKDIR}/yocto-adv-rpm.repo ${D}/etc/yum.repos.d/yocto-adv-rpm.repo
}
FILES_${PN} += "/etc/yum.repos.d"
This is the content of repository configuration file included by dnf bbappend recipe:
$ cat recipes-devtools/dnf/files/yocto-adv-rpm.repo
[yocto-adv-rpm]
name=Rocko Yocto Repo
baseurl=https://storage.googleapis.com/my_repo/
gpgkey=https://storage.googleapis.com/my_repo/PACKAGEFEED-GPG-KEY-rocko
enabled=1
gpgcheck=1
This repository configuration breaks the build process of the image. When I try to build myimage recipe, I always get this error:
ERROR: myimage-1.0-r0 do_rootfs: [log_check] myimage: found 1 error message in the logfile:
[log_check] Failed to synchronize cache for repo 'yocto-adv-rpm', disabling.
ERROR: myimage-1.0-r0 do_rootfs: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/yocto/yocto/build/tmp/work/machine-poky-linux/myimage/1.0-r0/temp/log.do_rootfs.731
ERROR: Task (/home/yocto/yocto/sources/meta-mylayer/recipes-images/myimage.bb:do_rootfs) failed with exit code '1'
However, when I replace the "https" by "http" in "baseurl" variable:
baseurl=http://storage.googleapis.com/my_repo/
Then the myimage recipe is built fine.
The host machine can download files from the https repository using wget:
$ wget https://storage.googleapis.com/my_repo/PACKAGEFEED-GPG-KEY-rocko
Previous commands works fine, so the problem is not related with the host machine, I think it must be something related with google certificates and yocto stuff.
I found some relevant information inside this file:
yocto/build/tmp/work/machine-poky-linux/myimage/1.0-r0/temp/dnf.librepo.log
The relevant part:
15:56:41 lr_download: Downloading started
15:56:41 check_transfer_statuses: Transfer finished: repodata/repomd.xml (Effective url: https://storage.googleapis.com/my_repo/repodata/repomd.xml)
15:56:41 check_finished_transfer_status: Fatal error - Curl code (77): Problem with the SSL CA cert (path? access rights?) for https://storage.googleapis.com/my_repo/repodata/repomd.xml [error setting certificate verify locations:
CAfile: /home/yocto/yocto/build/tmp/work/x86_64-linux/curl-native/7.54.1-r0/recipe-sysroot-native/etc/ssl/certs/ca-certificates.crt
CApath: none]
15:56:41 lr_yum_download_repomd: repomd.xml download was unsuccessful
Can some of you provide any useful advice to try to fix this?
Thank you in advance for your time! :-)
I finally fixed my issue removing completely my dnf bbappend recipe from my custom layer and adding this variable to my distro.conf file:
PACKAGE_FEED_URIS = "https://storage.googleapis.com/my_repo/"
After that, at the end of the build process the image contains a valid /etc/yum.d/oe-remote-repo file and all the necesary stuff to manage it. There is no need to copy "ca-certificates.crt" manually at all.
Also, it's important to execute this command after finishing the build of the image:
$ bitbake package-index
This command generates a "repodata" directory within the package feed needed by the target device once it uses the repo to update packages using dnf client.
I found a temporal hack to fix my issue:
$ cp /etc/ssl/certs/ca-certificates.crt /home/yocto/yocto/build/tmp/work/x86_64-linux/curl-native/7.54.1-r0/recipe-sysroot-native/etc/ssl/certs/
After that, I was finally able to build the image using the "https" repo.
Now I am in the process of fixing this issue in the right way. I'll come back with the final solution.

GitHub for Mac crashes on open because of local repository issue

I am trying to figure out why my GitHub for Mac crashes on start when I choose a local repository. I added this local repository from a folder I had cloned. Unfortunately, I was playing around with the git command line and I must have done something to corrupt the local repository.
Now my GitHub for Mac is trying to access this corrupted repository on reopen and I can't change it within the program before it crashes. I would rather not purge the system of files because I have other repositories saved in GitHub for Mac.
How exactly would I be able to solve this issue or delete the reference to this local repository that is causing me massive issues? I have attempted to get an answer from the people at GitHub but they have not responded to me yet. Thank you. The error I am getting is below.
*** Terminating app due to uncaught exception
NSInternalInconsistencyException', reason: 'Received error from <RACDynamicSignal: 0x600000e3dca0> name: in binding for key path` "headerContentViewModel" on <GHChangesViewModel: 0x600000129420>:
NSError { domain: GTGitErrorDomain, code: -12, description: "Failed to create reference to tracking branch from <GTBranch: 0x600000e20c00> name: refs/heads/master, shortName: master, sha:
b5db93cacaf51cde5ad27c605c4bdb114cd23605, remoteName: (null), repository: <GTRepository: 0x60000041b4e0> fileURL: file:///Users/name/Desktop/personalWebsite/", underlying error: NSError { domain:
GTGitErrorDomain, code: -12, description: "'https://github.com/name/git.git' is not a valid remote name." } }'
terminating with uncaught exception of type NSExceptionabort() called
I had this same problem, the source turned out to be an incorrect line in my .git/config file.
The master branch had these lines:
[branch "master"]
remote = git#github.com:/.git
which matched most of the url value for the [remote "origin"] line.
Changing the line to this:
remote = origin
Fixed the problem immediately, and no more "Unable to create tracking branch" errors like I've had for quite some time.
Be sure to make a copy of that line in case it doesn't work.
GitHub support verified that this was the correct solution - at least in my case.
It looks like you've changed the config file, specifically for the repo location. If you're not able to repair the git config file yourself, can you do cat ./.git/config for us?

gitlab-shell ssl cert issues

I've tried now for several hours te set up gitlab and especially gitlab-shell. After being trolled by the documentation I found a sample config, that fitted my needs, but I get an API 500 error :
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: FAILED. code: 500
gitlab-shell self-check failed
Try fixing it:
Make sure GitLab is running;
Check the gitlab-shell configuration file:
sudo -u git -H editor /home/git/gitlab-shell/config.yml
Please fix the error above and rerun the checks.
To explain my current setup:
#/home/git/gitlab-shell/config.yml
user: git
gitlab_url: https://[myfqdn]/
http_settings:
ca_file: "/etc/gitlab-ssl/git-mydomain-chain.pem"
ca_path: "/etc/gitlab-ssl"
self_signed_cert: false
repos_path: "/home/git/repositories/"
auth_file: "/home/git/.ssh/authorized_keys"
redis:
bin: "/usr/bin/redis-cli"
namespace: resque:gitlab
host: localhost
port: 6379
log_level: INFO
audit_usernames: false
In the /etc/gitlab-ssl directory are two files:
* my privatekey git-mydomain-key.pem
* the combinded public key and CA-key git-mydomain-chain.pem
In addition I added the ca-key to the ca-certificates (it's a cacert signed one).
Can anyone help me and tell me what went wrong?
This error has nothing to do with gitlab. This is pure YAML parser (Psych in your case) error.
Line 5 column 3 is:
ca_path:
⇑ HERE
That said you have a strange unterminated string right above:
⇓⇓⇓ WTF?!
ca_file: "/etc/gitlab-ssl/git-mydomain-chain.pem #This file contains my public key and the ca key
Remove everything after hash (inclusive) and close the string quotes.
Hope it helps.

grunt-rsync from Windows client fails

I want to use Grunt and rsync deploy some code from my computer (Windows) to a server (Linux).
My Gruntfile.js is
module.exports = function(grunt) {
grunt.initConfig({
rsync: {
options: {
args: ['--verbose', '--chmod=777'],
exclude: ['*.git', 'node_modules'],
recursive: true
},
production: {
options: {
src: './bitzl.com',
dest: '/home/marcus/bitzl.com',
host: 'marcus#bitzl.com',
syncDest: true
}
}
}
});
grunt.loadNpmTasks('grunt-rsync');
}
Please note that I use the homedirectory of marcus and chmod=777 just to simplify testing.
Running grunt rsync fails:
Running "rsync:production" (rsync) task
rsyncing ./example.com >>> /home/marcus/bitzl.com
Shell command was: rsync ./bitzl.com marcus#bitzl.com:/home/marcus/bitzl.com --rsh ssh --recursive --delete --delete-exc
luded --exclude=*.git --exclude=node_modules --verbose --chmod=777
ERROR
Error: rsync exited with code 12
Warning: Task "rsync:production" failed. Use --force to continue.
Error: Task "rsync:production" failed.
at Task.<anonymous> (D:\git\bitzl.com\node_modules\grunt\lib\util\task.js:200:15)
at null._onTimeout (D:\git\bitzl.com\node_modules\grunt\lib\util\task.js:236:33)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
Aborted due to warnings.
However, running the rsync command from above without Grunt works fine:
rsync ./bitzl.com marcus#bitzl.com:/home/marcus/bitzl.com --rsh ssh --recursive --delete --delete-excluded --exclude=*.git --exclude=node_modules --verbose --chmod=777
Rsync promts for the passphrase of my public key (via Grunt it doesn't) and syncs like a breeze.
Authentication on the server works via public key (with passphrase). Password authentication would be fine, too.
My guess is that somehow the password promt breaks and rsync fails with a protocol error (that's exit code 12).
What I am missing to get grunt-rsync working on Windows?
Update:
From a Linux VM (Ubuntu 12.04 via Virtualbox/Vagrant) it works like on would expect.
It turned out as a bug in grunt-rsync. A pull request I've filled in for rsyncwrapper has been accepted, and with the recent version of grunt-rsync everything works as expected.
If you still experience problems, make sure you have at least grunt-rsync version 0.6.0 installed.

Resources