Skip to content
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

Access denied, Timeout and config file problems #96

Closed
Alas89 opened this issue Jul 8, 2014 · 13 comments
Closed

Access denied, Timeout and config file problems #96

Alas89 opened this issue Jul 8, 2014 · 13 comments

Comments

@Alas89
Copy link

Alas89 commented Jul 8, 2014

Hello Guys,

I`m relatively new in the howl docker world. So I run into some problems with your gitlab docker container.

The first one is: I pulled and run the container. The webfrontend is running fine. I added useres, created a group and project and uploaded my rsa key. But now when I want to pull the project I recive a access denied message.

Second: To fix this I changed the config files from default to:
gitlab-shell/config.yml
# Url to gitlab instance. Used for api calls. Should end with a slash.
gitlab_url: "http://mydomain:80/"

          gitlab/config/gitlab.yml
                       ## Web server settings
                       host: mydomain
                       port: 80

                       # If you use non-standard ssh port you need to specify it
                       ssh_port: 2222

                       test:
                              <<: *base
                           gravatar:
                                 enabled: true
                            gitlab:
                            host: mydomain
                            port: 80

After this I run into a timeout

The third and last problem is when I restart the docker container with docker restart all the changes are restored to the default vallue.

The containers port forwarding is 2222:22 and 80:80.

I used three different RSA-keys all get the access denied.

Thanks ahead for your response. I hope you can help me . I am pretty frustrated now :(

@sameersbn
Copy link
Owner

@Alas89 First of, please paste your docker run command.

Hello Guys,

I`m relatively new in the howl docker world. So I run into some problems with your gitlab docker container.

The first one is: I pulled and run the container. The webfrontend is running fine. I added useres, created a group and project and uploaded my rsa key. But now when I want to pull the project I recive a access denied message.

I think you are connecting to the host and not the container. Check if you are able to clone/push/pull the repository using the container ip.

Second: To fix this I changed the config files from default to:
gitlab-shell/config.yml

Url to gitlab instance. Used for api calls. Should end with a slash.

gitlab_url: "http://mydomain:80/"

      gitlab/config/gitlab.yml
                   ## Web server settings
                   host: mydomain
                   port: 80

                   # If you use non-standard ssh port you need to specify it
                   ssh_port: 2222

                   test:
                          <<: *base
                       gravatar:
                             enabled: true
                        gitlab:
                        host: mydomain
                        port: 80

After this I run into a timeout

Do do not need to edit these files (unless you know what you are going). Try running the image with the -h mydomain flag.

The third and last problem is when I restart the docker container with docker restart all the changes are restored to the default vallue.

The containers port forwarding is 2222:22 and 80:80.

I used three different RSA-keys all get the access denied.

