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

feat: use a better error handling logic and messages when run in hybrid mode with no common config #4617

Conversation

jim-wang-intel
Copy link
Contributor

@jim-wang-intel jim-wang-intel commented Jul 25, 2023

Closes: #4615

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/edgex-go/blob/main/.github/Contributing.md

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)

Testing Instructions

  • git clone this PR
  • build all services: make build
  • make sure your EdgeX stack is running insecure mode from edgex-compose/compose-builder: make run no-secty
  • and then you would need to stop the service to test from the stack, like for example docker stop edgex-core-data
  • to see the better error message and handling, you can start with core-data: change directory to cmd/core-data
  • run the core-data in hybrid mode without any common config: ./core-data, and you should see some better error messages with suggestion like missing common conifg? Use -cc or -cp flags from the command line.
  • add the missing elements or properties in configuration.yaml /res to observe it going through the next issue and better error messages. You would need to repeat this process until the service is starting up and running.
  • the services been tested are:
    1. all the EdgeX core services: core-command, core-data, core-metadata
    2. EdgeX support services: support-scheduler, support-notifications
    3. security services: security-proxy-auth, security-spiffe-token-provider

changed configuration yaml example for core-data:

MaxEventSize: 25000 # Defines the maximum event size in kilobytes
Writable:
  InsecureSecrets:
    DB:
      path: "redisdb"
      Secrets:
        username: ""
        password: ""
      SecretName: "redisdb"
      SecretData:
        username: ""
        password: ""
  LogLevel: "INFO"
  PersistData: true
  Telemetry:
    Metrics: # All service's metric names must be present in this list.
      EventsPersisted: false
      ReadingsPersisted: false
#    Tags: # Contains the service level tags to be attached to all the service's metrics
    ##    Gateway="my-iot-gateway" # Tag must be added here or via Consul Env Override can only change existing value, not added new ones.
Service:
  Port: 59880
  Host: "localhost"
  StartupMsg: "This is the Core Data Microservice"
  RequestTimeout: "5s"

MessageBus:
  Optional:
    ClientId: "core-data"
  Protocol: "redis"
  Host: "localhost"
  Port: 6379
  Type: "redis"

Database:
  Name: "coredata"
  Host: "localhost"
  Port: 6379
  Timeout: "10s"
  Type: "redisdb"

New Dependency Instructions (If applicable)

@jim-wang-intel jim-wang-intel added the tech-debt issue_type denoting refactoring to improve design or removal of temporary workarounds label Jul 25, 2023
@jim-wang-intel jim-wang-intel self-assigned this Jul 25, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@lenny-goodell lenny-goodell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lenny-goodell lenny-goodell merged commit e9743d5 into edgexfoundry:main Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech-debt issue_type denoting refactoring to improve design or removal of temporary workarounds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add better error handling when run in hybrid mode with common Config being missing for services
2 participants