2

When I tried to push something to my gitlab's geosurvey.git repo I get this error:

enter image description here

git@192.168.31.128:geosurvey.git: /usr/local/lib/ruby/1.9.1/net/http.rb:762!in `initialize': Connection refused(2) (Errno:ECONNREFUSED)
  from /usr/local/lib/ruby/1.9.1/net/http.rb:762:in `open'
  from /usr/local/lib/ruby/1.9.1/net/http.rb:762:in `block in connect'
  from /usr/local/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
  from /usr/local/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
  from /usr/local/lib/ruby/1.9.1/net/http.rb:762:in `connect'
  from /usr/local/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
  from /usr/local/lib/ruby/1.9.1/net/http.rb:744:in `start'
  from /home/git/gitlab-shell/lib/gitlab_net.rb:56:in `get'
  from /home/git/gitlab-shell/lib/gitlab_net.rb:17:in `allowed?'
  from /home/git/gitlab-shell/lib/gitlab_shell.rb:51:in `validate_access'
  from /home/git/gitlab-shell/lib/gitlab_shell.rb:21:in `exec'
  from /home/git/gitlab-shell/lib/gitlab_shell.rb:16:in `<main>'

The above error is for this code:

def connect
      D "opening connection to #{conn_address()}..."
      s = timeout(@open_timeout) { TCPSocket.open(conn_address(), conn_port()) }
      D "opened"
      if use_ssl?
        ssl_parameters = Hash.new
        iv_list = instance_variables
        SSL_ATTRIBUTES.each do |name|
          ivname = "@#{name}".intern
          if iv_list.include?(ivname) and
             value = instance_variable_get(ivname)
            ssl_parameters[name] = value
          end
        end
        @ssl_context = OpenSSL::SSL::SSLContext.new
        @ssl_context.set_params(ssl_parameters)
        s = OpenSSL::SSL::SSLSocket.new(s, @ssl_context)
        s.sync_close = true
end

Could be something wrong on my gitlab.yml or /etc/nginx/sites-available/gitlab?

Thanks,


The trouble is I can't get a ssh connection with my remote gitlab server. My ssh port is 22 (default) and my gitlab port is 3222.

VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755
Proverbio
  • 1,965
  • 2
  • 24
  • 35

2 Answers2

1

The installation guide of gitlab is missing how the listen port must be configured.

With this line, now, I can push and clone any repository.

listen *:80 default_server;         # e.g., listen 192.168.1.1:80;
VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755
Proverbio
  • 1,965
  • 2
  • 24
  • 35
  • Excellent. My answer was about ssh, but if the Apache server is incorrectly configured, I supposed that you would get the same error message indeed. +1 – VonC Mar 26 '13 at 16:39
  • Thanks for the help! The instalation guide of gitlab had a mistake. Gitlab uses nginx server to deploy the aplication. – Proverbio Mar 27 '13 at 12:43
  • Just realized I mentioned a +1 in my last comment... without actually upvoting your answer. So +1 now. – VonC Mar 27 '13 at 13:11
  • 1
    Can you tell us in witch file is this line ? – 0x1gene Jul 10 '13 at 13:33
0

The trouble is I can't get a ssh connection with my remote gitlab server. My ssh port is 22 (default) and my gitlab port is 3222.

Then you need to make sure to use the port 3222 when using an ssh Gitlab url.
You can specify a custom port number in a config file, as in this question, also illustrated in "Using a remote repository with non-standard port", scp-style.
Or you specify the port directly in your ssh url:

ssh://[user@]host.xz[:port]/path/to/repo.git/
Community
  • 1
  • 1
VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755