edgexfoundry / edgex-compose

EdgeX Foundry Docker Compose release compose files and tools for building EdgeX compose files
Apache License 2.0
82 stars 119 forks source link

Incorrect device-bacnet service key #397

Closed FelixTing closed 1 year ago

FelixTing commented 1 year ago

๐Ÿž Bug Report

Affected Services [REQUIRED]

The issue is located in: device-bacnet ### Is this a regression? Yes, the previous version in which this bug was not present was: .... ### Description and Minimal Reproduction [**REQUIRED**] In device-bacnet-c, service key is either `device-bacnet-ip` or `device-bacnet-mstp`. https://github.com/edgexfoundry/device-bacnet-c/blob/de54976e2d34757b5269fc827b494d0b9848b55d/src/c/main.c#L631-L644 However, the service key used in the compose-builder Makefile is device-bacnet. https://github.com/edgexfoundry/edgex-compose/blob/bf8c3022642096ec20f4ad6147e719a0404d0ccb/compose-builder/Makefile#L155-L177 This results in the device service being unable to locate the required SecretStore token, Consul token, and MessageBus credentials. related issue: https://github.com/edgexfoundry/device-bacnet-c/issues/74 ## ๐Ÿ”ฅ Exception or Error



Script for waiting on security bootstrapping ready-to-run Tue Apr 18 17:27:01 UTC 2023 Executing waitFor with /device-bacnet-ip/device-bacnet-c -cp=consul://edgex-core-consul:8500 --registry --confdir=/res waiting on tcp://edgex-security-bootstrapper:54329 level=INFO ts=2023-04-18T17:27:01.141639488Z app=security-bootstrapper source=config.go:611 msg="Loading configuration file from /edgex-init/res/configuration.yaml" level=INFO ts=2023-04-18T17:27:01.14252964Z app=security-bootstrapper source=variables.go:457 msg="Variables override of 'StageGate/WaitFor/Timeout' by environment variable: STAGEGATE_WAITFOR_TIMEOUT=60s" level=INFO ts=2023-04-18T17:27:01.142562653Z app=security-bootstrapper source=variables.go:457 msg="Variables override of 'StageGate/Registry/ReadyPort' by environment variable: STAGEGATE_REGISTRY_READYPORT=54324" level=INFO ts=2023-04-18T17:27:01.142572317Z app=security-bootstrapper source=variables.go:457 msg="Variables override of 'StageGate/Registry/Host' by environment variable: STAGEGATE_REGISTRY_HOST=edgex-core-consul" level=INFO ts=2023-04-18T17:27:01.142579478Z app=security-bootstrapper source=variables.go:457 msg="Variables override of 'StageGate/Ready/ToRunPort' by environment variable: STAGEGATE_READY_TORUNPORT=54329" level=INFO ts=2023-04-18T17:27:01.142584234Z app=security-bootstrapper source=variables.go:457 msg="Variables override of 'StageGate/Database/Port' by environment variable: STAGEGATE_DATABASE_PORT=6379" level=INFO ts=2023-04-18T17:27:01.142590169Z app=security-bootstrapper source=variables.go:457 msg="Variables override of 'StageGate/BootStrapper/StartPort' by environment variable: STAGEGATE_BOOTSTRAPPER_STARTPORT=54321" level=INFO ts=2023-04-18T17:27:01.142594197Z app=security-bootstrapper source=variables.go:457 msg="Variables override of 'StageGate/Database/Host' by environment variable: STAGEGATE_DATABASE_HOST=edgex-redis" level=INFO ts=2023-04-18T17:27:01.142598817Z app=security-bootstrapper source=variables.go:457 msg="Variables override of 'StageGate/SecretStoreSetup/Host' by environment variable: STAGEGATE_SECRETSTORESETUP_HOST=edgex-security-secretstore-setup" level=INFO ts=2023-04-18T17:27:01.142605613Z app=security-bootstrapper source=variables.go:457 msg="Variables override of 'StageGate/Database/ReadyPort' by environment variable: STAGEGATE_DATABASE_READYPORT=6379" level=INFO ts=2023-04-18T17:27:01.142609664Z app=security-bootstrapper source=variables.go:457 msg="Variables override of 'StageGate/BootStrapper/Host' by environment variable: STAGEGATE_BOOTSTRAPPER_HOST=edgex-security-bootstrapper" level=INFO ts=2023-04-18T17:27:01.142614138Z app=security-bootstrapper source=variables.go:457 msg="Variables override of 'SecretStore/Host' by environment variable: SECRETSTORE_HOST=edgex-vault" level=INFO ts=2023-04-18T17:27:01.142619463Z app=security-bootstrapper source=variables.go:457 msg="Variables override of 'StageGate/SecretStoreSetup/Tokens/ReadyPort' by environment variable: STAGEGATE_SECRETSTORESETUP_TOKENS_READYPORT=54322" level=INFO ts=2023-04-18T17:27:01.142624915Z app=security-bootstrapper source=variables.go:457 msg="Variables override of 'StageGate/Registry/Port' by environment variable: STAGEGATE_REGISTRY_PORT=8500" level=INFO ts=2023-04-18T17:27:01.142632472Z app=security-bootstrapper source=config.go:222 msg="Private configuration loaded from file with 13 overrides applied" level=INFO ts=2023-04-18T17:27:01.142911993Z app=security-bootstrapper source=command.go:119 msg="Security bootstrapper running waitFor" level=INFO ts=2023-04-18T17:27:01.142969236Z app=security-bootstrapper source=command.go:144 msg="Waiting for: [tcp://edgex-security-bootstrapper:54329] with timeout: [1m0s]" level=INFO ts=2023-04-18T17:27:01.145564832Z app=security-bootstrapper source=command.go:214 msg="Connected to tcp://edgex-security-bootstrapper:54329" Tue Apr 18 17:27:01 UTC 2023 Starting /device-bacnet-ip/device-bacnet-c -cp=consul://edgex-core-consul:8500 --registry --confdir=/res ... level=INFO ts=2023-04-18T17:27:01Z app=device-bacnet-ip msg="iot_threadpool_alloc (threads: 8 max_jobs: 0 default_priority: -1 affinity: -1)" level=INFO ts=2023-04-18T17:27:01Z app=device-bacnet-ip msg="iot_scheduler_alloc (priority: -1 affinity: -1)" level=INFO ts=2023-04-18T17:27:01Z app=device-bacnet-ip msg="Override config SecretStore/Host = edgex-vault" level=INFO ts=2023-04-18T17:27:01Z app=device-bacnet-ip msg="Override config Service/Host = edgex-device-bacnet" level=INFO ts=2023-04-18T17:27:01Z app=device-bacnet-ip msg="vault: scheduled token refresh in 1360 seconds" level=ERROR ts=2023-04-18T17:27:01Z app=device-bacnet-ip msg="vault: GET http://edgex-vault:8200/v1/consul/creds/device-bacnet-ip failed" level=ERROR ts=2023-04-18T17:27:01Z app=device-bacnet-ip msg="vault: no consul token found" level=INFO ts=2023-04-18T17:27:01Z app=device-bacnet-ip msg="Found registry service at consul://edgex-core-consul:8500" level=ERROR ts=2023-04-18T17:27:01Z app=device-bacnet-ip msg="vault: GET http://edgex-vault:8200/v1/consul/creds/device-bacnet-ip failed" level=ERROR ts=2023-04-18T17:27:01Z app=device-bacnet-ip msg="vault: no consul token found" level=INFO ts=2023-04-18T17:27:01Z app=device-bacnet-ip msg="Unable to get configuration from registry." level=INFO ts=2023-04-18T17:27:01Z app=device-bacnet-ip msg="Will load from file." level=INFO ts=2023-04-18T17:27:01Z app=device-bacnet-ip msg="Uploading configuration to registry." level=ERROR ts=2023-04-18T17:27:01Z app=device-bacnet-ip msg="vault: GET http://edgex-vault:8200/v1/consul/creds/device-bacnet-ip failed" level=ERROR ts=2023-04-18T17:27:01Z app=device-bacnet-ip msg="vault: no consul token found" level=ERROR ts=2023-04-18T17:27:01Z app=device-bacnet-ip msg="vault: GET http://edgex-vault:8200/v1/consul/creds/device-bacnet-ip failed" level=ERROR ts=2023-04-18T17:27:01Z app=device-bacnet-ip msg="vault: no consul token found" level=ERROR ts=2023-04-18T17:27:01Z app=device-bacnet-ip msg="Unable to upload config: HTTP 409 Conflict" Error: 17: HTTP 409 Conflict

๐ŸŒ Your Environment

Deployment Environment: ubuntu 22.04 LTS

EdgeX Version [REQUIRED]: minnesota dev

Anything else relevant?

bnevis-i commented 1 year ago
lenny-goodell commented 1 year ago
  • Also we don't create a device-bacnet-ip secret store token, nor a registry role, nor propagate the redis secret (not sure if that is needed).

Changes in this PR should take care of these: https://github.com/edgexfoundry/edgex-compose/pull/398/files

Also we don't mount /tmp/edgex/secrets/device-bacnet-ip to the container

Same but need to make sure it has -ip