Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

External URL must include a FQDN

Tags:

gitlab

I set up a fresh CentOS 6.6 install and used the Omniubus installer for the CE of Gitlab.

When running gitlab-ctl reconfigure I get the following errors:

================================================================================
Recipe Compile Error in /opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb
================================================================================


RuntimeError
------------
External URL must include a FQDN


Cookbook Trace:
---------------
  /opt/gitlab/embedded/cookbooks/gitlab/libraries/gitlab.rb:95:in `parse_external_url'
  /opt/gitlab/embedded/cookbooks/gitlab/libraries/gitlab.rb:191:in `generate_config'
  /opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb:34:in `from_file'


Relevant File Content:
----------------------
/opt/gitlab/embedded/cookbooks/gitlab/libraries/gitlab.rb:

 88:  
 89:      def parse_external_url
 90:        return unless external_url
 91:  
 92:        uri = URI(external_url.to_s)
 93:  
 94:        unless uri.host
 95>>         raise "External URL must include a FQDN"
 96:        end
 97:        Gitlab['user']['git_user_email'] ||= "gitlab@#{uri.host}"
 98:        Gitlab['gitlab_rails']['gitlab_host'] = uri.host
 99:        Gitlab['gitlab_rails']['gitlab_email_from'] ||= "gitlab@#{uri.host}"
100:  
101:        case uri.scheme
102:        when "http"
103:          Gitlab['gitlab_rails']['gitlab_https'] = false
104:        when "https"

The FQDN of the server is correctly set, I have an external IP. DNS is configured for the FQDN to point at my external IP.

Here's the contents of my /etc/gitlab/gitlab.rb in case that is useful:

# Check and change the external_url to the address your users will type in their browser
external_url 'gitlab.thefallenphoenix.net'
gitlab_rails['gitlab_email_from'] = '[email protected]'
like image 337
kemra102 Avatar asked Oct 30 '14 17:10

kemra102


3 Answers

EDIT: This is now fixed with adding http:// or https:// to the domain in the .rb file. Tested on Debian 9 with Gitlab EE.


Add a = sign to the gitlab.rb.

It should be:

external_url = 'gitlab.thefallenphoenix.net'
gitlab_rails['gitlab_email_from'] = '[email protected]'

After that it should install fine. At least it worked for me on CentOS 6.6.

like image 178
thebonzitree Avatar answered Oct 21 '22 05:10

thebonzitree


Adding the equal (=) sign to the gitlab.rb only solves your problem temporarily! It is not a bug. Using "http://example.com" instead of "example.com" actually solved the problem. *If gitlab installs fine but not accessible via browser, add a port to the url like "http://example.com:10080" and you should be seeing the website http://example.com:10080 in your browser

like image 33
Justice O. Avatar answered Oct 21 '22 04:10

Justice O.


I upgrade from 6.6.9 to latest gitlab_7.4.3-omnibus.5.1.0.ci-1_amd64.deb

just follow the upgrade instruction before the

gitlab-ctl reconfigure 

vim /opt/gitlab/embedded/cookbooks/gitlab/libraries/gitlab.rb

 99     def parse_external_url
100       return unless external_url
101
102       uri = URI("http://whatever.example.com")
          //just change external_url line here 
103
104       unless uri.host
105         raise "External URL must include a FQDN"
106       end
107       Gitlab['user']['git_user_email'] ||= "gitlab@#{uri.host}"
108       Gitlab['gitlab_rails']['gitlab_host'] = uri.host
109       Gitlab['gitlab_rails']['gitlab_email_from'] ||= "gitlab@#{uri.host}"
110
111       case uri.scheme
112       when "http"
113         Gitlab['gitlab_rails']['gitlab_https'] = false
114       when "https"
115         Gitlab['gitlab_rails']['gitlab_https'] = true
116         Gitlab['nginx']['ssl_certificate'] ||= "/etc/gitlab/ssl/#{uri.host}.crt"
117         Gitlab['nginx']['ssl_certificate_key'] ||= "/etc/gitlab/ssl/#{uri.host}.key"
118       else
119         raise "Unsupported external URL scheme: #{uri.scheme}"
120       end
121
122       unless ["", "/"].include?(uri.path)
123         raise "Unsupported external URL path: #{uri.path}"
124       end
125
126       Gitlab['gitlab_rails']['gitlab_port'] = uri.port
127     end

and then do

gitlab-ctr reconfigure

everything is ok!

like image 1
linarnan Avatar answered Oct 21 '22 04:10

linarnan