Skip to content

ZeroNSd segfault in Alpine docker #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mcondarelli opened this issue Aug 31, 2021 · 30 comments
Closed

ZeroNSd segfault in Alpine docker #106

mcondarelli opened this issue Aug 31, 2021 · 30 comments

Comments

@mcondarelli
Copy link

Disclaimer: I know nothing about Rust, Rust programming, Cargo, Rust and such; this could well be entirely my fault, please be lenient.

I was trying to setup this in a container (FROM rust:alpine), but standard zeronsd start -d <domain> <network-id> simply exited with an uninformative "Segmentation fault" error.

I then made a VirualBox VM with the same content as Docker Container, compiled with debugging symbols and fired-up rust-gdb --args /home/mcondarelli/zeronsd/target/debug/zeronsd start ...
Sure enough I got the same error.

alpine:~# ./start.zeronsd.sh 
GNU gdb (GDB) 10.2
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-alpine-linux-musl".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/mcondarelli/zeronsd/target/debug/zeronsd...
(gdb) r
Starting program: /home/mcondarelli/zeronsd/target/debug/zeronsd start -d <domain> <network-id>
[New LWP 12918]

Thread 1 "zeronsd" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007ffff76ffc7a in openssl::ssl::SslMethod::tls () at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/openssl-0.10.35/src/ssl/mod.rs:324
#2  0x00007ffff76f53c2 in native_tls::imp::TlsConnector::new (builder=0x7ffffffedcc0) at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/native-tls-0.2.7/src/imp/openssl.rs:257
#3  0x00007ffff76f6c32 in native_tls::TlsConnectorBuilder::build (self=0x7ffffffedcc0) at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/native-tls-0.2.7/src/lib.rs:433
#4  0x00007ffff75e26e0 in reqwest::connect::Connector::new_default_tls<core::option::Option<std::net::ip::IpAddr>> (http=..., tls=..., proxies=Arc(strong=2, weak=0) = {...}, user_agent=..., 
    local_addr=<error reading variable: Cannot access memory at address 0x0>, nodelay=true) at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/reqwest-0.11.4/src/connect.rs:220
#5  0x00007ffff75b57ed in reqwest::async_impl::client::ClientBuilder::build (self=...) at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/reqwest-0.11.4/src/async_impl/client.rs:253
#6  0x00007ffff75b654d in reqwest::async_impl::client::Client::new () at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/reqwest-0.11.4/src/async_impl/client.rs:1088
#7  0x00007ffff75235cc in zerotier_central_api::apis::configuration::{{impl}}::default () at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/zerotier-central-api-1.0.2/src/apis/configuration.rs:45
#8  0x00007ffff70603a2 in zeronsd::utils::central_config (token=<error reading variable: Cannot access memory at address 0x5>) at src/utils.rs:21
#9  0x00007ffff6fc0f36 in zeronsd::start (args=0x7ffff8002e38) at src/main.rs:60
#10 0x00007ffff6fc4856 in zeronsd::main () at src/main.rs:211
(gdb) 

An attempt to follow initialization seems to crash when stepping into /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/native-tls-0.2.7/src/imp/openssl.rs#94 ..> ONCE.call_once(openssl_probe::init_ssl_cert_env_vars);.

What am I doing so wrong?

@laduke laduke changed the title ZeroNSd segfault ZeroNSd segfault in Alpine docker Aug 31, 2021
@erikh
Copy link
Contributor

erikh commented Aug 31, 2021 via email

@mcondarelli
Copy link
Author

Thanks erikh,
my script is very basic, just set a few Env variables and start zeronsd:

alpine:~# cat start.zeronsd.sh 
#!/bin/sh

export RUSTUP_HOME=/usr/local/rustup
export CARGO_HOME=/usr/local/cargo
export PATH=/usr/local/cargo/bin:$PATH \
export RUST_VERSION=1.54.0

export ZEROTIER_CENTRAL_TOKEN="..."
zeronsd start -d condarelli.it ...

Also build is absolutely basic; first I tried the standard:

cargo install --path .

then I tried the debug/unoptimized way:

cargo build

of course then I changed slightly the script to start the right executable:

...
rust-gdb --args /home/mcondarelli/zeronsd/target/debug/zeronsd start -d condarelli.it ...

