Comments (8)
The storage format changed recently, but that's still strange it's not getting the right URL.
Are you using panamax serve
or nginx to serve the crates?
If you're using nginx, you'll likely need some rewrite config settings:
# Rewrite the download URLs to match the proper crates location.
rewrite "^/crates/([^/])/([^/]+)$" "/crates/1/$1/$2" last;
rewrite "^/crates/([^/]{2})/([^/]+)$" "/crates/2/$1/$2" last;
rewrite "^/crates/([^/])([^/]{2})/([^/]+)$" "/crates/3/$1/$1$2/$3" last;
rewrite "^/crates/([^/]{2})([^/]{2})([^/]*)/([^/]+)$" "/crates/$1/$2/$1$2$3/$4" last;
from https://github.com/panamax-rs/panamax/blob/master/nginx.sample.conf
If you already have those in your nginx config, or you're using panamax serve
and it's still not working, that's indeed strange.
from panamax.
thanks a lot for your QUICK reply!
i use nginx
directly - without panamax serve
.
the rewrite rules helped although i had to tweak them a little in order to take the version number of the crates into account:
rewrite "^/crates/([^/])/([^/]+)-([\d\.]*).crate$" "/crates/1/$1/$3/$2-$3.crate" last;
rewrite "^/crates/([^/]{2})/([^/]+)-([\d\.]*).crate$" "/crates/2/$1/$3/$2-$3.crate" last;
rewrite "^/crates/([^/])([^/]{2})/([^/]+)-([\d\.]*).crate$" "/crates/3/$3/$4/$3-$4.crate" last;
rewrite "^/crates/([^/]{2})([^/]{2})([^/]*)/([^/]+)-([\d\.]*).crate$" "/crates/$1/$2/$1$2$3/$5/$4-$5.crate" last;
i did not run exhaustive tests but it did work for a few simple cases (obviously i'm no regex wizard...).
would it be beneficial to run panamax serve
?
thanks again and best regards!
from panamax.
Apologies for the late reply.
Yeah, I think panamax serve
is the best option for this. If that command doesn't work for you, let me know.
Also, good to know with regards to the rewrite rules! I'll quickly review those. Thanks!
from panamax.
Also, this PR, I have removed the need for URL rewriting.
from panamax.
If you already have those in your nginx config, or you're using
panamax serve
and it's still not working, that's indeed strange.
I'm using panamax serve
on macos and am getting a similar issue. Following the README tutorial with panamax serve
and using installing ripgrep as a dummy and get the following output from cargo:
cargo install --config "source.crates-io.replace-with=\"panamax\"" ripgrep
Updating `panamax` index
warning: spurious network error (3 tries remaining): [6] Couldn't resolve host name (Could not resolve host: panamax.internal)
warning: spurious network error (2 tries remaining): [6] Couldn't resolve host name (Could not resolve host: panamax.internal)
warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Could not resolve host: panamax.internal)
error: failed to download from `http://panamax.internal/crates/ri/pg/ripgrep/13.0.0/ripgrep-13.0.0.crate`
Btw, my cargo config is this:
[source.panamax]
registry = "http://localhost:8080/git/crates.io-index"
Oh and also, base_url is set to "http://panamax.internal/crates".
from panamax.
Sorry to keep updating but now I've meddled in mirror.toml and now can't get the same error. Now I get
cargo install --config "source.crates-io.replace-with=\"panamax\"" ripgrep
Updating `panamax` index
warning: spurious network error (3 tries remaining): unexpected http status code: 404; class=Http (34)
warning: spurious network error (2 tries remaining): unexpected http status code: 404; class=Http (34)
warning: spurious network error (1 tries remaining): unexpected http status code: 404; class=Http (34)
error: failed to update replaced source registry `crates-io`
Caused by:
failed to fetch `http://localhost:8080/git/crates.io-index`
Caused by:
network failure seems to have happened
if a proxy or similar is necessary `net.git-fetch-with-cli` may help here
https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli
Caused by:
unexpected http status code: 404; class=Http (34)
With the server outputting
Not a git repository: 'crates-mirror/crates.io-index'Not a git repository: 'crates-mirror/crates.io-index'Not a git repository: 'crates-mirror/crates.io-index'Not a git repository: 'crates-mirror/crates.io-index'
from panamax.
Ok now I got it back to the problem with panamax.internal somehow.
from panamax.
Ugh I feel very slightly stupid. I for some reason didn't figure out that the base_url would have to be actually what cargo would connect to. Should have read the docs more thoroughly. Sorry.
from panamax.
Related Issues (20)
- Crate whitelisting HOT 1
- Cargo vendor failed using mirror repository
- could not resolve host:panamax.internal HOT 6
- [feature request] panamax publish my-mirror
- on Docker - error creating server listener: Address family not supported by protocol HOT 1
- not a git repository error
- how to masquerade as crates.io HOT 1
- [Enquiry] How big the full mirror is? HOT 3
- [Question] Can I start sync while the panamax is serving? HOT 2
- How do I download WASI and WASM targets ?
- [BUG] inconsistent state may occur HOT 4
- Mirroring Vendored Crates HOT 1
- No config.json HOT 4
- Unable to `cargo search` against panamax mirror HOT 2
- [Question] Use S3/minio to host /mirror? HOT 3
- Request: release a new version containing the fix for filtering unix platforms HOT 1
- channel-*.toml files should be deleted when old Rust versions are purged
- Creating a new mirror with historical stable releases? HOT 4
- Version-specific channel-*.toml files missing when creating new mirror
- Replace references to .cargo/config with .cargo/config.toml
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from panamax.