FAILED: Failed to connect to internal API

Hy, I have installed Gitlab. Everything it seems to be working, but I have a problem and I not found a solution.
I have a same problem, if I reinstall the OS and Gitlab furthermore if I install an oldest Gitlab version.
Here is the error:
gitlab-rake gitlab:check

Check GitLab API access: FAILED: Failed to connect to internal API
gitlab-shell self-check failed
Try fixing it:
Make sure GitLab is running;
Check the gitlab-shell configuration file:
sudo -u git -H editor /opt/gitlab/embedded/service/gitlab-shell/config.yml
Please fix the error above and rerun the checks.

System information:
gitlab-rake gitlab:env:info

System: Debian 8.7
Current User: git
Using RVM: no
Ruby Version: 2.3.3p222
Gem Version: 2.6.6
Bundler Version:1.13.7
Rake Version: 10.5.0
Sidekiq Version:4.2.7

GitLab information
Version: 8.16.4
Revision: f32ee82
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
SSH Clone URL:
Using LDAP: yes
Using Omniauth: no

GitLab Shell
Version: 4.1.1
Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories
    Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
    Git: /opt/gitlab/embedded/bin/git

And the log file: /var/log/gitlab/gitlab-shell/gitlab-shell.log
W, [2017-02-09T15:10:34.751945 #43612] WARN – : Failed to connect to internal API <GET>: #<Net::ReadTimeout: Net::ReadTimeout>
I, [2017-02-09T15:10:34.782563 #43612] INFO – : GET 10.08692

Any ideas what could be problem?

Can you show us your configuration file(s)?

Of course. I change only these things in /etc/gitlab.rb file.:

external_url ‘

LDAP Settings
gitlab_rails[‘ldap_enabled’] = true
! remember to close this block with ‘EOS’ below
gitlab_rails[‘ldap_servers’] = YAML.load <<-‘EOS’
main: # ‘main’ is the GitLab ‘provider ID’ of this LDAP server
label: ‘LDAP’
host: ‘’
port: 389
uid: ‘uid’
method: ‘plain’ # “tls” or “ssl” or “plain”
bind_dn: ‘cn=admin,dc=tlp,dc=hu’
password: ‘password’
active_directory: false
allow_username_or_email_login: false
block_auto_created_users: false
base: ‘o=TLP,dc=tlp,dc=hu’

GitLab database settings
gitlab_rails[‘db_adapter’] = ‘postgresql’
gitlab_rails[‘db_encoding’] = ‘utf8’

gitlab_rails[‘db_username’] = ‘git’
gitlab_rails[‘db_password’] = ‘password’
gitlab_rails[‘db_host’] = ‘’
gitlab_rails[‘db_port’] = ‘5432’

GitLab Workhorse
gitlab_workhorse[‘listen_network’] = “tcp”
gitlab_workhorse[‘listen_addr’] = “”

GitLab PostgreSQL
postgresql[‘enable’] = false

GitLab Nginx
nginx[‘enable’] = false

I use an external postgresql and Apache2 web server. Everything working fine, but I still see the error.

gitlab-ctl status
run: gitlab-workhorse: (pid 60463) 31743s; run: log: (pid 635) 111772s
run: logrotate: (pid 30063) 2935s; run: log: (pid 646) 111772s
run: redis: (pid 60481) 31738s; run: log: (pid 631) 111772s
run: sidekiq: (pid 60491) 31732s; run: log: (pid 634) 111772s
run: unicorn: (pid 60539) 31715s; run: log: (pid 630) 111772s

You changed the port that GitLab Workhorse is using, but your GitLab Shell is still pointing to the default port number.

You need to set the internal_api_url setting in your config file.

Thank you for your reply!
I don’t found that option in the gitlab.rb config file. Where is that setting?