In the app-functions-sdk-go app-service-template, the code compiled successfully, but the startup error was reported #137
Closed
wangbing19
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My yaml file configuration:
TODO: Go here for detailed information on Application Service configuration:
https://docs.edgexfoundry.org/latest/microservices/application/GeneralAppServiceConfig/
Writable:
LogLevel: "INFO"
InsecureSecrets:
DB:
SecretName: "redisdb"
SecretData:
username: ""
password: ""
# TODO: Remove if not using HTTPS Webserver
# HTTPS:
# path: "https"
# Secrets:
# cert: ""
# key: ""
Telemetry:
Metrics: # All service's metric private configuration metrics must be listed here.
# TODO: Remove sample custom metric and implement meaningful custom metrics if any needed.
# Custom App Service Metrics
EventsConvertedToXML: true
Service:
Host: localhost
TODO: set this port appropriately,
App service use port assignments 597xx with lower range 00-39 reserved for
app-service-configurable profiles/instances, Rules Engine and examples
Port: 59740
StartupMsg: "app-new-service Application Service has started"
TODO: Remove section if not using HTTPS Webserver. Default protocol is HTTP if section is empty
HttpServer:
Protocol: "http"
SecretName: "https"
HTTPSCertName: "cert"
HTTPSKeyName: "key"
Clients:
core-data:
Protocol: "http"
Host: "localhost"
Port: 59880
core-metadata:
Protocol: "http"
Host: "localhost"
Port: 59881
#core-command:
# Protocol: "http"
# Host: "localhost"
# Port: 59882
# Choose to use new messaging based communication for Command Client.
# Only valid if MessageBus Trigger is used
# If prefer REST, remove below and uncomment above
#UseMessageBus: true
support-notifications:
Protocol: "http"
Host: "localhost"
Port: 59860
MessageBus:
Protocol: "redis"
Host: "localhost"
Port: 6379
Type: "redis"
AuthMode: "usernamepassword"
SecretName: "redisdb"
Disabled: false # TODO: set to true if not using edgex-messagebus Trigger below and don't want Metrics or Commands via MessageBus
Optional:
# Default MQTT Specific options that need to be here to enable environment variable overrides of them
ClientId: "app-new-service"
Trigger:
Note that the MessageBus connection above is used by edgex-messagebus trigger which is the default set in common config
Default value for SubscribeTopics is aslo set in common config
PublishTopic: "event-xml" # Base topic is prepened to this topic when using edgex-messagebus
TODO: Add custom settings needed by your app service or remove if you don't have any settings.
This can be any Key/Value pair you need.
For more details see: https://docs.edgexfoundry.org/latest/microservices/application/GeneralAppServiceConfig/#application-settings
Example that works with devices from the Virtual Device service:
ApplicationSettings:
DeviceNames: "Simple-Device01, Random-Boolean-Device, Random-Integer-Device, Random-UnsignedInteger-Device, Random-Float-Device, Random-Binary-Device, sample-numeric"
TODO: Replace this section with your actual structured custom configuration section
or remove if you don't have a need for structured custom configuration
This can be any structure you need, but it can not contain slices. Use a maps instead of slices.
For more details see: https://docs.edgexfoundry.org/latest/microservices/application/GeneralAppServiceConfig/#custom-configuration
AppCustom:
ResourceNames: "Boolean, Int32, Uint32, Float32, Binary, SwitchButton"
SomeValue: 123
SomeService:
Host: "localhost"
Port: 9080
Protocol: "http"
Startup error:
level=INFO ts=2023-07-06T07:34:13.759118444Z app=app-new-service source=service.go:490 msg="Starting app-new-service 0.0.0 "
level=INFO ts=2023-07-06T07:34:13.761249114Z app=app-new-service source=config.go:640 msg="Loading configuration file from res/configuration.yaml"
level=INFO ts=2023-07-06T07:34:13.767488246Z app=app-new-service source=config.go:226 msg="Private configuration loaded from file with 0 overrides applied"
level=INFO ts=2023-07-06T07:34:13.771318698Z app=app-new-service source=messaging.go:66 msg="Setting options for secure MessageBus with AuthMode='usernamepassword' and SecretName='redisdb"
level=INFO ts=2023-07-06T07:34:13.772131733Z app=app-new-service source=messaging.go:104 msg="Connected to redis Message Bus @ redis://192.168.1.124:6379 with AuthMode='usernamepassword'"
level=INFO ts=2023-07-06T07:34:13.772172168Z app=app-new-service source=clients.go:164 msg="Using REST for 'core-data' clients @ http://192.168.1.124:59880"
level=INFO ts=2023-07-06T07:34:13.772179529Z app=app-new-service source=clients.go:164 msg="Using REST for 'core-metadata' clients @ http://192.168.1.124:59881"
level=INFO ts=2023-07-06T07:34:13.772201563Z app=app-new-service source=clients.go:164 msg="Using REST for 'support-notifications' clients @ http://192.168.1.124:59860"
level=INFO ts=2023-07-06T07:34:13.792056857Z app=app-new-service source=metrics.go:64 msg="0 specified for metrics reporting interval. Setting to max duration to effectively disable reporting."
level=INFO ts=2023-07-06T07:34:13.792122201Z app=app-new-service source=manager.go:128 msg="Metrics Manager started with a report interval of 2562047h47m16.854775807s"
level=INFO ts=2023-07-06T07:34:13.792147349Z app=app-new-service source=bootstrap.go:251 msg="SecuritySecretsRequested metric registered and will be reported (if enabled)"
level=INFO ts=2023-07-06T07:34:13.79218643Z app=app-new-service source=bootstrap.go:251 msg="SecuritySecretsStored metric registered and will be reported (if enabled)"
level=ERROR ts=2023-07-06T07:34:13.792216112Z app=app-new-service source=factory.go:43 msg="App Service initialization failed: unable to parse Service.RequestTimeout configuration as a time duration: time: invalid duration """
I only modified the yaml file。
How can I solve this problem? In order to provide a complete configuration, you can subscribe to event messages in the MessageBus
Beta Was this translation helpful? Give feedback.
All reactions