gitpod icon indicating copy to clipboard operation
gitpod copied to clipboard

Gitpod cannot integrate the Self-Hosted Gitlab with the port number

Open Gwzlchn opened this issue 5 years ago • 19 comments

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. image

  1. Open the page: https://gitpod.io/integrations
  2. Click "New Intergration"
  3. Input a GitLab url with the port number in "Provider Host Name" box
  4. 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

Gwzlchn avatar Aug 22 '21 08:08 Gwzlchn

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.

stale[bot] avatar Feb 17 '22 06:02 stale[bot]

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!

VouDoo avatar Jun 08 '22 11:06 VouDoo

Thanks for bringing this up, @VouDoo!

Let me reopen this and loop in a few folks from the corresponding team. Cc @geropl @jldec

gtsiolis avatar Jun 08 '22 11:06 gtsiolis

Keep alive in WebApp project

jldec avatar Jun 22 '22 11:06 jldec

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.

AlexTugarev avatar Jul 14 '22 07:07 AlexTugarev

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".

jmls avatar Jul 14 '22 12:07 jmls

Changed title as this likely impacts both the SaaS and Self-Hosted versions of Gitpod. Ideally a fix applies to both :)

lucasvaltl avatar Jul 14 '22 14:07 lucasvaltl

@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 avatar Jul 15 '22 10:07 AlexTugarev

@AlexTugarev - Let me ask the team on Slack - will cc you and then we can see what we can do :)

lucasvaltl avatar Jul 15 '22 11:07 lucasvaltl

Fixed in https://github.com/gitpod-io/gitpod/pull/11409

AlexTugarev avatar Jul 19 '22 06:07 AlexTugarev

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?

micszc avatar Jul 19 '22 08:07 micszc

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.

mrsimonemms avatar Jul 19 '22 08:07 mrsimonemms

Ok, thanks, sorry for being impatient :) I will wait for new release.

micszc avatar Jul 19 '22 08:07 micszc

was this tried end-to-end ? We are getting errors on the initial auth

image

jmls avatar Jul 28 '22 12:07 jmls

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 :)

lucasvaltl avatar Jul 29 '22 12:07 lucasvaltl

no, we're SaaS

jmls avatar Jul 29 '22 13:07 jmls

@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

AlexTugarev avatar Aug 02 '22 07:08 AlexTugarev

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 avatar Aug 02 '22 07:08 jmls

@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.

Screen Shot 2022-08-02 at 09 53 57

🤦🏻

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.

AlexTugarev avatar Aug 02 '22 07:08 AlexTugarev