How to resolve “GitLab: API is not accessible” when pushing to a new repository?

后端 未结 7 759
执笔经年
执笔经年 2021-01-01 14:29

we have a locally-hosted Enterprise Edition of GitLab at my place of employment (currently at v7.12.00-ee ceb5083). I can create a repository through the GUI without issue.

7条回答
  •  情歌与酒
    2021-01-01 15:02

    You have to set the correct URL for the GitLab API in GitLab's configuration files.

    As we can see in your gitlab-shell.log your API address is currently set to http://127.0.0.1:8080/. If you change the default URL where GitLab is running or if you changed its default port, you have to change it.

    This parameter is configurable in /etc/gitlab/gitlab.rb :

    ## GitLab URL
    ##! URL on which GitLab will be reachable.
    ##! For more details on configuring external_url see:
    ##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
    external_url 'http://127.0.0.1:3000'
    [...]
    

    This is the default value (as port 3000 is the default value in GitLab omnibus for unicorn). After you updated it you'll have to run a sudo gitlab-ctl reconfigure to apply this parameter.

    It will override the file opt/gitlab/embedded/service/gitlab-shell/config.yml as mentioned in it's header comments.

提交回复
热议问题