The whole scripting stuff is because I normally compile as a "normal user", but zeronsd needs to be "root" to access ZeroTier-One authtoken and other stuff (at least this is how I understood, if I'm wrong please correct me).

@erikh
Copy link
Contributor

erikh commented Sep 1, 2021 via email

@erikh
Copy link
Contributor

erikh commented Sep 1, 2021

Just to be clear, this is not your failure or fault. This is an incompatibility with some library (likely openssl or libc) and our code.

zeronsd needs to run as root to bind on port 53, which is used for DNS.

@erikh
Copy link
Contributor

erikh commented Sep 1, 2021

after some sleuthing I think I figured out what the problem might be. alexcrichton/openssl-probe#19

If you could do me a favor, ensure one of these paths exist on your system where zeronsd is running? This will help me report / patch the issue.

https://github.com/alexcrichton/openssl-probe/blob/master/src/lib.rs#L24

@mcondarelli
Copy link
Author

mcondarelli commented Sep 1, 2021

Hi,
thanks for the fast answer.
I am unsure about what you are looking for, anyhow:

alpine:~# ls -l /var/ssl
ls: /var/ssl: No such file or directory
alpine:~# ls -l /usr/share/ssl
ls: /usr/share/ssl: No such file or directory
alpine:~# ls -l /usr/local/ssl
ls: /usr/local/ssl: No such file or directory
alpine:~# ls -l /usr/local/etc/ssl
ls: /usr/local/etc/ssl: No such file or directory
alpine:~# ls -l /usr/local/openssl
ls: /usr/local/openssl: No such file or directory
alpine:~# ls -l /usr/local/etc/openssl
ls: /usr/local/etc/openssl: No such file or directory
alpine:~# ls -l /usr/local/share
total 16
drwxr-xr-x    2 root     root          4096 Aug 30 22:22 ca-certificates
drwxr-sr-x    3 root     root          4096 Aug 30 22:17 doc
drwxr-sr-x    3 root     root          4096 Aug 30 22:17 man
drwxr-sr-x    3 root     root          4096 Aug 30 22:17 systemtap
alpine:~# ls -l /usr/lib/ssl
ls: /usr/lib/ssl: No such file or directory
alpine:~# ls -l /usr/ssl
ls: /usr/ssl: No such file or directory
alpine:~# ls -l /etc/openssl
ls: /etc/openssl: No such file or directory
alpine:~# ls -l /etc/pki/ca-trust/extracted/pem
ls: /etc/pki/ca-trust/extracted/pem: No such file or directory
alpine:~# ls -l /etc/pki/tls
ls: /etc/pki/tls: No such file or directory
alpine:~# ls -l /etc/ssl
total 60
lrwxrwxrwx    1 root     root            25 Aug 30 22:01 cert.pem -> certs/ca-certificates.crt
drwxr-xr-x    2 root     root         20480 Aug 30 22:22 certs
-rw-r--r--    1 root     root           412 Aug 24 17:52 ct_log_list.cnf
-rw-r--r--    1 root     root           412 Aug 24 17:52 ct_log_list.cnf.dist
drwxr-xr-x    2 root     root          4096 Aug 30 22:01 misc
-rw-r--r--    1 root     root         10909 Aug 24 17:52 openssl.cnf
-rw-r--r--    1 root     root         10909 Aug 24 17:52 openssl.cnf.dist
drwxr-xr-x    2 root     root          4096 Aug 30 22:01 private
alpine:~# ls -l /data/data/com.termux/files/usr/etc/tls
ls: /data/data/com.termux/files/usr/etc/tls: No such file or directory
alpine:~# ls -l /boot/system/data/ssl
ls: /boot/system/data/ssl: No such file or directory
alpine:~# 

As you see two of those paths actually exist.
Note the first one (/usr/local/share/ca-certificates/) is empty, while the second (/etc/ssl/certs) has the usual assortment of root certificates.
In /etc/ssl/certs there's a bunch of symlinks to /usr/local/share/ca-certificates/mozilla which contains the actual data.
I don't know if this is relevant.

@erikh
Copy link
Contributor

erikh commented Sep 1, 2021

I'm trying to suss out what is causing the null ptr dereference in your trace. It seems related to the listening address at a second peek, so maybe I jumped the gun on that report, but still, rust should largely prevent this from happening before the project is compiled, so it is almost definitely happening somewhere in the FFI layer. You have the requisite paths and this is probably the wrong tree to be barking up.

that said, I cannot build with alpine at all. can you share the build instructions you used? I am adapting the project like so:

FROM rust:alpine as buildenv

ARG IS_LOCAL=0
ARG VERSION=main
ARG IS_TAG=0

COPY . /code
WORKDIR /code
RUN apk add openssl pkgconfig
RUN sh cargo-docker.sh

FROM alpine:latest

#RUN apt-get update -qq && apt-get install libssl1.1 ca-certificates -y && apt-get autoclean -y && apt-get clean -y
COPY --from=buildenv /usr/local/cargo/bin/zeronsd /usr/bin/zeronsd

ENTRYPOINT ["/usr/bin/zeronsd"]

Compare with our root level dockerfile for reference. It is not building because pkg-config cannot find the headers. I am not an alpine user.

@mcondarelli
Copy link
Author

I am able to build using the attached script (test-it.sh)

test.tar.gz

After that I can get to the segfault with:

mcon@cinderella:/tmp/t$ docker exec -ti zt1 /bin/sh
/ # export RUSTUP_HOME=/usr/local/rustup
/ # export CARGO_HOME=/usr/local/cargo
/ # export PATH=/usr/local/cargo/bin:$PATH
/ # export RUST_VERSION=1.54.0
/ # export ZEROTIER_CENTRAL_TOKEN="..."
/ # zeronsd start -d condarelli.it <network-id>
Segmentation fault (core dumped)
/ # 

@erikh
Copy link
Contributor

erikh commented Sep 1, 2021

thanks for preparing this; I'm looking into it now.

@mcondarelli
Copy link
Author

Note: as expected redoing (roughly) the same with Debian-bullseye as base seems to work (at least it doesn't segafault): INFO - Welcome to ZeroNS!

@erikh
Copy link
Contributor

erikh commented Sep 1, 2021

yes, our standard zerotier/zeronsd container is built atop debian.

@erikh
Copy link
Contributor

erikh commented Sep 1, 2021

so, I'll have to look into the alpine specific need later. it's 4am here. :) I need to get some rest.

I'm busy with another project, so until I come up for air this may be stalled. Are you ok with another solution for now?

@mcondarelli
Copy link
Author

Yup!
No problem.
I need to cross check everything else works in bullseye, but I can live with a slightly fatter container.
If you are interested in digging into this (alpine is a fairly popular base for Docker images) I am willing to help testing.
Thanks for all the good work.

FYI: I'm trying to setup a container with a complete solution for Zerotier/controller/controller-gui and dns.
stay tuned!
;)

