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-agent error does not show which file does not exist #3159

Open
reubenmiller opened this issue Oct 4, 2024 · 1 comment
Open

tedge-agent error does not show which file does not exist #3159

reubenmiller opened this issue Oct 4, 2024 · 1 comment
Labels
bug Something isn't working theme:troubleshooting Theme: Troubleshooting and remote control

Comments

@reubenmiller
Copy link
Contributor

Describe the bug

tedge-agent fails to start and shows an unhelpful log message which does not help the user to find out "which file does not exist".

Error: No such file or directory (os error 2)

Below shows how the tedge-agent service just exits and go into a restart loop.

Oct 04 16:04:30 rpi5-d83add9f145a systemd[1]: Started tedge-agent.service - tedge-agent is a thin-edge.io component to support operations..
Oct 04 16:04:30 rpi5-d83add9f145a tedge-agent[1923]: Error: No such file or directory (os error 2)
Oct 04 16:04:30 rpi5-d83add9f145a systemd[1]: tedge-agent.service: Main process exited, code=exited, status=1/FAILURE
Oct 04 16:04:30 rpi5-d83add9f145a systemd[1]: tedge-agent.service: Failed with result 'exit-code'.

Starting tedge-agent manually and setting the log level to DEBUG shows the which file does not exist.

RUST_LOG=debug tedge-agent
2024-10-04T15:05:58.018373645Z DEBUG tedge_config::tedge_config_cli::tedge_config_location: Loading configuration from "/etc/tedge/tedge.toml"
2024-10-04T15:05:58.018459551Z DEBUG mqtt_channel::config: Using CA certificate: /etc/step-ca/certs/root_ca.crt
Error: No such file or directory (os error 2)

To Reproduce

  1. Stop the tedge-agent service

    systemctl stop tedge-agent
    
  2. Set the mqtt.client.auth.ca_file to a path that does not exist

    tedge config set mqtt.client.auth.ca_file /etc/does/not/exist/root_ca.crt
  3. Start the tedge-agent service

    systemctl start tedge-agent
    

Expected behavior

It is ok that the tedge-agent fails on startup, however the error message should contain the path to the file that does not exist to allow the user to fix the configuration error.

Screenshots

Environment (please complete the following information):

Property Value
OS [incl. version] Debian GNU/Linux 12 (bookworm)
Hardware [incl. revision] Raspberry Pi 5 Model B Rev 1.0
System-Architecture Linux rpi5-d83add9f145a 6.6.31+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64 GNU/Linux
thin-edge.io version tedge 1.3.1

Additional context

@reubenmiller reubenmiller added the bug Something isn't working label Oct 4, 2024
@reubenmiller reubenmiller changed the title tedge-agent error does not show the which file does not exist tedge-agent error does not show which file does not exist Oct 7, 2024
@didier-wenzek
Copy link
Contributor

There is a similar issue with the mapper.

  • Start from a setting using the mosquitto bridge.
  • tedge config set mqtt.bridge.built_in true
  • Reconnect
  • The c8y mapper fails than to start, failing to read the device private key (owned by mosquitto), but also failing to tell which file cannot be accessed.
$ target/debug/tedge-mapper c8y      
2024-11-05T09:56:27.356954935Z  INFO Runtime: Started    
2024-11-05T09:56:27.357288837Z  INFO Runtime: Running Signal-Handler-0    
2024-11-05T09:56:27.357404648Z  INFO Runtime: Running HealthMonitorActor-1    
Error: Permission denied (os error 13)

@didier-wenzek didier-wenzek self-assigned this Nov 5, 2024
@didier-wenzek didier-wenzek added the theme:troubleshooting Theme: Troubleshooting and remote control label Nov 6, 2024
@didier-wenzek didier-wenzek removed their assignment Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working theme:troubleshooting Theme: Troubleshooting and remote control
Projects
None yet
Development

No branches or pull requests

2 participants