TypeError: Cannot read property 'version' of undefined #56

Open
opened 2021-12-19 08:59:12 +00:00 by Ghost · 1 comment

System: Raspberry Pi 3b+
OS: "Debian GNU/Linux 11 (bullseye)"

 π ~ ❯ curl https://get.telebit.io/ | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2126  100  2126    0     0    577      0  0:00:03  0:00:03 --:--:--   577

Installing Telebit Remote to '/home/norman/Applications/telebit'
..........Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using --machine=<user>@.host --user to connect to bus of other user)
libpam-systemd is missing, which is required on Linux to register Telebit with the user launcher.
sudo apt-get install -y libpam-systemd
[sudo] password for norman: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libpam-systemd is already the newest version (247.3-6).
The following packages were automatically installed and are no longer required:
  libayatana-appindicator3-1 libayatana-ido3-0.4-0 libayatana-indicator3-7 libdbusmenu-glib4 libdbusmenu-gtk3-4
  libgdk-pixbuf-xlib-2.0-0 libgdk-pixbuf2.0-0 libminiupnpc17 libnatpmp1 transmission-common transmission-gtk
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.
.
/home/norman/Applications/telebit/bin/telebit-remote.js:643
  var verstrd = [ pkg.name + ' daemon v' + state.config.version ];
                                                        ^

TypeError: Cannot read property 'version' of undefined
    at handleConfig (/home/norman/Applications/telebit/bin/telebit-remote.js:643:57)
    at /home/norman/Applications/telebit/bin/telebit-remote.js:359:22
    at /home/norman/Applications/telebit/usr/share/install-launcher.js:236:24
    at ChildProcess.exithandler (child_process.js:296:5)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Socket.stream.socket.on (internal/child_process.js:381:11)
    at Socket.emit (events.js:182:13)
    at Pipe._handle.close (net.js:606:12)

Possible solution: Not sure but it seems like a bug in the config variable data structure, which is being passed to handleConfig.

639 function handleConfig(err, config) {
640   //console.log('CONFIG');                   
641   //console.log(config);                              
642   state.config = config;
643   var verstrd = [ pkg.name + ' daemon v' + state.config.version ];
644   if (state.config.version && state.config.version !== pkg.version) {
645     console.info(verstr.join(' '), verstrd.join(' '));
646   } else {            
647     console.info(verstr.join(' '));              
648   }                                            
649                 

I had tried manually hardcoding it, which could have worked but then I didn't knew on how to start it on our own.

System: Raspberry Pi 3b+ OS: "Debian GNU/Linux 11 (bullseye)" ``` π ~ ❯ curl https://get.telebit.io/ | bash % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2126 100 2126 0 0 577 0 0:00:03 0:00:03 --:--:-- 577 Installing Telebit Remote to '/home/norman/Applications/telebit' ..........Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using --machine=<user>@.host --user to connect to bus of other user) libpam-systemd is missing, which is required on Linux to register Telebit with the user launcher. sudo apt-get install -y libpam-systemd [sudo] password for norman: Reading package lists... Done Building dependency tree... Done Reading state information... Done libpam-systemd is already the newest version (247.3-6). The following packages were automatically installed and are no longer required: libayatana-appindicator3-1 libayatana-ido3-0.4-0 libayatana-indicator3-7 libdbusmenu-glib4 libdbusmenu-gtk3-4 libgdk-pixbuf-xlib-2.0-0 libgdk-pixbuf2.0-0 libminiupnpc17 libnatpmp1 transmission-common transmission-gtk Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded. . /home/norman/Applications/telebit/bin/telebit-remote.js:643 var verstrd = [ pkg.name + ' daemon v' + state.config.version ]; ^ TypeError: Cannot read property 'version' of undefined at handleConfig (/home/norman/Applications/telebit/bin/telebit-remote.js:643:57) at /home/norman/Applications/telebit/bin/telebit-remote.js:359:22 at /home/norman/Applications/telebit/usr/share/install-launcher.js:236:24 at ChildProcess.exithandler (child_process.js:296:5) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:962:16) at Socket.stream.socket.on (internal/child_process.js:381:11) at Socket.emit (events.js:182:13) at Pipe._handle.close (net.js:606:12) ``` Possible solution: Not sure but it seems like a bug in the config variable data structure, which is being passed to handleConfig. ``` 639 function handleConfig(err, config) { 640 //console.log('CONFIG'); 641 //console.log(config); 642 state.config = config; 643 var verstrd = [ pkg.name + ' daemon v' + state.config.version ]; 644 if (state.config.version && state.config.version !== pkg.version) { 645 console.info(verstr.join(' '), verstrd.join(' ')); 646 } else { 647 console.info(verstr.join(' ')); 648 } 649 ``` I had tried manually hardcoding it, which could have worked but then I didn't knew on how to start it on our own.
Author

end of 2022, this is still happening

OS: Debian WSL

dzek@dzek-dell:~/tmp$ curl https://get.telebit.io/ | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2126  100  2126    0     0  10524      0 --:--:-- --:--:-- --:--:-- 10524

Installing Telebit Remote to '/home/dzek/Applications/telebit'
...........Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using --machine=<user>@.host --user to connect to bus of other user)
libpam-systemd is missing, which is required on Linux to register Telebit with the user launcher.
sudo apt-get install -y libpam-systemd
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libsystemd0 systemd systemd-timesyncd
Suggested packages:
  systemd-container
The following packages will be upgraded:
  libpam-systemd libsystemd0 systemd systemd-timesyncd
4 upgraded, 0 newly installed, 0 to remove and 50 not upgraded.
Need to get 5,291 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 systemd-timesyncd amd64 247.3-7+deb11u1 [131 kB]
Get:2 http://deb.debian.org/debian bullseye/main amd64 libpam-systemd amd64 247.3-7+deb11u1 [283 kB]
Get:3 http://deb.debian.org/debian bullseye/main amd64 systemd amd64 247.3-7+deb11u1 [4,501 kB]
Get:4 http://deb.debian.org/debian bullseye/main amd64 libsystemd0 amd64 247.3-7+deb11u1 [376 kB]
Fetched 5,291 kB in 0s (12.2 MB/s)
(Reading database ... 73497 files and directories currently installed.)
Preparing to unpack .../systemd-timesyncd_247.3-7+deb11u1_amd64.deb ...
Unpacking systemd-timesyncd (247.3-7+deb11u1) over (247.3-7) ...
Preparing to unpack .../libpam-systemd_247.3-7+deb11u1_amd64.deb ...
Unpacking libpam-systemd:amd64 (247.3-7+deb11u1) over (247.3-7) ...
Preparing to unpack .../systemd_247.3-7+deb11u1_amd64.deb ...
Unpacking systemd (247.3-7+deb11u1) over (247.3-7) ...
Preparing to unpack .../libsystemd0_247.3-7+deb11u1_amd64.deb ...
Unpacking libsystemd0:amd64 (247.3-7+deb11u1) over (247.3-7) ...
Setting up libsystemd0:amd64 (247.3-7+deb11u1) ...
Setting up systemd (247.3-7+deb11u1) ...
Setting up systemd-timesyncd (247.3-7+deb11u1) ...
Setting up libpam-systemd:amd64 (247.3-7+deb11u1) ...
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for dbus (1.12.20-2) ...
Processing triggers for libc-bin (2.31-13+deb11u3) ...
.
/home/dzek/Applications/telebit/bin/telebit-remote.js:643
  var verstrd = [ pkg.name + ' daemon v' + state.config.version ];
                                                        ^

TypeError: Cannot read property 'version' of undefined
    at handleConfig (/home/dzek/Applications/telebit/bin/telebit-remote.js:643:57)
    at /home/dzek/Applications/telebit/bin/telebit-remote.js:359:22
    at /home/dzek/Applications/telebit/usr/share/install-launcher.js:236:24
    at ChildProcess.exithandler (child_process.js:296:5)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Socket.stream.socket.on (internal/child_process.js:381:11)
    at Socket.emit (events.js:182:13)
    at Pipe._handle.close (net.js:606:12)
dzek@dzek-dell:~/tmp$ ~/App
Applications/ Apps/
dzek@dzek-dell:~/tmp$ ~/Applications/telebit/
bin/          etc/          examples/     include/      lib/          node_modules/ tests/        usr/          var/
dzek@dzek-dell:~/tmp$ ~/Applications/telebit/bin/
node               npm                npx                telebit            telebitd           telebitd.js        telebit.js         telebit-remote.js  telebit_uninstall
dzek@dzek-dell:~/tmp$ ~/Applications/telebit/bin/telebit http 4200
/home/dzek/Applications/telebit/bin/telebit-remote.js:643
  var verstrd = [ pkg.name + ' daemon v' + state.config.version ];
                                                        ^

TypeError: Cannot read property 'version' of undefined
    at handleConfig (/home/dzek/Applications/telebit/bin/telebit-remote.js:643:57)
    at /home/dzek/Applications/telebit/bin/telebit-remote.js:359:22
    at /home/dzek/Applications/telebit/usr/share/install-launcher.js:236:24
    at ChildProcess.exithandler (child_process.js:296:5)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
