-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
private git submodule fails #644
Comments
+1 though I don`t have an idea how to solve it |
By looking at those line of code, it seems that the plugin is built before the app gets built (which starts in https://github.com/progrium/dokku/blob/master/dokku#L38), so what am I missing? |
Ok now I see the problem, but it's not related to those lines the OP was referencing (https://github.com/progrium/dokku/blob/4e9d797d452d9e8499eec67ffad3e4140fc22736/dokku#L32-L37), but instead due to the fact that the submodule cloning happens way before the build hook is even triggered (technically git_archive_all is triggered before the dokku receive command which triggers the build). Furthermore, it is not even related to any build logic nor any docker container, since all submodule cloning happens on the dokku host before it is sent to the buildpack. Thus, if you can successfully authenticate by ssh key to github using the
|
@michaelshobbs Mind making a documentation change for this? |
document deploying private git submodules. closes #644
I'm actually having the same difficulty, with a twist. I have a private repo referenced in the Here's the Gemfile (it's the same for both apps): gem 'repo', git: 'git@github.com:private/repo.git', ref: 'd1be9f7' The error I get is the following: $ g push dokku master
Counting objects: 21, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (20/20), done.
Writing objects: 100% (21/21), 2.24 KiB | 0 bytes/s, done.
Total 21 (delta 13), reused 0 (delta 0)
-----> Cleaning up...
-----> Building myapp from herokuish...
-----> Adding BUILD_ENV to build environment...
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using bundler 1.9.7
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Fetching gem metadata from https://rails-assets.org/..
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rails-assets.org/..
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rails-assets.org/..
Fetching dependency metadata from https://rubygems.org/..
Fetching git@github.com:private/repo.git
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Retrying git clone 'git@github.com:private/repo.git' "/tmp/build/vendor/bundle/ruby/2.0.0/cache/bundler/git/repo-1349f2a3af9920b5b235539271be4c0fbb2580a9" --bare --no-hardlinks --quiet due to error (2/3): Bundler::Source::Git::GitCommandError Git error: command `git clone 'git@github.com:private/repo.git' "/tmp/build/vendor/bundle/ruby/2.0.0/cache/bundler/git/repo-1349f2a3af9920b5b235539271be4c0fbb2580a9" --bare --no-hardlinks --quiet` in directory /tmp/build has failed.
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists. But the other app bundles just fine: $ g push production master
Counting objects: 5, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 618 bytes | 0 bytes/s, done.
Total 5 (delta 3), reused 0 (delta 0)
-----> Cleaning up...
-----> Building my_second_app from herokuish...
-----> Adding BUILD_ENV to build environment...
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using bundler 1.9.7
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Rubygems 2.0.14 is not threadsafe, so your gems must be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
Using rake 10.3.2
Using rails 4.0.5
. . .
Using repo 1.0.0 from git@github.com:private/repo.git (at d1be9f7)
. . . I've given SSH access to the dokku user, as described above. To confirm it was done correctly: su - dokku
ssh -T git@github.com
Hi davidlaprade! You've successfully authenticated, but GitHub does not provide shell access. Not only that, but I can also successfully clone the private repo that's causing the trouble: su - dokku
cd
git clone git@github.com:private/repo.git
Cloning into 'repo'...
remote: Counting objects: 284, done.
remote: Compressing objects: 100% (249/249), done.
remote: Total 284 (delta 31), reused 277 (delta 24), pack-reused 0
Receiving objects: 100% (284/284), 136.45 KiB | 0 bytes/s, done.
Resolving deltas: 100% (31/31), done.
Checking connectivity... done.
Any idea why one might be able to connect but not the other? |
FWIW, commenting on year old issues is not the best way to get heard. Fortunately, I was paying attention today. To your particular issue, I think you will want to use https://github.com/cedricziel/dokku-deployment-keys and/or https://github.com/cedricziel/dokku-hostkeys-plugin |
Fair enough, @michaelshobbs. Thanks for the help! I've been experimenting with those plugins and will open an issue there if I can't get my problem resolved. |
I'm trying to make this work with nodejs and private npm packages hosted on bitbucket.
Reports:
All repos mentioned there are exactly those which fail, when I do git push to dokku.
|
Your issue is different than the original reported here. Have a look at the dokku-deploykeys and dokku-hostkeys plugins. |
@michaelshobbs Ach just installed both, and my problem is resolved. Thanks and sorry to be off. |
No worries. Glad to help. |
So I have this same issue. hostkeys and deploykeys added As dokku, passwordless access to github:
I can even login and clone the repository I'm having an issue as a subcomponent. log:
simple login as dokku and cloning yields:
Am i missing something here? |
i notice that the hostkeys plugin mentions key generation being 2048b but github docs use 4096bit keys |
Cloning private repository was failing for me. I did following.
After doing the above steps, I was able to clone private repository. |
I'm trying to deploy a repo with a private submodule. It fails of course.
I've read #314. However, embedding the username and password in the repo is not an option.
I'm running both dokku-deployment-keys and dokku-hostkeys-plugin. So, at first glance, I figured we just needed to run these plugins before the app gets built. Unfortunately there is currently no way of doing this. See here.
So, one approach might be to break lines 33-35 into a new built-in plugin and subsequently move the aforementioned key plugins into a new phase that is called by the build-in.
Thoughts on this? Is this interesting to anyone else or am I off my rocker?
The text was updated successfully, but these errors were encountered: