{"id":1365,"date":"2023-03-19T10:23:18","date_gmt":"2023-03-19T02:23:18","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1365"},"modified":"2023-04-28T21:17:48","modified_gmt":"2023-04-28T13:17:48","slug":"gitlab-source-code-installation-error-failed-to-connect-to-gitaly","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/19\/gitlab-source-code-installation-error-failed-to-connect-to-gitaly\/","title":{"rendered":"Gitlab\u6e90\u7801\u5b89\u88c5\u62a5\u9519 Failed to connect to Gitaly&#8230;"},"content":{"rendered":"<pre><code class=\"language-shell\"># sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production\nFailed to connect to Gitaly...<\/code><\/pre>\n<p>\u53c2\u8003\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/gitlab.com\/gitlab-org\/gitlab-ce\/issues\/47483\">https:\/\/gitlab.com\/gitlab-org\/gitlab-ce\/issues\/47483<\/a><\/p>\n<p><!-- more --><\/p>\n<pre><code class=\"language-shell\"># sudo -u git -H vim lib\/tasks\/gitlab\/setup.rake\n# sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production<\/code><\/pre>\n<p>\u6ce8\u91ca\u7b2c4\u884c\uff1acheck_gitaly_connection \u540e\u91cd\u65b0\u5b89\u88c5<\/p>\n<pre><code class=\"language-ruby\">namespace :gitlab do\n  desc &quot;GitLab | Setup production application&quot;\n  task setup: :gitlab_environment do\n    # check_gitaly_connection\n    setup_db\n  end\n\n  def check_gitaly_connection\n    Gitlab.config.repositories.storages.each do |name, _details|\n      Gitlab::GitalyClient::ServerService.new(name).info\n    end\n  rescue GRPC::Unavailable =&gt; ex\n    puts &quot;Failed to connect to Gitaly...&quot;.color(:red)\n    puts &quot;Error: #{ex}&quot;\n    exit 1\n  end\n\n  def setup_db\n    warn_user_is_not_gitlab\n\n    unless ENV[&#039;force&#039;] == &#039;yes&#039;\n      puts &quot;This will create the necessary database tables and seed the database.&quot;\n      puts &quot;You will lose any previous data stored in the database.&quot;\n      ask_to_continue\n      puts &quot;&quot;\n    end\n\n    Rake::Task[&quot;db:reset&quot;].invoke\n    Rake::Task[&quot;add_limits_mysql&quot;].invoke\n    Rake::Task[&quot;setup_postgresql&quot;].invoke\n    Rake::Task[&quot;db:seed_fu&quot;].invoke\n  rescue Gitlab::TaskAbortedByUserError\n    puts &quot;Quitting...&quot;.color(:red)\n    exit 1\n  end\nend<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p># sudo -u git -H bundle exec rake gitlab:setup RAILS_EN [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[230],"tags":[],"class_list":["post-1365","post","type-post","status-publish","format-standard","hentry","category-gitlab"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1365","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1365"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1365\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}