@altano
Copy link

altano commented Jan 26, 2022

FWIW zeronsd's crate (v0.2.4) won't compile in Alpine (v3.15) anymore (zeronsd v0.2.3 compiled fine on Alpine v3.14). I'd paste the error here but now when I try to build it again I get an error about tokio not compiling (the original error was definitely zeronsd).

I'll switch to debian as well. Thanks!

@erikh
Copy link
Contributor

erikh commented Jan 26, 2022

Interesting. I'll look into this tomorrow. Thanks.

@erikh
Copy link
Contributor

erikh commented Jan 26, 2022

Could you try latest master? I updated the dependencies today; may fix something.

@altano
Copy link

altano commented Jan 26, 2022

Could you try latest master? I updated the dependencies today; may fix something.

Doing this:

git clone https://github.com/zerotier/zeronsd.git
cd zeronsd
cargo install zeronsd --root /usr/local

Gives me the same error as before:

   Compiling zeronsd v0.2.4
error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/zeronsd-0.2.4/src/supervise.rs:91:18
   |
91 | impl From<&clap::ArgMatches<'_>> for Properties {
   |                  ^^^^^^^^^^---- help: remove these generics
   |                  |
   |                  expected 0 lifetime arguments
   |
note: struct defined here, with 0 lifetime parameters
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.12/src/parse/matches/arg_matches.rs:71:12
   |