end of 2022, this is still happening OS: Debian WSL ``` dzek@dzek-dell:~/tmp$ curl https://get.telebit.io/ | bash % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2126 100 2126 0 0 10524 0 --:--:-- --:--:-- --:--:-- 10524 Installing Telebit Remote to '/home/dzek/Applications/telebit' ...........Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using --machine=<user>@.host --user to connect to bus of other user) libpam-systemd is missing, which is required on Linux to register Telebit with the user launcher. sudo apt-get install -y libpam-systemd Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: libsystemd0 systemd systemd-timesyncd Suggested packages: systemd-container The following packages will be upgraded: libpam-systemd libsystemd0 systemd systemd-timesyncd 4 upgraded, 0 newly installed, 0 to remove and 50 not upgraded. Need to get 5,291 kB of archives. After this operation, 0 B of additional disk space will be used. Get:1 http://deb.debian.org/debian bullseye/main amd64 systemd-timesyncd amd64 247.3-7+deb11u1 [131 kB] Get:2 http://deb.debian.org/debian bullseye/main amd64 libpam-systemd amd64 247.3-7+deb11u1 [283 kB] Get:3 http://deb.debian.org/debian bullseye/main amd64 systemd amd64 247.3-7+deb11u1 [4,501 kB] Get:4 http://deb.debian.org/debian bullseye/main amd64 libsystemd0 amd64 247.3-7+deb11u1 [376 kB] Fetched 5,291 kB in 0s (12.2 MB/s) (Reading database ... 73497 files and directories currently installed.) Preparing to unpack .../systemd-timesyncd_247.3-7+deb11u1_amd64.deb ... Unpacking systemd-timesyncd (247.3-7+deb11u1) over (247.3-7) ... Preparing to unpack .../libpam-systemd_247.3-7+deb11u1_amd64.deb ... Unpacking libpam-systemd:amd64 (247.3-7+deb11u1) over (247.3-7) ... Preparing to unpack .../systemd_247.3-7+deb11u1_amd64.deb ... Unpacking systemd (247.3-7+deb11u1) over (247.3-7) ... Preparing to unpack .../libsystemd0_247.3-7+deb11u1_amd64.deb ... Unpacking libsystemd0:amd64 (247.3-7+deb11u1) over (247.3-7) ... Setting up libsystemd0:amd64 (247.3-7+deb11u1) ... Setting up systemd (247.3-7+deb11u1) ... Setting up systemd-timesyncd (247.3-7+deb11u1) ... Setting up libpam-systemd:amd64 (247.3-7+deb11u1) ... Processing triggers for man-db (2.9.4-2) ... Processing triggers for dbus (1.12.20-2) ... Processing triggers for libc-bin (2.31-13+deb11u3) ... . /home/dzek/Applications/telebit/bin/telebit-remote.js:643 var verstrd = [ pkg.name + ' daemon v' + state.config.version ]; ^ TypeError: Cannot read property 'version' of undefined at handleConfig (/home/dzek/Applications/telebit/bin/telebit-remote.js:643:57) at /home/dzek/Applications/telebit/bin/telebit-remote.js:359:22 at /home/dzek/Applications/telebit/usr/share/install-launcher.js:236:24 at ChildProcess.exithandler (child_process.js:296:5) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:962:16) at Socket.stream.socket.on (internal/child_process.js:381:11) at Socket.emit (events.js:182:13) at Pipe._handle.close (net.js:606:12) dzek@dzek-dell:~/tmp$ ~/App Applications/ Apps/ dzek@dzek-dell:~/tmp$ ~/Applications/telebit/ bin/ etc/ examples/ include/ lib/ node_modules/ tests/ usr/ var/ dzek@dzek-dell:~/tmp$ ~/Applications/telebit/bin/ node npm npx telebit telebitd telebitd.js telebit.js telebit-remote.js telebit_uninstall dzek@dzek-dell:~/tmp$ ~/Applications/telebit/bin/telebit http 4200 /home/dzek/Applications/telebit/bin/telebit-remote.js:643 var verstrd = [ pkg.name + ' daemon v' + state.config.version ]; ^ TypeError: Cannot read property 'version' of undefined at handleConfig (/home/dzek/Applications/telebit/bin/telebit-remote.js:643:57) at /home/dzek/Applications/telebit/bin/telebit-remote.js:359:22 at /home/dzek/Applications/telebit/usr/share/install-launcher.js:236:24 at ChildProcess.exithandler (child_process.js:296:5) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:962:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5) ```
Sign in to join this conversation.
No Label
feature
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coolaj86/telebit.js#56
No description provided.