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

tedge connect c8y shows warnings about certificates when connect via basic auth credentials #3476

Open
reubenmiller opened this issue Mar 15, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@reubenmiller
Copy link
Contributor

reubenmiller commented Mar 15, 2025

Describe the bug

When connecting to Cumulocity using Basic Auth (e.g. tedge config set c8y.auth_method basic), the tedge connect c8y prints out unnecessary warnings about failing to change the ownership of the public and private certificate, which is unexpected as a device certificate is not needed when connecting via Basic Auth credentials.

Below shows the tedge connect c8y lines with the two WARN lines which should not be present when using basic auth.

root@tedge:~# tedge connect c8y
Connecting to Cumulocity with config:
        device id: rmi_test1001
        cloud profile: <none>
        cloud host: thin-edge-io.eu-latest.cumulocity.com:8883
        auth method: basic
        credentials path: /etc/tedge/credentials.toml
        bridge: mosquitto
        service manager: systemd
        mosquitto version: 2.0.11
Creating device in Cumulocity cloud... ✓
2025-03-15T09:04:20.14318654Z  WARN tedge::cli::connect::command: Failed to change ownership of /etc/tedge/device-certs/tedge-certificate.pem to mosquitto:mosquitto: The path is not accessible. "/etc/tedge/device-certs/tedge-certificate.pem"
2025-03-15T09:04:20.143328557Z  WARN tedge::cli::connect::command: Failed to change ownership of /etc/tedge/device-certs/tedge-private-key.pem to mosquitto:mosquitto: The path is not accessible. "/etc/tedge/device-certs/tedge-private-key.pem"
Restarting mosquitto... ✓
Waiting for mosquitto to be listening for connections... ✓
Verifying device is connected to cloud... ✓
Enabling tedge-mapper-c8y... ✓
Enabling tedge-agent... ✓

To Reproduce

  1. Configure thin-edge.io to use basic auth when connecting to Cumulocity

    sudo tedge config set c8y.auth_method basic
    cat <<EOT > "$(tedge config get c8y.credentials_path)"
    [c8y]
    username = "t12345/device_rmi_test1001"
    password = "<some_password>"
    EOT
    sudo tedge config set device.id rmi_test1001
  2. Connect to c8y

    sudo tedge connect c8y

Expected behavior

The following log messages should not be present in the output as it is expected that the certificate files do not exist when using basic auth.

2025-03-15T09:04:20.14318654Z  WARN tedge::cli::connect::command: Failed to change ownership of /etc/tedge/device-certs/tedge-certificate.pem to mosquitto:mosquitto: The path is not accessible. "/etc/tedge/device-certs/tedge-certificate.pem"
2025-03-15T09:04:20.143328557Z  WARN tedge::cli::connect::command: Failed to change ownership of /etc/tedge/device-certs/tedge-private-key.pem to mosquitto:mosquitto: The path is not accessible. "/etc/tedge/device-certs/tedge-private-key.pem"

Screenshots

Environment (please complete the following information):

Property Value
OS [incl. version] Debian GNU/Linux 12 (bookworm)
Hardware [incl. revision] unknown
System-Architecture Linux tedge 6.8.0-39-generic #39-Ubuntu SMP PREEMPT_DYNAMIC Sat Jul 6 02:50:39 UTC 2024 aarch64 GNU/Linux
thin-edge.io version tedge 1.4.3~266+gf4ee98b

Additional context

@reubenmiller reubenmiller added the bug Something isn't working label Mar 15, 2025
@Ruadhri17 Ruadhri17 self-assigned this Mar 17, 2025
@Ruadhri17 Ruadhri17 removed their assignment Mar 24, 2025
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

No branches or pull requests

2 participants