71 | pub struct ArgMatches {
   |            ^^^^^^^^^^

error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/zeronsd-0.2.4/src/main.rs:39:29
   |
39 | fn unsupervise(args: &clap::ArgMatches<'_>) -> Result<(), anyhow::Error> {
   |                             ^^^^^^^^^^---- help: remove these generics
   |                             |
   |                             expected 0 lifetime arguments
   |
note: struct defined here, with 0 lifetime parameters
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.12/src/parse/matches/arg_matches.rs:71:12
   |
71 | pub struct ArgMatches {
   |            ^^^^^^^^^^

error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/zeronsd-0.2.4/src/main.rs:43:27
   |
43 | fn supervise(args: &clap::ArgMatches<'_>) -> Result<(), anyhow::Error> {
   |                           ^^^^^^^^^^---- help: remove these generics
   |                           |
   |                           expected 0 lifetime arguments
   |
note: struct defined here, with 0 lifetime parameters
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.12/src/parse/matches/arg_matches.rs:71:12
   |
71 | pub struct ArgMatches {
   |            ^^^^^^^^^^

error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/zeronsd-0.2.4/src/main.rs:47:23
   |
47 | fn start(args: &clap::ArgMatches<'_>) -> Result<(), anyhow::Error> {
   |                       ^^^^^^^^^^---- help: remove these generics
   |                       |
   |                       expected 0 lifetime arguments
   |
note: struct defined here, with 0 lifetime parameters
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.12/src/parse/matches/arg_matches.rs:71:12
   |
71 | pub struct ArgMatches {
   |            ^^^^^^^^^^

error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/zeronsd-0.2.4/src/supervise.rs:92:26
   |
92 |     fn from(args: &clap::ArgMatches<'_>) -> Self {
   |                          ^^^^^^^^^^---- help: remove these generics
   |                          |
   |                          expected 0 lifetime arguments
   |
note: struct defined here, with 0 lifetime parameters
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.12/src/parse/matches/arg_matches.rs:71:12
   |
71 | pub struct ArgMatches {
   |            ^^^^^^^^^^

For more information about this error, try `rustc --explain E0107`.
error: failed to compile `zeronsd v0.2.4`, intermediate artifacts can be found at `/tmp/cargo-installqAUpan`

Caused by:
  could not compile `zeronsd` due to 5 previous errors

Don't worry about it, if you don't want to spend time investigating. I'm happy to switch to debian.

@erikh
Copy link
Contributor

erikh commented Jan 26, 2022

this was covered by #116 but I thought I fixed it earlier today. Can you try latest main branch one more time? I just updated it again.

@altano
Copy link

altano commented Jan 26, 2022

this was covered by #116 but I thought I fixed it earlier today. Can you try latest main branch one more time? I just updated it again.

I'm still hitting the same error. I have 075c824 from origin/main checked out.

@erikh
Copy link
Contributor

erikh commented Jan 26, 2022 via email

@erikh
Copy link
Contributor

erikh commented Jan 26, 2022

it's compiling here just fine, btw, which is why I'm stumped. :)

@erikh
Copy link
Contributor

erikh commented Jan 26, 2022

also I got it booting just fine in alpine. These are the steps I took:

git clone https://github.com/zerotier/zeronsd
cd zeronsd
docker run -it -v $PWD:/zeronsd -w /zeronsd alpine sh
apk add rust
apk add cargo
apk add openssl
apk add openssl-dev
cargo install --path .
/root/.cargo/bin/zeronsd start -t <token file> <network id>

@erikh
Copy link
Contributor

erikh commented Jan 26, 2022

I made an alpine dockerfile: #122. PTAL.

@altano
Copy link

altano commented Jan 26, 2022

strange, because the cargo.toml requirements explicitly force it at 2 -- can you cargo tree for me and dump it here?

Maybe cargo is caching something I can't find? Here's your info:

git rev-parse HEAD:

075c824b8788bc9f99ab1cc7b64cc3fa634cd252

cat Cargo.toml | grep clap:

clap = "=2"

cargo tree:

zeronsd:~/src/zeronsd# cargo tree
  Downloaded vec_map v0.8.2
  Downloaded unicode-width v0.1.9
  Downloaded textwrap v0.11.0
  Downloaded clap v2.34.0
  Downloaded ansi_term v0.12.1
  Downloaded strsim v0.8.0
  Downloaded 6 crates (284.9 KB) in 0.63s
zeronsd v0.2.4 (/root/src/zeronsd)
├── anyhow v1.0.53
├── clap v2.34.0
│   ├── ansi_term v0.12.1
│   ├── atty v0.2.14
│   │   └── libc v0.2.114
│   ├── bitflags v1.3.2
│   ├── strsim v0.8.0
│   ├── textwrap v0.11.0
│   │   └── unicode-width v0.1.9
│   ├── unicode-width v0.1.9
│   └── vec_map v0.8.2
├── hex v0.4.3
├── ipnetwork v0.18.0
│   └── serde v1.0.136
│       └── serde_derive v1.0.136 (proc-macro)
│           ├── proc-macro2 v1.0.36
│           │   └── unicode-xid v0.2.2
│           ├── quote v1.0.15
│           │   └── proc-macro2 v1.0.36 (*)
│           └── syn v1.0.86
│               ├── proc-macro2 v1.0.36 (*)
│               ├── quote v1.0.15 (*)
│               └── unicode-xid v0.2.2
├── log v0.4.14
│   └── cfg-if v1.0.0
├── num_cpus v1.13.1
│   └── libc v0.2.114
├── rand v0.8.4
│   ├── libc v0.2.114
│   ├── rand_chacha v0.3.1
│   │   ├── ppv-lite86 v0.2.16
│   │   └── rand_core v0.6.3
│   │       └── getrandom v0.2.4
│   │           ├── cfg-if v1.0.0
│   │           └── libc v0.2.114
│   └── rand_core v0.6.3 (*)
├── regex v1.5.4
│   ├── aho-corasick v0.7.18
│   │   └── memchr v2.4.1
│   ├── memchr v2.4.1
│   └── regex-syntax v0.6.25
├── serde v1.0.136 (*)
├── serde_json v1.0.78
│   ├── itoa v1.0.1
│   ├── ryu v1.0.9
│   └── serde v1.0.136 (*)
├── stderrlog v0.5.1
│   ├── atty v0.2.14 (*)
│   ├── chrono v0.4.19
│   │   ├── libc v0.2.114
│   │   ├── num-integer v0.1.44
│   │   │   └── num-traits v0.2.14
│   │   │       [build-dependencies]
│   │   │       └── autocfg v1.0.1
│   │   │   [build-dependencies]
│   │   │   └── autocfg v1.0.1
│   │   ├── num-traits v0.2.14 (*)
│   │   └── time v0.1.43
│   │       └── libc v0.2.114
│   ├── log v0.4.14 (*)
│   ├── termcolor v1.1.2
│   └── thread_local v1.0.1
│       └── lazy_static v1.4.0
├── tinytemplate v1.2.1
│   ├── serde v1.0.136 (*)
│   └── serde_json v1.0.78 (*)
├── tokio v1.15.0
│   ├── bytes v1.1.0
│   ├── libc v0.2.114
│   ├── memchr v2.4.1
│   ├── mio v0.7.14
│   │   ├── libc v0.2.114
│   │   └── log v0.4.14 (*)
│   ├── num_cpus v1.13.1 (*)
│   ├── once_cell v1.9.0
│   ├── parking_lot v0.11.2
│   │   ├── instant v0.1.12
│   │   │   └── cfg-if v1.0.0
│   │   ├── lock_api v0.4.5
│   │   │   └── scopeguard v1.1.0
│   │   └── parking_lot_core v0.8.5
│   │       ├── cfg-if v1.0.0
│   │       ├── instant v0.1.12 (*)
│   │       ├── libc v0.2.114
│   │       └── smallvec v1.8.0
│   ├── pin-project-lite v0.2.8
│   ├── signal-hook-registry v1.4.0
│   │   └── libc v0.2.114
│   └── tokio-macros v1.7.0 (proc-macro)
│       ├── proc-macro2 v1.0.36 (*)
│       ├── quote v1.0.15 (*)
│       └── syn v1.0.86 (*)
├── trust-dns-resolver v0.20.3
│   ├── cfg-if v1.0.0
│   ├── futures-util v0.3.19
│   │   ├── futures-core v0.3.19
│   │   ├── futures-task v0.3.19
│   │   ├── pin-project-lite v0.2.8
│   │   ├── pin-utils v0.1.0
│   │   └── slab v0.4.5
│   ├── lazy_static v1.4.0
│   ├── log v0.4.14 (*)
│   ├── lru-cache v0.1.2
│   │   └── linked-hash-map v0.5.4
│   ├── parking_lot v0.11.2 (*)
│   ├── resolv-conf v0.7.0
│   │   ├── hostname v0.3.1
│   │   │   ├── libc v0.2.114
│   │   │   └── match_cfg v0.1.0
│   │   └── quick-error v1.2.3
│   ├── serde v1.0.136 (*)
│   ├── smallvec v1.8.0
│   ├── thiserror v1.0.30
│   │   └── thiserror-impl v1.0.30 (proc-macro)
│   │       ├── proc-macro2 v1.0.36 (*)
│   │       ├── quote v1.0.15 (*)
│   │       └── syn v1.0.86 (*)
│   ├── tokio v1.15.0 (*)
│   └── trust-dns-proto v0.20.3
│       ├── async-trait v0.1.52 (proc-macro)
│       │   ├── proc-macro2 v1.0.36 (*)
│       │   ├── quote v1.0.15 (*)
│       │   └── syn v1.0.86 (*)
│       ├── cfg-if v1.0.0
│       ├── data-encoding v2.3.2
│       ├── enum-as-inner v0.3.3 (proc-macro)
│       │   ├── heck v0.3.3
│       │   │   └── unicode-segmentation v1.8.0
│       │   ├── proc-macro2 v1.0.36 (*)
│       │   ├── quote v1.0.15 (*)
│       │   └── syn v1.0.86 (*)
│       ├── futures-channel v0.3.19
│       │   └── futures-core v0.3.19
│       ├── futures-io v0.3.19
│       ├── futures-util v0.3.19 (*)
│       ├── idna v0.2.3
│       │   ├── matches v0.1.9
│       │   ├── unicode-bidi v0.3.7
│       │   └── unicode-normalization v0.1.19
│       │       └── tinyvec v1.5.1
│       │           └── tinyvec_macros v0.1.0
│       ├── ipnet v2.3.1
│       ├── lazy_static v1.4.0
│       ├── log v0.4.14 (*)
│       ├── rand v0.8.4 (*)
│       ├── serde v1.0.136 (*)
│       ├── smallvec v1.8.0
│       ├── thiserror v1.0.30 (*)
│       ├── tinyvec v1.5.1 (*)
│       ├── tokio v1.15.0 (*)
│       └── url v2.2.2
│           ├── form_urlencoded v1.0.1
│           │   ├── matches v0.1.9
│           │   └── percent-encoding v2.1.0
│           ├── idna v0.2.3 (*)
│           ├── matches v0.1.9
│           └── percent-encoding v2.1.0
├── trust-dns-server v0.20.3
│   ├── async-trait v0.1.52 (proc-macro) (*)
│   ├── bytes v1.1.0
│   ├── cfg-if v1.0.0
│   ├── chrono v0.4.19 (*)
│   ├── enum-as-inner v0.3.3 (proc-macro) (*)
│   ├── env_logger v0.8.4
│   │   ├── atty v0.2.14 (*)
│   │   ├── humantime v2.1.0
│   │   ├── log v0.4.14 (*)
│   │   ├── regex v1.5.4 (*)
│   │   └── termcolor v1.1.2
│   ├── futures-executor v0.3.19
│   │   ├── futures-core v0.3.19
│   │   ├── futures-task v0.3.19
│   │   └── futures-util v0.3.19 (*)
│   ├── futures-util v0.3.19 (*)
│   ├── log v0.4.14 (*)
│   ├── serde v1.0.136 (*)
│   ├── thiserror v1.0.30 (*)
│   ├── tokio v1.15.0 (*)
│   ├── toml v0.5.8
│   │   └── serde v1.0.136 (*)
│   ├── trust-dns-client v0.20.3
│   │   ├── cfg-if v1.0.0
│   │   ├── chrono v0.4.19 (*)
│   │   ├── data-encoding v2.3.2
│   │   ├── futures-channel v0.3.19 (*)
│   │   ├── futures-util v0.3.19 (*)
│   │   ├── lazy_static v1.4.0
│   │   ├── log v0.4.14 (*)
│   │   ├── radix_trie v0.2.1
│   │   │   ├── endian-type v0.1.2
│   │   │   └── nibble_vec v0.1.0
│   │   │       └── smallvec v1.8.0
│   │   ├── rand v0.8.4 (*)
│   │   ├── thiserror v1.0.30 (*)
│   │   ├── tokio v1.15.0 (*)
│   │   └── trust-dns-proto v0.20.3 (*)
│   ├── trust-dns-proto v0.20.3 (*)
│   └── trust-dns-resolver v0.20.3 (*)
├── zerotier-central-api v1.0.2
│   ├── reqwest v0.11.9
│   │   ├── base64 v0.13.0
│   │   ├── bytes v1.1.0
│   │   ├── encoding_rs v0.8.30
│   │   │   └── cfg-if v1.0.0
│   │   ├── futures-core v0.3.19
│   │   ├── futures-util v0.3.19 (*)
│   │   ├── h2 v0.3.10
│   │   │   ├── bytes v1.1.0
│   │   │   ├── fnv v1.0.7
│   │   │   ├── futures-core v0.3.19
│   │   │   ├── futures-sink v0.3.19
│   │   │   ├── futures-util v0.3.19 (*)
│   │   │   ├── http v0.2.6
│   │   │   │   ├── bytes v1.1.0
│   │   │   │   ├── fnv v1.0.7
│   │   │   │   └── itoa v1.0.1
│   │   │   ├── indexmap v1.8.0
│   │   │   │   └── hashbrown v0.11.2
│   │   │   │   [build-dependencies]
│   │   │   │   └── autocfg v1.0.1
│   │   │   ├── slab v0.4.5
│   │   │   ├── tokio v1.15.0 (*)
│   │   │   ├── tokio-util v0.6.9
│   │   │   │   ├── bytes v1.1.0
│   │   │   │   ├── futures-core v0.3.19
│   │   │   │   ├── futures-sink v0.3.19
│   │   │   │   ├── log v0.4.14 (*)
│   │   │   │   ├── pin-project-lite v0.2.8
│   │   │   │   └── tokio v1.15.0 (*)
│   │   │   └── tracing v0.1.29
│   │   │       ├── cfg-if v1.0.0
│   │   │       ├── pin-project-lite v0.2.8
│   │   │       └── tracing-core v0.1.21
│   │   │           └── lazy_static v1.4.0
│   │   ├── http v0.2.6 (*)
│   │   ├── http-body v0.4.4
│   │   │   ├── bytes v1.1.0
│   │   │   ├── http v0.2.6 (*)
│   │   │   └── pin-project-lite v0.2.8
│   │   ├── hyper v0.14.16
│   │   │   ├── bytes v1.1.0
│   │   │   ├── futures-channel v0.3.19 (*)
│   │   │   ├── futures-core v0.3.19
│   │   │   ├── futures-util v0.3.19 (*)
│   │   │   ├── h2 v0.3.10 (*)
│   │   │   ├── http v0.2.6 (*)
│   │   │   ├── http-body v0.4.4 (*)
│   │   │   ├── httparse v1.5.1
│   │   │   ├── httpdate v1.0.2
│   │   │   ├── itoa v0.4.8
│   │   │   ├── pin-project-lite v0.2.8
│   │   │   ├── socket2 v0.4.3
│   │   │   │   └── libc v0.2.114
│   │   │   ├── tokio v1.15.0 (*)
│   │   │   ├── tower-service v0.3.1
│   │   │   ├── tracing v0.1.29 (*)
│   │   │   └── want v0.3.0
│   │   │       ├── log v0.4.14 (*)
│   │   │       └── try-lock v0.2.3
│   │   ├── hyper-tls v0.5.0
│   │   │   ├── bytes v1.1.0
│   │   │   ├── hyper v0.14.16 (*)
│   │   │   ├── native-tls v0.2.8
│   │   │   │   ├── log v0.4.14 (*)
│   │   │   │   ├── openssl v0.10.38
│   │   │   │   │   ├── bitflags v1.3.2
│   │   │   │   │   ├── cfg-if v1.0.0
│   │   │   │   │   ├── foreign-types v0.3.2
│   │   │   │   │   │   └── foreign-types-shared v0.1.1
│   │   │   │   │   ├── libc v0.2.114
│   │   │   │   │   ├── once_cell v1.9.0
│   │   │   │   │   └── openssl-sys v0.9.72
│   │   │   │   │       └── libc v0.2.114
│   │   │   │   │       [build-dependencies]
│   │   │   │   │       ├── autocfg v1.0.1
│   │   │   │   │       ├── cc v1.0.72
│   │   │   │   │       └── pkg-config v0.3.24
│   │   │   │   ├── openssl-probe v0.1.5
│   │   │   │   └── openssl-sys v0.9.72 (*)
│   │   │   ├── tokio v1.15.0 (*)
│   │   │   └── tokio-native-tls v0.3.0
│   │   │       ├── native-tls v0.2.8 (*)
│   │   │       └── tokio v1.15.0 (*)
│   │   ├── ipnet v2.3.1
│   │   ├── lazy_static v1.4.0
│   │   ├── log v0.4.14 (*)
│   │   ├── mime v0.3.16
│   │   ├── mime_guess v2.0.3
│   │   │   ├── mime v0.3.16
│   │   │   └── unicase v2.6.0
│   │   │       [build-dependencies]
│   │   │       └── version_check v0.9.4
│   │   │   [build-dependencies]
│   │   │   └── unicase v2.6.0 (*)
│   │   ├── native-tls v0.2.8 (*)
│   │   ├── percent-encoding v2.1.0
│   │   ├── pin-project-lite v0.2.8
│   │   ├── serde v1.0.136 (*)
│   │   ├── serde_json v1.0.78 (*)
│   │   ├── serde_urlencoded v0.7.1
│   │   │   ├── form_urlencoded v1.0.1 (*)
│   │   │   ├── itoa v1.0.1
│   │   │   ├── ryu v1.0.9
│   │   │   └── serde v1.0.136 (*)
│   │   ├── tokio v1.15.0 (*)
│   │   ├── tokio-native-tls v0.3.0 (*)
│   │   └── url v2.2.2 (*)
│   ├── serde v1.0.136 (*)
│   ├── serde_derive v1.0.136 (proc-macro) (*)
│   ├── serde_json v1.0.78 (*)
│   └── url v2.2.2 (*)
└── zerotier-one-api v1.0.4
    ├── reqwest v0.11.9 (*)
    ├── serde v1.0.136 (*)
    ├── serde_derive v1.0.136 (proc-macro) (*)
    ├── serde_json v1.0.78 (*)
    └── url v2.2.2 (*)

@erikh
Copy link
Contributor

erikh commented Jan 26, 2022

ok. can you rm -rf ~/.cargo/registry and try the build process again? this will remove all your crates, and will be a healthy download, so be aware of it.

@altano
Copy link

altano commented Jan 26, 2022

I recreated my Alpine VM and did these steps, almost exactly yours:

apk add nano
nano /etc/apk/repositories
uncomment "alpine/v3.15/community", save
apk update
apk add rust cargo openssl openssl-dev git
git clone https://github.com/zerotier/zeronsd
cd zeronsd
cargo install --path .
/root/.cargo/bin/zeronsd --version

... and it worked fine. Looks like a caching issue? I have no clue.

@erikh
Copy link
Contributor

erikh commented Jan 26, 2022

yeah seems like cargo has a bug :(

@erikh
Copy link
Contributor

erikh commented Jan 26, 2022

So I added a dockerfile in an earlier pull request that I just merged. Those of you who use alpine can either:

  • use it directly (there are instructions near the top)
  • use it as a template for how to program your vms

However, I think this bug can be closed now. Please feel free to comment if it returns.

@erikh erikh closed this as completed Jan 26, 2022
@altano
Copy link

altano commented Jan 26, 2022

ok. can you rm -rf ~/.cargo/registry and try the build process again? this will remove all your crates, and will be a healthy download, so be aware of it.

This didn't work, fwiw. I'm not blocked, I'll just toss this VM. Just thought I'd let you know

@ctz
Copy link

ctz commented Jan 23, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants