Bitbucket import fails - private key does not get auto-configured / missing in documentation.
Created by: Blackskyliner
Summary: I just integrated Bitbucket via this guide: http://doc.gitlab.com/ce/integration/bitbucket.html
The problem I ran into was, that it's not mentioned to add bitbucket.org in the .ssh/config file and set the IdentFile to the bitbucket_rsa.
This leads to the problem that the gitlab-shell import fails because it will have no read-access to the Bitbucket repository, because of the missing publickey. Thus the project import fails.
Steps to reproduce: Integrate Bitbucket exactly as stated in the documentation and try to import anything.
Expected behavior: The Import should successfully run and import the project in the gitlab instance.
Observed behavior: The Import failed because of the missing reference to the private key.
Output of Checks:
$ bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
Checking Environment ...
Git configured for git user? ... yes
Checking Environment ... Finished
Checking GitLab Shell ...
GitLab Shell version >= 2.6.0 ? ... OK (2.6.0)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
Satellites access is drwxr-x---? ... yes
hooks directories in repos are links: ...
4/4 ... ok
2/5 ... ok
4/6 ... ok
5/13 ... ok
8/14 ... ok
9/15 ... repository is empty
9/16 ... repository is empty
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
/home/git/repositories/: OK
/home/git/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.8.19
Send ping to redis server: PONG
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... no
Try fixing it:
Install the init script
For more information see:
doc/install/installation.md in section "Install Init Script"
Please fix the error above and rerun the checks.
Init script up-to-date? ... can't check because of previous errors
projects have namespace: ...
4/4 ... yes
2/5 ... yes
4/6 ... yes
5/13 ... yes
8/14 ... yes
9/15 ... yes
9/16 ... yes
Projects have satellites? ...
4/4 ... yes
2/5 ... yes
4/6 ... yes
5/13 ... yes
8/14 ... yes
9/15 ... can't create, repository is empty
9/16 ... can't create, repository is empty
Redis version >= 2.0.0? ... yes
Ruby version >= 2.0.0 ? ... yes (2.1.5)
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.8.3)
Active users: 6
Checking GitLab ... Finished
$ bundle exec rake gitlab:env:info RAILS_ENV=production
System information
System:
Current User: git
Using RVM: yes
RVM Version: 1.26.10
Ruby Version: 2.1.5p273
Gem Version: 2.4.6
Bundler Version:1.9.1
Rake Version: 10.4.2
Sidekiq Version:3.3.0
GitLab information
Version: 7.9.1
Revision: 6f6c5f1
Directory: /home/git/gitlab
DB Adapter: mysql2
Using LDAP: no
Using Omniauth: yes
Omniauth Providers: bitbucket
GitLab Shell
Version: 2.6.0
Repositories: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/bin/git
Possible fixes: Update the documentation and add the missing part to create/update the .ssh/config and add:
Host bitbucket.org
IdentityFile ~/.ssh/bitbucket_rsa
User git