Moode Forum
Unexpected error message popup: The image does not contain userid, etc. - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: Unexpected error message popup: The image does not contain userid, etc. (/showthread.php?tid=7332)



Unexpected error message popup: The image does not contain userid, etc. - hui13 - 01-21-2025

Hi,

I installed 9.2.1 a couple of days ago without any issues. Installed from fresh image using the Pi imager with userid, password, wifi and ssh setup. Running Moode on Pi-3B+, 1GB, library on SMB share. I have been using Moode since day one (just about) so this is not my first installation. 
For the past few years I have installed some software after initial setup to add functionality, most recently for HQPlayer and Tidal, as well as a PiJuice UPS. I only mention this to be thorough, since everything is running fine, almost. 
While I was installing Docker, I got the impression that the system hanged, as it appeared unresponsive and nothing seemed to be happening in the terminal app. In short, I grew impatient and restarted Moode. Not ideal but I had done this before without any apparent issues. After restart, I completed my installations and everything works fine, as usual and as expected. 
The only problem is, and this came as a surprise and is now just an annoyance, every time I change menu windows, I get a pop up message: Error: The image does not contain a userid .....

[attachment=4365]

Any way I can get rid of this without reinstalling from scratch? Like I mentioned everything is functioning correctly.

Thanks,

John


RE: Unexpected error message popup: The image does not contain userid, etc. - Tim Curtis - 01-21-2025

Here's the function in inc/common.php that would have assigned NO_USERID_DEFINED.  This will give you a way to determine which of the conditions may not have been met.

Code:
// Assumes only one dir under /home, the one matching the userid entered into
// the Raspberry Pi Imager when making the image.
function getUserID() {
    // Delete '/home/pi' if no corresponding userid exists. The homedir pi is
    // created by the moode-player package install during in-place update.
    if (file_exists('/home/pi/') && empty(sysCmd('grep ":/home/pi:" /etc/passwd'))) {
        sysCmd('cp /home/pi/.xinitrc /tmp/xinitrc');
        sysCmd('rm -rf /home/pi/');
    }
    // Return empty string if locked password for userid pi. A locked password
    // is from the pi-gen build and remains unless a userid is set in Pi Imager.
    if (sysCmd('cat /etc/shadow | grep pi | cut -d ":" -f 2')[0] == '!') {
        // No userid set in Pi Imager
        $userId = NO_USERID_DEFINED;
    } else {
        // Return userid or empty string if no subdirs under /home/
        $userId = sysCmd('ls /home/')[0];
        if (strpos($userId, 'ls: cannot access') !== false) {
            $userId = NO_USERID_DEFINED;
        }
    }

    // Install xinitrc script
    if ($userId != NO_USERID_DEFINED) {
        if (file_exists('/tmp/xinitrc')) {
            sysCmd('cp -f /tmp/xinitrc /home/' . $userId . '/.xinitrc');
        }
    }

    return $userId;
}



RE: Unexpected error message popup: The image does not contain userid, etc. - hui13 - 01-22-2025

Thanks for getting back to me so quickly.

I think that this may be beyond my skillset. I looked at what you sent, and to the best of my understanding everything looks fine. No pi subdirectory under home, only the one that I set. Looked at /etc/shadow file and pi not there, only my username, and password is not locked. Not sure if I missed something. The only wild guess that I can make is that I have a user called pijuice, and the beginning of its /etc/shadow entry looks like this: "pijuice:!:". Probably not this as I had the pijuice software running under Moode 8.*.* without any issues.

Let me know what you think. I might just live with it until I can't and then reinstall. Do not want to waste our precious time.


RE: Unexpected error message popup: The image does not contain userid, etc. - Tim Curtis - 01-22-2025

That could be it. Try the command below.
sudo cat /etc/shadow | grep pi | cut -d ":" -f 2

Moode 8 (a year old at this point) didn't have function getUserID().


RE: Unexpected error message popup: The image does not contain userid, etc. - hui13 - 01-22-2025

Yes, that is it. Thanks.

[attachment=4366]

Anything I can do about it?