Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Gitlab API访问连接超时_Ruby On Rails_Ruby_Git_Gitlab - Fatal编程技术网

Ruby on rails Gitlab API访问连接超时

Ruby on rails Gitlab API访问连接超时,ruby-on-rails,ruby,git,gitlab,Ruby On Rails,Ruby,Git,Gitlab,我刚刚安装了Gitlab,在Gitlab shell自检过程中出现了一个错误 该命令返回: root@git:/home/git/gitlab# sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production Checking Environment ... Git configured for git user? ... yes Checking Environment ... Finished Checking Git

我刚刚安装了Gitlab,在Gitlab shell自检过程中出现了一个错误

该命令返回:

root@git:/home/git/gitlab# sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
Checking Environment ...

Git configured for git user? ... yes

Checking Environment ... Finished

Checking GitLab Shell ...

GitLab Shell version >= 1.9.3 ? ... OK (1.9.3)
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
update hook up-to-date? ... yes
update hooks in repos are links: ... 
Thibaud / thibaud-dauce ... repository is empty
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: /usr/local/lib/ruby/2.0.0/net/http.rb:878:in `initialize': Connection timed out - connect(2) (Errno::ETIMEDOUT)
    from /usr/local/lib/ruby/2.0.0/net/http.rb:878:in `open'
    from /usr/local/lib/ruby/2.0.0/net/http.rb:878:in `block in connect'
    from /usr/local/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
    from /usr/local/lib/ruby/2.0.0/net/http.rb:877:in `connect'
    from /usr/local/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
    from /usr/local/lib/ruby/2.0.0/net/http.rb:851:in `start'
    from /home/git/gitlab-shell/lib/gitlab_net.rb:76:in `get'
    from /home/git/gitlab-shell/lib/gitlab_net.rb:43:in `check'
    from /home/git/gitlab-shell/bin/check:11:in `<main>'
gitlab-shell self-check failed
  Try fixing it:
  Make sure GitLab is running;
  Check the gitlab-shell configuration file:
  sudo -u git -H editor /home/git/gitlab-shell/config.yml
  Please fix the error above and rerun the checks.

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 UsersGroups? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
projects have namespace: ... 
Thibaud / thibaud-dauce ... yes
Projects have satellites? ... 
Thibaud / thibaud-dauce ... can't create, repository is empty
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.7.10)

Checking GitLab ... Finished
和我的配置文件:

root@git:/home/git/gitlab# sudo -u git -H cat /home/git/gitlab-shell/config.yml
 # GitLab user. git by default
user: git

 # Url to gitlab instance. Used for api calls. Should end with a slash.
gitlab_url: "http://git.thibaud-dauce.fr/"

http_settings:
 #  user: someone
 #  password: somepass
 #  ca_file: /etc/ssl/cert.pem
 #  ca_path: /etc/pki/tls/certs
  self_signed_cert: false

 #  Repositories path
 #  Give the canonicalized absolute pathname,
 #  REPOS_PATH MUST NOT CONTAIN ANY SYMLINK!!!
 #  Check twice that none of the components is a symlink, including "/home".
repos_path: "/home/git/repositories"

 #  File used as authorized_keys for gitlab user
auth_file: "/home/git/.ssh/authorized_keys"

 #  Redis settings used for pushing commit notices to gitlab
redis:
  bin: /usr/bin/redis-cli
  host: 89.234.146.59
  port: 6379
  # socket: /tmp/redis.socket # Only define this if you want to use sockets
  namespace: resque:gitlab

 #  Log file.
 #  Default is gitlab-shell.log in the root directory.
 #  log_file: "/home/git/gitlab-shell/gitlab-shell.log"

 # Log level. INFO by default
log_level: INFO

 #  Audit usernames.
 #  Set to true to see real usernames in the logs instead of key ids, which is easier to follow, but
 #  incurs an extra API call on every gitlab-shell command.
audit_usernames: false
我已经尝试在Redis conf中替换主机:127.0.0.1到主机:89.234.146.59 我还尝试在
/etc/hosts
中添加
89.234.146.59 git.thibaud dauce.fr

我有一台运行Debian7 32位的服务器,带有一个用于Gitlab的容器LXC,Ruby是2.0.0版。我在尝试推送回购协议时也出现了同样的错误(但我可以使用web应用程序在线创建一个)


你知道吗?我真的到处寻找,没有找到解决方案…

看起来好像超时了,你确定LXC容器可以很好地访问internet,并且代理配置正确吗?LXC容器可以通过端口80 443和22访问internet。我不确定API Gitlab需要什么端口。。。也许是Redis?6379端口?我也有类似的问题。我通过使用正确的名称修改/etc/hosts解决了这个问题
root@git:/home/git/gitlab# sudo -u git -H cat /home/git/gitlab-shell/config.yml
 # GitLab user. git by default
user: git

 # Url to gitlab instance. Used for api calls. Should end with a slash.
gitlab_url: "http://git.thibaud-dauce.fr/"

http_settings:
 #  user: someone
 #  password: somepass
 #  ca_file: /etc/ssl/cert.pem
 #  ca_path: /etc/pki/tls/certs
  self_signed_cert: false

 #  Repositories path
 #  Give the canonicalized absolute pathname,
 #  REPOS_PATH MUST NOT CONTAIN ANY SYMLINK!!!
 #  Check twice that none of the components is a symlink, including "/home".
repos_path: "/home/git/repositories"

 #  File used as authorized_keys for gitlab user
auth_file: "/home/git/.ssh/authorized_keys"

 #  Redis settings used for pushing commit notices to gitlab
redis:
  bin: /usr/bin/redis-cli
  host: 89.234.146.59
  port: 6379
  # socket: /tmp/redis.socket # Only define this if you want to use sockets
  namespace: resque:gitlab

 #  Log file.
 #  Default is gitlab-shell.log in the root directory.
 #  log_file: "/home/git/gitlab-shell/gitlab-shell.log"

 # Log level. INFO by default
log_level: INFO

 #  Audit usernames.
 #  Set to true to see real usernames in the logs instead of key ids, which is easier to follow, but
 #  incurs an extra API call on every gitlab-shell command.
audit_usernames: false