Thanks ahead for your response. I hope you can help me . I am pretty frustrated now :(

You need to read the README past the Quick Start instructions.

@sameersbn
Copy link
Owner

@Alas89 also paste the git clone command you are using

@Alas89
Copy link
Author

Alas89 commented Jul 9, 2014

@sameersbn At first I want to thank you for your quick response.

I`ve tried the things you recommented with a new docker instance by running

docker run --name='gitlab2000' -i -t --rm \
-p 2222:22 -p 80:80 \
-e "GITLAB_PORT=80" -e "GITLAB_SSH_PORT=2222" \
-h mydomain sameersbn/gitlab:6.8.0

gitlab container ip: 172.17.0.2

~/gittest/nxt$ git init
~/gittest/nxt$ touch README
~/gittest/nxt$ git add README 
~/gittest/nxt$ git commit -m 'first commit'
~/gittest/nxt$ git remote add origin ssh://git@172.17.0.2:2222:prom/nxt.git

from host to docker container

~/gittest/nxt$ git push -u origin master
The authenticity of host '172.17.0.2 (172.17.0.2)' can't be established.
ECDSA key fingerprint is 6b:61:03:38:b9:f8:7b:7b:f1:ee:e7:88:63:02:93:e3.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.17.0.2' (ECDSA) to the list of known hosts.
Enter passphrase for key '/home/user/.ssh/id_rsa': 
Access denied.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

After the push didn`t work I tried to clone the repo and then I got this message:

~/gittest/nxt2$ git clone ssh://git@172.17.0.2:2222:prom/nxt.git
Cloning into 'nxt'...
Enter passphrase for key '/home/user/.ssh/id_rsa': 
Access denied.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

To clone (or work with git) I use EGit (Eclipse plugin) on my laptop. It worked fine for a older gitlab VM but now we changed our server infrastructure to docker and I can`t make it work.

I can connect via ssh to the container from my laptop by using ssh root@mydomain -p 2222 so I think the portforwarding is working fine.

I read both README files but didn`t fine something helpfull.

If I should not edit the config fiels how should I change the git urls in the webfrontend?
from
git@localhost:prom/nxt.git
to what I think should be
ssh://git@mydomain:2222:prom/nxt.git

I cant see that through right now, cause the -h mydomain flag seems to havent changed any thing.

@sameersbn
Copy link
Owner

@Alas89 first i recommend that you use the latest image docker pull sameersbn/gitlab:latest.

docker run --name='gitlab2000' -h mydomain -it --rm -p 2222:22 -p 80:80 \
-e "GITLAB_PORT=80" -e "GITLAB_SSH_PORT=2222" \
sameersbn/gitlab:latest

Typically I would ask you to use the 7.0.0 version, but since there are couple of improvements and also a fix for git over ssh I suggest that you use the latest version. However, you can continue using 6.8.2 if you have to since the sshd issue is not present in that version.

Regarding the Access denied message, have you added your ssh key to your gitlab profile?

The configuration parameters are specified using environment variables. For example, if you want to set the gitlab hostname to mydomain you have to add -e GITLAB_HOST=mydomain to the docker run command

docker run --name='gitlab2000' -h mydomain  -it --rm -p 2222:22 -p 80:80 \
-e "GITLAB_HOST=mydomain" -e "GITLAB_PORT=80" -e "GITLAB_SSH_PORT=2222" \
sameersbn/gitlab:latest

All available configuration options are listed in the Available Configuration Parameters section of the README

I hope this helps.

@Alas89
Copy link
Author

Alas89 commented Jul 10, 2014

@sameersbn I tried the latest version but run in anothor error:

~$ docker run --name='gitlab3000' -h mydomain  -it --rm -p 2222:22 -p 80:80 \
> -e "GITLAB_HOST=mydomain" -e "GITLAB_PORT=80" -e "GITLAB_SSH_PORT=2222" \
> sameersbn/gitlab:latest
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Creating SSH2 ECDSA key; this may take some time ...
Creating SSH2 ED25519 key; this may take some time ...
invoke-rc.d: policy-rc.d denied execution of restart.
Starting openssh server...
sudo: unable to execute /bin/cp: Permission denied

With sudo:

~$ sudo docker run --name='gitlab3000' -h mydomain  -it --rm -p 2222:22 -p 80:80 -e "GITLAB_HOST=mydomain" -e "GITLAB_PORT=80" -e "GITLAB_SSH_PORT=2222" sameersbn/gitlab:latest 
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Creating SSH2 ECDSA key; this may take some time ...
Creating SSH2 ED25519 key; this may take some time ...
invoke-rc.d: policy-rc.d denied execution of restart.
Starting openssh server...
sudo: unable to execute /bin/cp: Permission denied

I`ll try 6.8.0. with the "new" run command an let you know the results.

@Alas89
Copy link
Author

Alas89 commented Jul 10, 2014

@sameersbn So I tried the 6.8.0 the webfronten looks better it shows mydomain but not the differnt ssh port 2222. But still the same acces dined message. I generated the RSA-key an uplodet it, like described in the webfrontend. My commands and the message below.

clone

~$ git clone ssh://git@172.17.0.2:2222:prom/nxt.git
Cloning into 'nxt'...
Enter passphrase for key '/home/user/.ssh/id_rsa': 
Access denied.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

push

~/gittest/nxt$ git push -u origin master
Enter passphrase for key '/home/user/.ssh/id_rsa': 
Access denied.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

@sameersbn
Copy link
Owner

@Alas89 There could be a couple of reasons this issue could occur.

  1. If your host distribution is redhat (or its derivatives), then this could be related to selinux. Try disabling selinux to see if this issue goes away.
  2. If your host distribution is ubuntu, the install the latest version of docker from docker.io
apt-get purge docker.io
curl -s https://get.docker.io/ubuntu/ | sudo sh
  1. If neither of the above helps then take a look at Cannot start container #91

@sameersbn
Copy link
Owner

@Alas89 P.S. in 6.8.0 the GITLAB_SSH_PORT parameter was named GITLAB_SHELL_SSH_PORT. So you would need to update your command line to reflect this. Once you do this, you should see the updated ssh port in the clone urls.

@sameersbn
Copy link
Owner

@Alas89 any progress??

@Alas89
Copy link
Author

Alas89 commented Jul 18, 2014

Hey after trying a lot of things and none of them worked. I made it.
I ran :

docker run --name='gitlab' -i -t --rm \
-p 2222:22 -p 80:80 -e "GITLAB_HOST=mydomain" \
-e "GITLAB_PORT=80" -e "GITLAB_SHELL_SSH_PORT=2222" \
-h mydomain sameersbn/gitlab:6.8.0

And I can pull and push as its supposed to be. But still I cant make the 7.0 version run with the error mentioned aboth. Thanks alot for your help. Ill work with the 6.8 version and try to update when I find the time for it.

@Alas89 Alas89 closed this as completed Jul 18, 2014
@sameersbn
Copy link
Owner

@Alas89 can you provide me the following information?

  • host linux distribution with the release version.
  • docker infomation, i.e. output of docker version && docker info

I will try to replicate your environment and look for the issue source and hopefully fix it. Thanks

@Alas89
Copy link
Author

Alas89 commented Jul 21, 2014

@sameersbn it would be great if you could especially the problem with the 7.0 version or if someone else got the same problem as I.

So here are the information you asked for:

  • We run on our server ubuntu 14.04 64 bit.

  • docker version Client version: 0.9.1 ( I think I`ll update it as soon as possible cause docker recomments ist ;))

  • docker info :

    Containers: 51
    Images: 402
    Storage Driver: aufs
    Root Dir: /var/lib/docker/aufs
    Dirs: 504
    Execution Driver: native-0.1
    Kernel Version: 3.13.0-24-generic
    WARNING: No swap limit support

I hope this will help and again thanks a lot.

@sameersbn
Copy link
Owner

@Alas89 My installation is identical to yours except for the docker version. You should probably update your docker version. Latest release of docker is 1.1.1. The 1.x.x series is considered to be stable.

It is also possible that an intermediate file system layer might have gotten corrupt. Since there is no way to figure this out if this has been the case, we can remove all gitlab and its dependent image and pull the image from the index again. Some users have faced such issues in the past and were able to resolve it by deleting existing images and pulling the image from the docker again.

docker rmi sameersbn/gitlab:6.8.1
docker rmi sameersbn/gitlab:6.8.2
docker rmi sameersbn/gitlab:6.9.0
docker rmi sameersbn/gitlab:6.9.1
docker rmi sameersbn/gitlab:6.9.2
docker rmi sameersbn/gitlab:7.0.0
docker rmi sameersbn/gitlab:7.1.0
docker rmi sameersbn/gitlab:latest
docker rmi sameersbn/ubuntu:14.04.20140508
docker rmi sameersbn/ubuntu:14.04.20140628
docker pull sameersbn/gitlab:7.0.1
``
The above will remove any gitlab images greater than version `6.8.0` and the last line will pull the most recent image. 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants