Skip to content
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

Incorrect device-bacnet service key #397

Closed
FelixTing opened this issue Jul 24, 2023 · 2 comments · Fixed by #398
Closed

Incorrect device-bacnet service key #397

FelixTing opened this issue Jul 24, 2023 · 2 comments · Fixed by #398
Labels
bug Something isn't working
Milestone

Comments

@FelixTing
Copy link
Member

🐞 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.

ifeq (ds-bacnet, $(filter ds-bacnet,$(ARGS)))
COMPOSE_FILES:=$(COMPOSE_FILES) -f add-device-bacnet.yml
ifneq (no-secty, $(filter no-secty,$(ARGS)))
ifeq ($(TOKEN_LIST),)
TOKEN_LIST:=device-bacnet
else
TOKEN_LIST:=$(TOKEN_LIST),device-bacnet
endif
ifeq ($(KNOWN_SECRETS_LIST),)
KNOWN_SECRETS_LIST:=redisdb[device-bacnet],message-bus[device-bacnet]
else
KNOWN_SECRETS_LIST:=$(KNOWN_SECRETS_LIST),redisdb[device-bacnet],message-bus[device-bacnet]
endif
extension_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_secure_compose_ext.sh device-bacnet device-bacnet device-bacnet-ip/device-bacnet-c " -cp=consul://edgex-core-consul:8500 --registry")
COMPOSE_FILES:=$(COMPOSE_FILES) -f $(extension_file)
# add runtime token config for delayed-start if specified
ifeq (delayed-start, $(filter delayed-start,$(ARGS)))
ext_file:= $(shell GEN_EXT_DIR="$(GEN_EXT_DIR)" ./gen_runtime_token_config_compose_ext.sh device-bacnet)
COMPOSE_FILES:=$(COMPOSE_FILES) -f $(ext_file)
endif
endif
endif

This results in the device service being unable to locate the required SecretStore token, Consul token, and MessageBus credentials.

related issue: edgexfoundry/device-bacnet-c#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?

@FelixTing FelixTing added the bug Something isn't working label Jul 24, 2023
@lenny-goodell lenny-goodell added this to the Minnesota milestone Jul 24, 2023
@github-project-automation github-project-automation bot moved this to New Issues in Technical WG Jul 24, 2023
@lenny-goodell lenny-goodell moved this from New Issues to In Progress in Technical WG Jul 24, 2023
@lenny-goodell lenny-goodell moved this from In Progress to QA/Code Review in Technical WG Jul 24, 2023
@bnevis-i
Copy link
Collaborator

  • 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).
  • Also we don't mount /tmp/edgex/secrets/device-bacnet-ip to the container

@lenny-goodell
Copy link
Member

  • 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants