Sinc

Sinc

My company is porting our Gitlab instance to a new server, and in keeping with company habits has set port 4321 for SSH.

This is creating a problem for me for mix dependencies.

I change the origin URL to the new location with:
git remote set-url origin ssh://git@gitlab2.mycompany.net:4321/myprojgroup/myproj.git and that seems to be working fine.

But now I want to get one of the dependencies from the same repo so I updated the dependency line to:
{:my_dep1, git: “git@gitlab2.mycompany.net:4321/myprojgroup/my_dep1.git”, env: Mix.env()},
I also tried without the port, and with the port followed by a colon instead of the slash. In each case I get the same errors:

mix deps.get

* Updating my_dep (git@gitlab2.mycompany.net:myprojgroup/my_dep.git)
  ssh: connect to host gitlab2.mycompany.net port 22: No route to host
  fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
\*\* (Mix) Command “git --git-dir=.git fetch --force --quiet --progress” failed

The part in parentheses after my_dep copies what is in the mix.exs, but the error always says that it couldn’t connect to host port 22.

Do I need to make them go back to port 22, or is there a way to specify the port in the dependency?

P.S. I tried to put the error response in triple back ticks, but on three separate attempts the web page locked up and wouldn’t respond anymore. I’m not sure whether that was after 2 ticks or 3, but the third one didn’t show up in any case.

Showing Posts 1 to 9

NobbZ

NobbZ

I can’t test it, though I expect the git: "ssh://git@gitlab2.mycompany.net:4321/myprojgroup/myproj.git" to work out of the box.

URLs without an explicit schema work differently.

Alternatively you should be able to use insteadOf git config with some tricks, as exampled in the docs:

mix deps — Mix v1.20.2 "

hauleth

hauleth

Have you tried setting port for that host in .ssh/config?

Sinc

Sinc OP

None of them work out of the box, but I failed to report versions. We’re still running Elixir 1.14.25 on OTP26.2.5. Do you think that would affect it?

Sinc

Sinc OP

Lovely. That worked. Sadly that means that everyone who wants to work on the project has to update their personal config file, but it at least gets me through this.

Now I have permission or project name issues, but at least I got to the server. Thanks.

The guy that ported the project decided to change the group name to PascalCase. I’m going to yell at him. Even if that isn’t the problem.

Sinc

Sinc OP

I tried doing the config with the url.”myURL:4321”.insteadOf myURL but it gave me the same error about port 22.

Looks like for now I’ll have to go with the underlying SSH config, unless I can talk the migration team out of the alternate port.

joram

joram

I just tested with Elixir 1.14.5 on OTP 26 and specifying the git URL as ssh://git@example.com:4321/repo does work to specify the port.

What mix deps.get does with dependencies like this is create a git repository, add a remote origin with the specified URL, then call git fetch to fetch from the remote. If you can clone from ssh://git@gitlab2.mycompany.net:4321/myprojgroup/my_dep1.git, it should also work as a dependency.

Sinc

Sinc OP

Once I read your instructions a few times and tried variations I figured out that what you meant was writing my dependency as:
{my_dep1, git: “ssh://git@gitlab2.mycompany.net:4321/myprojgroup/my_dep1.git”, env: Mix.env()},

At first I didn’t realize you meant that I should keep the git: part, and nothing went well.

Sinc

Sinc OP

My bad. I missed that you inserted the ssh:// at the beginning of what I had. So this was the solution.

Sinc

Sinc OP

After working through @joram ‘s post I looked back at your and realized that you had the same “ssh://” in yours that I misunderstood in his. Which means you were right in the first place, and I have to read more carefully.

Thanks all.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews