Open CalaxDev opened 9 years ago
I get this error too after I hit Login with GitLab
and hitting Authorize
on the dialog on the gitlab page.
@Z3roCoder @Ablu Please refer to my comment https://github.com/sameersbn/docker-gitlab-ci/issues/28#issuecomment-102944598 for a possible fix.
None of any of those things helped.
Commands I am calling both docker-compose.yml's with:
docker-compose up
Gitlab docker-compose.yml:
gitlab:
image: sameersbn/gitlab:latest
links:
- redis:redisio
- postgresql:postgresql
external_links:
- maildev_maildev_1:maildev
ports:
- "10080:80"
- "10022:22"
expose:
- "10080"
environment:
- TZ=Asia/Kolkata
- SMTP_ENABLED=true
- SMTP_DOMAIN=maildev
- SMTP_HOST=maildev
- SMTP_PORT=25
# - SMTP_USER=null
# - SMTP_PASS=null
- SMTP_STARTTLS=false
- SMTP_AUTHENTICATION=login
- GITLAB_TIMEZONE=Kolkata
- GITLAB_HOST=my-domain.com
- GITLAB_PORT=80
- GITLAB_SSH_PORT=22
- GITLAB_EMAIL=my@email.com
- GITLAB_EMAIL_REPLY_TO=my@email.com
- GITLAB_BACKUPS=daily
- GITLAB_BACKUP_TIME=04:00
- GITLAB_RELATIVE_URL_ROOT=/gitlab
volumes:
- /srv/docker/gitlab/gitlab/data:/home/git/data
- /srv/docker/logs/gitlab:/var/log/gitlab
Gitlab-CI docker-compose.yml:
ci:
image: sameersbn/gitlab-ci:latest
links:
- redis:redisio
- postgresql:postgresql
external_links:
- maildev_maildev_1:maildev
- gitlab_gitlab_1
ports:
- "10081:80"
# net: "host"
environment:
- TZ=Asia/Kolkata
- GITLAB_URL=http://192.168.16.133:10080/gitlab
- GITLAB_APP_ID=fa0718e9ef9122245fe1c6c7e3a98d80d41fdf822f243743d179b18f2ceb1046
- GITLAB_APP_SECRET=8f137aa1a5febebd4fb7a9a00ce77a2b1debb286e3ac7dc7c8e3bd8adf6c6a70
- GITLAB_CI_HOST=localhost
- GITLAB_CI_RELATIVE_URL_ROOT=/gitlabci
- GITLAB_CI_PORT=10081
- GITLAB_CI_EMAIL=ci@example.com
- GITLAB_CI_SUPPORT=support@example.com
- GITLAB_CI_NOTIFY_ON_BROKEN_BUILDS=true
- GITLAB_CI_NOTIFY_PUSHER=false
- GITLAB_CI_BACKUPS=daily
- GITLAB_CI_BACKUP_TIME=01:00
- SMTP_ENABLED=true
- SMTP_DOMAIN=maildev
- SMTP_HOST=maildev
- SMTP_PORT=25
# - SMTP_USER=mailer@example.com
# - SMTP_PASS=password
- SMTP_STARTTLS=false
- SMTP_AUTHENTICATION=login
volumes:
- /srv/docker/gitlab-ci/gitlab-ci:/home/gitlab_ci/data
@sameersbn
@Z3roCoder check the production.log,
Execute bash in your ci
container (you can find the name with docker ps
)
docker exec -it gitlabci_ci_1 "/bin/bash"
Go to the location of the logs
cd /var/log/gitlab-ci/gitlab-ci/
And check the production.log
cat production.log
It always tells me "No route to host" - Did I set up something wrong in my files?
@outcoldman
@Z3roCoder possible, I have never tried to set GITLAB_RELATIVE_URL_ROOT
, maybe this can be an issue. Have you tried to curl
from gitlabci
server to the http://192.168.16.133:10080/gitlab
to see if it actually has access to it? Also what is your callback url in gitlab?
curl http://192.168.16.133:10080/gitlab results in
"curl: (7) Failed to connect to 192.168.16.133 port 10080: No route to host"
And where do I see what my Gitlab-Callback URL is? @outcoldman
Ooh now I see what you meant. As Application I have entered the callback URL's http://192.168.16.133:10081/gitlabci/user_sessions/callback http://my-domain.com/gitlabci/user_sessions/callback
(As it said "One URL per line" I thought you could enter multiple, as Gitlab and Gitlab-CI are supposed to work with ReverseProxies later) @outcoldman
@Z3roCoder you have the answer already - gitlab-ci does not have access to gitlab, when you tried to curl http://192.168.16.133:10080/gitlab
it shows you No route to host
. You need to fix that.
Hmh, but how shall I do that? I can not use net: "host" or similar, and linking containers does not work either as when I link containers, the gitlab-url gets mapped to the hosts file, but an internal on elike "172.xxx.xxx.xxx" which I can not access on another computer. So letting the env GITLAB_URL get set automatically is no option either
@Z3roCoder is http://192.168.16.133:10080/gitlab
a url which you user in browser?
Alright, I have now solved my problems. I have updated Docker as well as Docker-Compose to the newst Version and changed the following:
I fully switched to domain Names and created a single point of reference. Meaning that in both Gitlab and Gitlab-CI I have passed the option "extra_hosts" with a value like: "sub.my-domain.com: 192.168.16.133" and have told Gitlab and Gitlab-CI to use "sub.my-domain.com" wherever possible. The IP and domain-name are both from the reverse proxy (IIS) I have installed on my local PC, and now when I make a hosts-entry for 192.168.16.88 sub.my-domain.com I can access Gitlab and Gitlab-CI without any problems.
Proposed changes for Gitlab-CI:
Splitting up the ENV-Variable "GITLAB_URL" into "GITLAB_REF_URL" to be used everywhere inside the code, for OAuth and whatnot and "GITLAB_DISPLAY_URL" to be used everywhere a clickable link is displayed. Because currently you can not pass a link from "external_links: gitlab_gitlab_1:gitlab" into "GITLAB_URL" because it is on the User-Interface displayed as well. With my proposition you would use it like: "GITLAB_REF_URL: gitlab" "GITLAB_DISPLAY_URL: http://192.168.16.133/gitlab"
Why do I get this error? I have set everything up correctly according to https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/gitlab-ci/README.md yet I get this error. I have no idea what data to provide either so... Someone help please?