envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
24.71k stars 4.75k forks source link

Homebrew Installed Envoy Working, Built Envoy Not Working #35782

Open harrisonlhl123 opened 3 weeks ago

harrisonlhl123 commented 3 weeks ago

I have two versions of Envoy on my Mac. The first version is installed through homebrew by running the command brew install envoy. Here's the version: envoy version: 816188b86a0a52095b116b107f576324082c7c02/1.30.1/Distribution/RELEASE/BoringSSL

The second version I built manually following the macOS Build Flow of installing xCode, running ci/mac_ci_setup.sh, and running ci/mac_ci_steps.sh. I used version 1.30.1 of envoy just to match homebrew's version.

When I run the homebrew version, it works fine and here's the logs:

[2024-08-20 13:50:55.843][4628925][info][config] [source/server/configuration_impl.cc:168] loading tracing configuration
[2024-08-20 13:50:55.843][4628925][info][config] [source/server/configuration_impl.cc:124] loading 2 static secret(s)
[2024-08-20 13:50:55.843][4628925][info][config] [source/server/configuration_impl.cc:130] loading 1 cluster(s)
[2024-08-20 13:50:55.846][4628925][info][config] [source/server/configuration_impl.cc:138] loading 0 listener(s)
[2024-08-20 13:50:55.846][4628925][info][config] [source/server/configuration_impl.cc:154] loading stats configuration

When I run the manually built version, the logs get repeated twice which leads to a duplicate error:

[2024-08-20 17:31:27.424][5196115][info][config] [source/server/configuration_impl.cc:168] loading tracing configuration
[2024-08-20 17:31:27.424][5196115][info][config] [source/server/configuration_impl.cc:124] loading 2 static secret(s)
[2024-08-20 17:31:27.424][5196115][info][config] [source/server/configuration_impl.cc:130] loading 1 cluster(s)
[2024-08-20 17:31:27.425][5196115][info][config] [source/server/configuration_impl.cc:168] loading tracing configuration
[2024-08-20 17:31:27.425][5196115][info][config] [source/server/configuration_impl.cc:124] loading 2 static secret(s)
[2024-08-20 17:31:27.425][5196115][critical][main] [source/server/server.cc:414] error initializing config '/export/content/service_name/configs/envoy_bootstrap.yaml': Duplicate static TlsCertificate secret name upstream_cert

Here's the relevant snippet of the envoy_bootstrap.yaml file, upstream_cert just appears once in the entire file:

static_resources:
  secrets:
    - name: upstream_cert
      tls_certificate:
        certificate_chain:
          filename: /export/content/service_name/var/identity.cert
        private_key:
          filename: /export/content/service_name/var/identity.key
    - name: validation_context
      validation_context:
        trusted_ca:
          filename: /etc/lipki/ca-bundle.crt

Any idea why this happens? I was able to successfully build and get the binary of the same version. So theoretically it should behave the same.

wbpcode commented 3 weeks ago

cc @botengyao