Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Gwzlchn opened this issue Aug 22, 2021 · 19 comments
Closed

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

Gwzlchn opened this issue Aug 22, 2021 · 19 comments
Assignees
Labels
component: dashboard git provider: gitlab meta: never-stale This issue can never become stale self-hosted team: webapp Issue belongs to the WebApp team type: feature request New feature or request type: improvement Improves an existing feature or existing code

Comments

@Gwzlchn
Copy link

Gwzlchn commented Aug 22, 2021

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

@stale
Copy link

stale bot commented Feb 17, 2022

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 stale bot added the meta: stale This issue/PR is stale and will be closed soon label Feb 17, 2022
@stale stale bot closed this as completed Mar 15, 2022
@stale stale bot moved this to Done in 🍎 WebApp Team Mar 15, 2022
@VouDoo
Copy link

VouDoo commented Jun 8, 2022

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!

@gtsiolis
Copy link
Contributor

gtsiolis commented Jun 8, 2022

Thanks for bringing this up, @VouDoo!

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

@gtsiolis gtsiolis reopened this Jun 8, 2022
Repository owner moved this from Done to In Progress in 🍎 WebApp Team Jun 8, 2022
@stale stale bot removed the meta: stale This issue/PR is stale and will be closed soon label Jun 8, 2022
@gtsiolis gtsiolis added meta: never-stale This issue can never become stale component: dashboard team: webapp Issue belongs to the WebApp team and removed self-hosted labels Jun 8, 2022
@jldec jldec removed the status in 🍎 WebApp Team Jun 22, 2022
@jldec
Copy link
Contributor

jldec commented Jun 22, 2022

Keep alive in WebApp project

@AlexTugarev
Copy link
Member

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.

@jmls
Copy link

jmls commented Jul 14, 2022

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

@geropl geropl moved this to Scheduled in 🍎 WebApp Team Jul 14, 2022
@lucasvaltl lucasvaltl changed the title Gitpod SaaS cannot integrate the Self-Hosted Gitlab with the port number Gitpod cannot integrate the Self-Hosted Gitlab with the port number Jul 14, 2022
@lucasvaltl
Copy link
Contributor

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

@AlexTugarev
Copy link
Member

@lucasvaltl, any chance you could help testing #11409 with a proper setup, i.e. with unusual port?

@lucasvaltl
Copy link
Contributor

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

@geropl geropl moved this from Scheduled to In Progress in 🍎 WebApp Team Jul 19, 2022
@AlexTugarev
Copy link
Member

Fixed in #11409

Repository owner moved this from In Progress to Done in 🍎 WebApp Team Jul 19, 2022
@micszc
Copy link

micszc commented Jul 19, 2022

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?

@mrsimonemms
Copy link
Contributor

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.

@micszc
Copy link

micszc commented Jul 19, 2022

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

@jmls
Copy link

jmls commented Jul 28, 2022

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

image

@lucasvaltl
Copy link
Contributor

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

@jmls
Copy link

jmls commented Jul 29, 2022

no, we're SaaS

@AlexTugarev
Copy link
Member

@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

@jmls
Copy link

jmls commented Aug 2, 2022

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)

@AlexTugarev
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: dashboard git provider: gitlab meta: never-stale This issue can never become stale self-hosted team: webapp Issue belongs to the WebApp team type: feature request New feature or request type: improvement Improves an existing feature or existing code
Projects
Archived in project
Development

No branches or pull requests

9 participants