Skip to content

tedge --init fails on fedora linux iot 38 due to mosquitto user false negative #2042

Open
@reubenmiller

Description

@reubenmiller

Describe the bug

Initializing tedge manually via tedge --init fails due to the following reason:

User not found: "mosquitto".

However the user does exist as trying to create it manually produces the following error message from useradd:

useradd mosquitto
useradd: user 'mosquitto' already exists

The user can also be verified to exist by checking the id <username> command:

id mosquitto
uid=979(mosquitto) gid=979(mosquitto) groups=979(mosquitto)

To Reproduce

  1. Setup a device running Fedora IoT 38

  2. Install mosquitto (and then reboot as the packages will only be available after a reboot due to the way rpm-ostree works)

    rpm-ostree install mosquitto --reboot
  3. Download the tarball for the relavant cpu (in this case it was for aarch64)

    curl -L https://github.com/thin-edge/thin-edge.io/releases/download/0.11.0/tedge_0.11.0_aarch64-unknown-linux-musl.tar.gz -O
  4. Expand downloaded tarball (extracting the thin-edge.io binaries)

    tar xvzf tedge_0.11.0_aarch64-unknown-linux-musl.tar.gz
  5. Create the tedge user

    useradd tedge
  6. Try to initialize tedge (running as root) (assuming you are in the folder where you downloaded and extracted the thin-edge.io tarball)

    ./tedge --init

Expected behavior

The tedge --init command should initialize successfully without an error (when the mosquitto package and user is installed).

Screenshots

The following is the log showing the error message when running the command as root.

[root@lumber ~]# ./tedge --version
tedge 0.11.0
[root@lumber ~]# ./tedge --init
Error: Failed to initialize tedge. You have to run tedge with sudo.

Caused by:
    User not found: "mosquitto".
[root@lumber ~]# id mosquitto
uid=979(mosquitto) gid=979(mosquitto) groups=979(mosquitto)
[root@lumber ~]# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
jack:x:1000:1000::/var/home/jack:/bin/bash
tedge:x:1001:1001::/var/home/tedge:/bin/bash

Environment (please complete the following information):

  • OS [incl. version]: Fedora Linux 38.20230419.2 (IoT Edition)
  • Hardware [incl. revision]: Raspberry Pi 4
  • System-Architecture [e.g. result of "uname -a"]: Linux lumber 6.2.9-300.fc38.aarch64 1 SMP PREEMPT_DYNAMIC Thu Mar 30 22:53:50 UTC 2023 aarch64 GNU/Linux
  • thin-edge.io version [e.g. 0.1.0]: 0.11.0

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions