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

后端 未结 7 721
执笔经年
执笔经年 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 14:42

    We've encountered this issue when hosting our gitlab on a "compute engine" from google cloud. The reason for this behaviour was not having a "swap" configured in our machine. Gitlab wasn't able to allocate additional memory.

    We decided to scale up our memory instead of creating a swap partition but it's your choice... :)

    0 讨论(0)
  • 2021-01-01 14:44

    If using gitlab.com, the server is either being updated or having issues.

    You can check https://status.gitlab.com for updates from the GitLab team.

    There's also a Twitter account you can follow: https://twitter.com/gitlabstatus

    0 讨论(0)
  • 2021-01-01 14:48

    We've encountered this frequently of late. It's definitely GitLab running out of memory. We are not yet able to determine if GitLab is leaking memory or if our server instance is under-provisioned.

    0 讨论(0)
  • 2021-01-01 14:54

    Restart the gitlab service fix my problem.

    sudo gitlab-ctl restart
    
    sudo gitlab-ctl reconfigure
    
    0 讨论(0)
  • 2021-01-01 14:59

    I had this once in gitlab.com and it was not the reliability, just that I was trying to push with --force to the master branch, and it was protected (see "protected branches" in the settings of the repository).

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题