Skip to content

[bug] IMIX_CONFIG Environment Variable Export Issue #1725

@bri5ee

Description

@bri5ee

When building imix via an IMIX_CONFIG env var, the initial build works properly with env var such as the following:

export IMIX_CONFIG='
transports:
  - URI: "http://ip1:443"
    type: "grpc"
    interval: 60
    extra: ""
  - URI: "http://ip2:443"
    type: "grpc"
    interval: 60
    extra: ""
  - URI: "http://ip3:443"
    type: "grpc"
    interval: 60
    extra: ""
  - URI: "http://ip4:443"
    type: "grpc"
    interval: 60
    extra: ""
server_pubkey="<key>"

cargo build --bin imix --target=x86_64-unknown-linux-musl

Imix debug build shows it working as intended:

 2026-02-05T05:03:44.208Z INFO  imix::run > Starting imix agent
 2026-02-05T05:03:44.208Z INFO  imix      > beginning installation
 2026-02-05T05:03:44.208Z INFO  imix::run > Starting imix agent
 2026-02-05T05:03:44.210Z INFO  imix::run > Loaded config: Config {
    info: Some(
        Beacon {
            identifier: "dfcc516d-04af-41fb-b6a9-7748a247f36c",
            principal: "root",
            host: Some(
                Host {
                    identifier: "841562c8-98a9-49cb-9d8e-6028d2e9d589",
                    name: "ubuntu",
                    platform: Linux,
                    primary_ip: "ip",
                },
            ),
            agent: Some(
                Agent {
                    identifier: "imix-v0.3.2",
                },
            ),
            available_transports: Some(
                AvailableTransports {
                    transports: [
                        Transport {
                            uri: "http://ip1:443/",
                            interval: 60,
                            r#type: TransportGrpc,
                            extra: "",
                        },
                        Transport {
                            uri: "http://ip2:443/",
                            interval: 60,
                            r#type: TransportGrpc,
                            extra: "",
                        },
                        Transport {
                            uri: "http://ip3:443/",
                            interval: 60,
                            r#type: TransportGrpc,
                            extra: "",
                        },
                        Transport {
                            uri: "http://ip4:443/",
                            interval: 60,
                            r#type: TransportGrpc,
                            extra: "",
                        },

When running IMIX_CONFIG again with a new value populated into the environment variable, the original IMIX_CONFIG is still used on the new build despite a new value in the IMIX_CONFIG environment variable being used.

Building with new config:

export IMIX_CONFIG='
transports:
  - URI: "http://ip5:80"
    type: "grpc"
    interval: 300
    extra: ""
  - URI: "http://ip6:80"
    type: "grpc"
    interval: 300
    extra: ""
  - URI: "http://ip7:80"
    type: "grpc"
    interval: 300
    extra: ""
  - URI: "http://ip8:80"
    type: "grpc"
    interval: 300
    extra: ""

cargo build --bin imix --target=x86_64-unknown-linux-musl

Running the new build, we get the same config being used from the previous build and not the new IMIX_CONFIG environment variable:

    info: Some(
        Beacon {
            identifier: "dfcc516d-04af-41fb-b6a9-7748a247f36c",
            principal: "root",
            host: Some(
                Host {
                    identifier: "841562c8-98a9-49cb-9d8e-6028d2e9d589",
                    name: "ubuntu",
                    platform: Linux,
                    primary_ip: "ip",
                },
            ),
            agent: Some(
                Agent {
                    identifier: "imix-v0.3.2",
                },
            ),
            available_transports: Some(
                AvailableTransports {
                    transports: [
                        Transport {
                            uri: "http://ip1:443/",
                            interval: 60,
                            r#type: TransportGrpc,
                            extra: "",
                        },
                        Transport {
                            uri: "http://ip2:443/",
                            interval: 60,
                            r#type: TransportGrpc,
                            extra: "",
                        },
                        Transport {
                            uri: "http://ip3:443/",
                            interval: 60,
                            r#type: TransportGrpc,
                            extra: "",
                        },
                        Transport {
                            uri: "http://ip4:443/",
                            interval: 60,
                            r#type: TransportGrpc,
                            extra: "",
                        },

Temporary fix is to cargo clean && cargo run.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions