Gitpod cannot integrate the Self-Hosted Gitlab with the port number
Bug description
The url of our self-hosted GitLab instance has a port number, which is not the usual 80/443, so when I integrate our GitLab into the GitPod SaaS platform, it prompts that the host name is invalid.
I found out the following regex will filters out urls with port numbers components/server/src/workspace/gitpod-server-impl.ts#L1783
Steps to reproduce
The figure below shows the situation.

- Open the page: https://gitpod.io/integrations
- Click "New Intergration"
- Input a GitLab url with the port number in "Provider Host Name" box
- Prompts "Invalid host name."
Expected behavior
Gitpod SaaS should support the Self-Hosted Gitlab with the port number
Example repository
No response
Anything else?
No response
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hello @gtsiolis 👋
I am facing the same issue and I wonder if this is going to be fixed anytime soon.
Like @Gwzlchn, I would like to set up the GitLab integration with a self-hosted GitLab server running on a custom port (e.g. gitlab.foo.com:8443)
Thank you!
Thanks for bringing this up, @VouDoo!
Let me reopen this and loop in a few folks from the corresponding team. Cc @geropl @jldec
Keep alive in WebApp project
I propose a more comprehensive solution to this by replacing the regex to validate the URI by actually ping the host (including path) of the gitlab installation. This way we can test connectivity between server and gitlab and report any issues, which from time to time is a big pita to debug remotely.
yeah we just hit this during a call with a prospective customer (embarrassing!) - although we were using bitbucket.
We really need this fix! Please do not mark as "stale".
Changed title as this likely impacts both the SaaS and Self-Hosted versions of Gitpod. Ideally a fix applies to both :)
@lucasvaltl, any chance you could help testing https://github.com/gitpod-io/gitpod/pull/11409 with a proper setup, i.e. with unusual port?
@AlexTugarev - Let me ask the team on Slack - will cc you and then we can see what we can do :)
Fixed in https://github.com/gitpod-io/gitpod/pull/11409
HI, I'm still getting this error. I have updated gitpod to newest version -> 2022.6.1 and still there's error about Invalid host name. What should I do to go further?
Hi @micszc, this hasn't yet been released to the Self-Hosted version yet. It'll go out with the 2022.7.0 release, which is scheduled for around the 28th July.
Ok, thanks, sorry for being impatient :) I will wait for new release.
was this tried end-to-end ? We are getting errors on the initial auth

Hey @jmls are you using the SaaS or Self-Hosted version of Gitpod? If it is the latter, Gitpod Self-Hosted version 2022.07, which includes this fix, was only released to those on the community license today :)
no, we're SaaS
@jmls! Thanks for reporting. Yes, that was tested, but there might be gaps.
One question, because the error rendered is on GitLab, did you reuse the OAuth application on that instance, or did you create a new one? Please verify that redirect URI of the OAuth application also includes the port number, where the colon sign is replaced by an underscore, e.g. gitlab.mydomain.com_8433
we got the error in bitbucket - this happens on a new oauth application, and yes we did include the _port in the redirect uri (we copied it from the gitpod UI)
@jmls, I think I got it now! The Git Integration modal doesn't escape the :, thus you probably just copy and pasted the URI, which makes perfectly sense.
🤦🏻
The colon in the URI to be copy-pasted into your OAuth setting on GitLab/GHE/BBS should not contain the colon (:) it should be an underscore (_).
I'll create a PR to fix the UI, but you can work around this, by fixing the URI in you OAuth application.