question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Repository URL inferrence broken for non-HTTPS repository servers

See original GitHub issue

Follow-up of https://github.com/iterative/cml/pull/608#issuecomment-869881248

Under normal operation conditions, CML tries to infer the repository URL from the Git configuration instead of requiring users to specify it on each command-line invocation. Unfortunately, the code in charge of this behavior blindly assumes HTTPS as the remote URL protocol, and some self-hosted GitLab instances use plain old HTTP instead.

https://github.com/iterative/cml/blob/6c451d965aaea2ad2b1812dd2a223def9ce87739/src/cml.js#L30-L36

Ideally, the gitRemoteUrl function should check both HTTPS and plain HTTP (in that order) and return the first valid URL after issuing a network request to make sure that there is a server listening on the specified address.

let error;
for (const type of ['https', 'http']) {
  const repoUrl = stripAuth(gitUrlParse(url).toString(type));
  try {
    await fetch(repoUrl);
    return repoUrl;
  } catch (err) {
    error = err;
  }
}
throw error;

Unfortunately it’s not that easy, because the gitRemoteUrl function is being called from the constructor of theCML class, and constructors can’t be asynchronous. The only solution I can think of would be resorting to the same approach as in https://github.com/iterative/cml/issues/463#issuecomment-813351066.

DCLXVI #616 🤣

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
dacbdcommented, Jun 10, 2022

seems with a cursory glance at the currnet state im going to guess this is resolved.

1reaction
DavidGOrtegacommented, Jun 29, 2021

Or course we can override insecure connections. NODE_TLS_REJECT_UNAUTHORIZED will also work like we already know. The question is if we should allow it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Server returns broken json requests when using TensorRT ...
Description I have the following model config name: "ner" platform: "onnxruntime_onnx" max_batch_size: 128 input [ { name: "input_ids" ...
Read more >
Setting up and testing a Git connection | Looker - Google Cloud
In Looker's Configure Git section, paste the HTTPS URL for your Git repository in the Repository URL field, then click Continue. Looker will...
Read more >
Updating the CUDA Linux GPG Repository Key
NVIDIA is updating and rotating the signing keys used by apt, dnf/yum, and zypper package managers beginning April 27, 2022.
Read more >
git clone with https error - fatal: repository not found
This Github document reads: The https:// clone URLs are available on all repositories, public and private.
Read more >
S3 repository | Elasticsearch Guide [master] | Elastic
In-progress snapshot/restore tasks will not be preempted by a reload of the client's secure settings. The task will complete using the client as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found