Skip to content

Adding Gitlab self-managed host to codepipline URL can't begin with "https://gitlab.com", e.g. "https://gitlab.compare.com"

0

I tried setting up a new Code Pipeline with gitlab as the source. However when I enter in our URL for gitlab "https://gitlab.ourdomain.com" I get the error:

"The endpoint isn't valid. An endpoint for cloud-based provider types cannot be used for hosts, . . ."

Which has me thinking that perhaps there is a bug that these URLs cannot contain "gitlab". If I use the IP (https://x.y.z.z/), it works and allows me to add the host. However, when I go back after adding the host and set it up with a PAT it fails with "An unspecified error occurred."

Any hints to get around this?

Update: further testing has shown any domain starting with "https://gitlab.com" fails, but our domain just happens to start with that... not our domain, but if you try anything that begins with that it will fail, such as "https://gitlab.compare.com".

Example of failure with fictitious domain

Using our real domain

When I attempt to add a PAT after using https://<IP Address>

asked 2 years ago912 views

2 Answers
1

Hello.

I tried setting up a host name that included "gitlab" in my AWS account, and was able to successfully create a connection.
a

By the way, it is possible to create a ".com" domain, so you may want to try reloading the page or clearing the cache.
a

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

  • Indeed if I use "https://gitlab.test.com/" it works immediately with seemingly no heavy checks, however even on a fresh browser (incognito) it will not accept my actual domain name.

    Ah, yes, I understand now. It just happens our domain name starts with "com", so the first 18 characters are: "https://gitlab.com"

    However, we also have an additional 12 characters.

    For example, try "https://gitlab.compare.com" that fails just like ours and confirms my hunch that there is a bad regex check here, blocking valid domains.

  • In that case, I think this is an issue on the AWS side, so you will need to contact AWS Support. Paid support is required for technical inquiries, so if you can afford the cost, I recommend signing up for AWS support. I think the only temporary workaround is to change the domain used by GitLab to another domain. The documentation below states that a CNAME record can be used, so I thought I could just create a CNAME record for CodePipeline and use the original domain for general use. https://docs.gitlab.com/omnibus/settings/dns.html

-1

The issue you're experiencing is not due to a bug related to URLs containing "gitlab". The error message you received suggests that the system is mistakenly interpreting your self-managed GitLab instance as a cloud-based provider.

For self-managed GitLab instances, AWS CodePipeline requires you to set up a host connection first before creating a pipeline. This process involves two main steps:

  1. Create a host resource for your GitLab self-managed server.
  2. Create a connection using this host resource.

When creating the host, you should be able to use your GitLab URL (https://gitlab.ourdomain.com) without issues. If you're still encountering problems, try the following:

  1. Ensure you're selecting "GitLab self-managed" as the provider type when creating the host, not the cloud-based GitLab option.
  2. Double-check that you have the necessary permissions in both AWS and your GitLab instance.
  3. Verify that your GitLab server is accessible from AWS (especially if it's within a VPC).

Regarding the "An unspecified error occurred" message when setting up the Personal Access Token (PAT), this could be due to various reasons:

  1. The PAT might not have the required permissions (it should have the "api" scope).
  2. There might be network connectivity issues between AWS and your GitLab server.
  3. The GitLab server's SSL certificate might not be trusted by AWS.

To troubleshoot:

  1. Create a new PAT with the correct permissions and try again.
  2. Check your network settings and ensure AWS can reach your GitLab server.
  3. If using a self-signed SSL certificate, you may need to add it to AWS Certificate Manager.

If problems persist, you may need to contact AWS support for further assistance, as they can provide more specific troubleshooting based on your account and configuration.
Sources
Connections for GitLab self-managed - AWS CodePipeline
Create a connection to GitLab self-managed - Developer Tools console
CodePipeline supports GitLab self-managed

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.