Plexamp install error on rpi wrong ELF class: ELFCLASS64

I’m using lts node installed with asdf, I tried with the raspian node version as well and ended up with same issue

pi@raspberrypi:~/plexamp $ node --version
v16.15.1
pi@raspberrypi:~/plexamp $ node js/index.js 
node:internal/modules/cjs/loader:1189
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: /home/pi/plexamp/treble/treble.node: wrong ELF class: ELFCLASS64
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1189:18)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.41673 (/home/pi/plexamp/js/index.js:2:332509)
    at a (/home/pi/plexamp/js/index.js:2:2015750)
    at Object.65631 (/home/pi/plexamp/js/index.js:2:327124)
    at a (/home/pi/plexamp/js/index.js:2:2015750)
    at Object.10546 (/home/pi/plexamp/js/index.js:2:316525) {
  code: 'ERR_DLOPEN_FAILED'
}

edit, adding uname info, seems like a 32/64 bit issue

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 5.4.83-v7+ #1379 SMP Mon Dec 14 13:08:57 GMT 2020 armv7l GNU/Linux
pi@raspberrypi:~ $ sudo lshw
raspberrypi                 
    description: ARMv7 Processor rev 4 (v7l)
    product: Raspberry Pi 3 Model B Plus Rev 1.3
    serial: 00000000a1dfd957
    width: 32 bits
    capabilities: smp
  *-core
       description: Motherboard
       physical id: 0
     *-cpu:0
          description: CPU
          product: cpu
          physical id: 0
          bus info: cpu@0
          size: 1400MHz
          capacity: 1400MHz
          capabilities: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 cpufreq
     *-cpu:1
          description: CPU
          product: cpu
          physical id: 1
          bus info: cpu@1
          size: 1400MHz
          capacity: 1400MHz
          capabilities: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 cpufreq
     *-cpu:2
          description: CPU
          product: cpu
          physical id: 2
          bus info: cpu@2
          size: 1400MHz
          capacity: 1400MHz
          capabilities: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 cpufreq
     *-cpu:3
          description: CPU
          product: cpu
          physical id: 3
          bus info: cpu@3
          size: 1400MHz
          capacity: 1400MHz
          capabilities: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 cpufreq
     *-memory
          description: System memory
          physical id: 4
          size: 924MiB
  *-usbhost
       product: DWC OTG Controller
       vendor: Linux 5.4.83-v7+ dwc_otg_hcd
       physical id: 1
       bus info: usb@1
       logical name: usb1
       version: 5.04
       capabilities: usb-2.00
       configuration: driver=hub slots=1 speed=480Mbit/s
     *-usb
          description: USB hub
          product: USB 2.0 Hub
          vendor: Standard Microsystems Corp.
          physical id: 1
          bus info: usb@1:1
          version: b.b3
          capabilities: usb-2.00
          configuration: driver=hub maxpower=2mA slots=4 speed=480Mbit/s
        *-usb
             description: USB hub
             product: USB 2.0 Hub
             vendor: Standard Microsystems Corp.
             physical id: 1
             bus info: usb@1:1.1
             version: b.b3
             capabilities: usb-2.00
             configuration: driver=hub maxpower=2mA slots=3 speed=480Mbit/s
           *-usb
                description: Ethernet interface
                vendor: Standard Microsystems Corp.
                physical id: 1
                bus info: usb@1:1.1.1
                logical name: eth0
                version: 3.00
                serial: b8:27:eb:df:d9:57
                size: 1Gbit/s
                capacity: 1Gbit/s
                capabilities: usb-2.10 ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
                configuration: autonegotiation=on broadcast=yes driver=lan78xx duplex=full ip=192.168.1.13 link=yes maxpower=2mA multicast=yes port=MII speed=1Gbit/s
  *-network DISABLED
       description: Wireless interface
       physical id: 2
       logical name: wlan0
       serial: b8:27:eb:8a:8c:02
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=brcmfmac driverversion=7.45.229 firmware=01-2dbd9d2e multicast=yes wireless=IEEE 802.11

Try again with a 64Bit Linux for your Pi. (Operating system images – Raspberry Pi)
ELF class issues are likely happening due to running 64bit software on a 32bit os.

1 Like

also use node 12 which is the default with raspbian

ok now works fine on a 64 bit version, except that it is working only if started with the CLI

lotso@raspberrypi:~/plexamp $ node js/index.js

when I run it with my systemd service, as soon as I click on the rasperrypi link in plexamp to switch devices, the songs stops.

I recorded a movie that shows the behavior running from the cli then with
plexamp.tar.gz (6.4 MB)
a service :slight_smile:

on the movie the terminal is me ssh’ing in the rapsberry pi on the left, and plexamp running on my desktop on the right

I’m at a loss now since the service is exactly as if I was running the node command, I don’t get the difference, is there a way to get more logs ?

lotso@raspberrypi:~/plexamp $ cat /lib/systemd/system/plexamp.service 
[Unit]
Description=Plexamp
After=network.target

[Service]
Type=simple
User=lotso
WorkingDirectory=/home/lotso/plexamp
ExecStart=/usr/bin/node /home/lotso/plexamp/js/index.js
Restart=on-failure

[Install]
WantedBy=multi-user.target

I managed to reproduce the error seen in the movie above and have a log, can send it to whoever can look at it, I’d prefer not to post it here

Are you sure that you have node installed at /usr/bin/node?

Depending on how you installed it, it could be at a different location. When you are running it from the command line you are not specifying the full path so it could be anywhere that your user shell knows to look.

You can find out where it is located by typing which node on the command line.

1 Like

Yup I doubled checked that

lotso@raspberrypi:~ $ which node
/usr/bin/node

the log given by the service is exactly the same as the one provided running directly with the cli

lotso@raspberrypi:~ $ sudo systemctl start plexamp
lotso@raspberrypi:~ $ sudo systemctl status plexamp.service 
● plexamp.service - Plexamp
     Loaded: loaded (/lib/systemd/system/plexamp.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-06-03 19:31:39 CEST; 5s ago
   Main PID: 20000 (node)
      Tasks: 18 (limit: 780)
        CPU: 5.647s
     CGroup: /system.slice/plexamp.service
             └─20000 /usr/bin/node /home/lotso/plexamp/js/index.js

Jun 03 19:31:39 raspberrypi systemd[1]: Started Plexamp.
Jun 03 19:31:41 raspberrypi node[20000]: Starting Plexamp.
Jun 03 19:31:41 raspberrypi node[20000]: DEVICE: No provider for source f9f28887dd21937857764bed5595ac68518e2577

Use the bash-installer, and you should be good!
Also, do not run it as a global service, run it as a user-service, that is what the installer-script does!

ok very interesting, and thanks for getting me on track @odinb1 , moving the service as a user fixed it for me, I was originaly putting it as a system service reading Plexamp on the Raspberry Pi

I’d be interested to get why it works this way and fails the other though, but I’m happy now :slight_smile:

Yeah, it failed for me also on the initial betas, but then when I ran it as a user-service, it worked! Since it is a user-application this makes sense to also run it as that user!

I was having trouble getting the service to restart on reboot, this appears to have solved the problem. Thanks pjv!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.