dbt-labs / dbt-labs/dbt

[CT-3109] Problem installing old version

Open
#8,624 2 comments 1 reaction 0 assignees View on GitHub
engine:v1
Dominant language
Rust
Stars
13.8k
Forks
2.6k
Avg merge
21h 31m
Merged PRs (30d)
56

Description

I'm having the same issue as in https://github.com/dbt-labs/dbt-core/issues/4185, while trying to install 0.20.2:

```
$ pip install dbt==0.20.2
Collecting dbt-extractor==0.4.0
Using cached dbt_extractor-0.4.0.tar.gz (21 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done

Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
💥 maturin failed
Caused by: Cargo metadata failed. Does your crate compile with `cargo build`?
Caused by: `cargo metadata` exited with an error: Updating crates.io index
Updating git repository `git://github.com/fishtown-analytics/tree-sitter-jinja2`
warning: spurious network error (3 tries remaining): failed to connect to github.com: Operation timed out; class=Os (2)
warning: spurious network error (2 tries remaining): failed to connect to github.com: Operation timed out; class=Os (2)
warning: spurious network error (1 tries remaining): failed to connect to github.com: Operation timed out; class=Os (2)
error: failed to get `tree-sitter-jinja2` as a dependency of package `dbt-extractor v0.4.0 (/private/var/folders/27/4cznr1bj5yd0mq5sbf3qtgv40000gn/T/pip-install-66vdgq2e/dbt-extractor_d1dd8847796247ac8e6ecd0096b7042d)`

Caused by:
failed to load source for dependency `tree-sitter-jinja2`

Caused by:
Unable to update git://github.com/fishtown-analytics/tree-sitter-jinja2?branch=main#52da7b0b

Caused by:
failed to fetch into: /Users/martinb/.cargo/git/db/tree-sitter-jinja2-0efee0b6ece5345f

Caused by:
failed to connect to github.com: Operation timed out; class=Os (2)
Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/private/var/folders/27/4cznr1bj5yd0mq5sbf3qtgv40000gn/T/pip-modern-metadata-ff8cl4hx', '--interpreter', '/Users/martinb/.pyenv/versions/3.11.3/bin/python3.11']' returned non-zero exit status 1.
Checking for Rust toolchain....
Running `maturin pep517 write-dist-info --metadata-directory /private/var/folders/27/4cznr1bj5yd0mq5sbf3qtgv40000gn/T/pip-modern-metadata-ff8cl4hx --interpreter /Users/martinb/.pyenv/versions/3.11.3/bin/python3.11`
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.
```

I have the latest rust on my system, in case it matters and it's not M1.

Unfortunately, we're stuck on this version for now. I dream of upgrading. #6527

I also tried brew with this version but it just fails without explanation so this is my last chance.

UPDATE: I (kinda) fixed this error by fetching manually.

Apparently, you can force cargo to use git cli like so:

```
cat ~/.cargo/config
[net]
git-fetch-with-cli = true
```

So when it runs, there's still an error but it shows you the git command that failed:

```
git fetch --tags --force --update-head-ok 'git://github.com/fishtown-analytics/tree-sitter-jinja2' '+refs/heads/*:refs/remotes/origin/*' '+HEAD:refs/remotes/origin/HEAD'
```

So I changed that to:

```
git fetch --tags --force --update-head-ok 'git@github.com:dbt-labs/tree-sitter-jinja2.git' '+refs/heads/*:refs/remotes/origin/*' '+HEAD:refs/remotes/origin/HEAD'
```

The next run pip install run didn't have this error.

But now there's a problem with numpy so I'm effectively giving up on this; I'll probably resort to using docker. It's an ancient version of dbt so what did I expect. :)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.