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

Unable to Register Runner #6171

Closed
alacava opened this issue Jan 15, 2024 · 15 comments
Closed

Unable to Register Runner #6171

alacava opened this issue Jan 15, 2024 · 15 comments
Labels
Status: Waiting for answer Waiting issue author answer

Comments

@alacava
Copy link

alacava commented Jan 15, 2024

Describe the current behavior

When I try to register a runner I get:
Cannot register this PeerTube runner.
Error: This runner is not currently running in server mode on this system. Please run it using the server command first (in another terminal for example) and then retry your command.
at IPCClient.run (file:///usr/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:74058:15)
at async registerRunner (file:///usr/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:74826:3)
at async _Command. (file:///usr/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:89272:5)

On the peertube-runner server app side, I get:
peertube-runner server
[17:33:02.082] INFO (4730): Running PeerTube runner in server mode
[17:33:02.086] INFO (4730): Using /root/.config/peertube-runner-nodejs/default/config.toml as configuration file
[17:33:02.094] INFO (4730): IPC socket created on /root/.local/share/peertube-runner-nodejs/default/peertube-runner.sock
[17:33:02.095] INFO (4730): Using /root/.cache/peertube-runner-nodejs/default/transcoding for transcoding directory
[17:33:23.067] ERROR (4730): uncaughtException
origin: "uncaughtException"
err: {
"type": "TypeError",
"message": "Cannot read properties of undefined (reading 'data')",
"stack":
TypeError: Cannot read properties of undefined (reading 'data')
at Connection._untag (file:///usr/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:10508:38)
at Connection._read (file:///usr/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:10429:32)
at Connection.init (file:///usr/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:10895:16)
at Socket.emit (node:events:518:28)
at emitReadable
(node:internal/streams/readable:832:12)
at process.processTicksAndRejections (node:internal/process/task_queues:81:21)
}
[17:33:23.078] INFO (4730): Cleaning up after program exit

Steps to reproduce

  1. Followed docs page
  2. Run peertube-runner register --url https://xyz.com --registration-token ptrrt-xxx --runner-name peertube-runner
  3. Get error message

I'm seeing this problem on different runners and different peertube servers.

Describe the expected behavior

The peertube runner registers.

Additional information

  • PeerTube instance:

    • URL:
    • Version: 6.0.2
    • NodeJS version: 20.11.0
    • Ffmpeg version: 4.4.2-0ubuntu0.22.04.1
  • Browser name, version and platforms on which you could reproduce the bug: NA

  • Link to browser console log if relevant: NA

  • Link to server log if relevant (journalctl or /var/www/peertube/storage/logs/): See above.

@ROBERT-MCDOWELL
Copy link
Contributor

you should read the docs
https://docs.joinpeertube.org/maintain/tools

@alacava
Copy link
Author

alacava commented Jan 15, 2024

@ROBERT-MCDOWELL I did read the docs. I've had it working before so I know I have the right process down.

@ROBERT-MCDOWELL
Copy link
Contributor

so show your config and what commands you did

@Chocobozzz
Copy link
Owner

Hi,

Can you try to run the runner server with another user than root?

@Chocobozzz Chocobozzz added the Status: Waiting for answer Waiting issue author answer label Jan 16, 2024
@alacava
Copy link
Author

alacava commented Jan 16, 2024

Sure. Just ran it as ubuntu and got the same error.
ubuntu@ip-10-10-11-97:~$ peertube-runner server
[15:46:28.540] INFO (5222): Running PeerTube runner in server mode
[15:46:28.544] INFO (5222): Using /home/ubuntu/.config/peertube-runner-nodejs/default/config.toml as configuration file
[15:46:28.552] INFO (5222): IPC socket created on /home/ubuntu/.local/share/peertube-runner-nodejs/default/peertube-runner.sock
[15:46:28.553] INFO (5222): Using /home/ubuntu/.cache/peertube-runner-nodejs/default/transcoding for transcoding directory
[15:46:46.071] ERROR (5222): uncaughtException
origin: "uncaughtException"
err: {
"type": "TypeError",
"message": "Cannot read properties of undefined (reading 'data')",
"stack":
TypeError: Cannot read properties of undefined (reading 'data')
at Connection._untag (file:///usr/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:10508:38)
at Connection._read (file:///usr/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:10429:32)
at Connection.init (file:///usr/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:10895:16)
at Socket.emit (node:events:518:28)
at emitReadable
(node:internal/streams/readable:832:12)
at process.processTicksAndRejections (node:internal/process/task_queues:81:21)
}
[15:46:46.079] INFO (5222): Cleaning up after program exit

And this is the registration command I ran.
ubuntu@ip-10-10-11-97:~$ peertube-runner register --url (URL) --registration-token ptrrt-(token string) --runner-name peertube-runner
Cannot register this PeerTube runner.
Error: This runner is not currently running in server mode on this system. Please run it using the server command first (in another terminal for example) and then retry your command.
at IPCClient.run (file:///usr/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:74058:15)
at async registerRunner (file:///usr/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:74826:3)
at async _Command. (file:///usr/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:89272:5)

I also tried running the server as root and registering as non-root user, and visa versa. Same error.

@KuJoe
Copy link

KuJoe commented Jan 17, 2024

I'm in the same boat, attempts to register a remote runner are failing for me.

sudo -u prunner peertube-runner register --url https://mywebsite --registration-token ptrrt-key... --runner-name runner01
Cannot register this PeerTube runner.
unknown error

prunner[1160]: [00:01:34.100] ERROR (1160): uncaughtException
prunner[1160]: origin: "uncaughtException"
prunner[1160]: err: {
prunner[1160]: "type": "TypeError",
prunner[1160]: "message": "Cannot read properties of undefined (reading 'data')",
prunner[1160]: "stack":
prunner[1160]: TypeError: Cannot read properties of undefined (reading 'data')
prunner[1160]: at Connection._untag (file:///usr/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:10508:38)
prunner[1160]: at Connection._read (file:///usr/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:10429:32)
prunner[1160]: at Connection.init (file:///usr/lib/node_modules/@peertube/peertube-runner/dist/peertube-runner.js:10895:16)
prunner[1160]: at Socket.emit (node:events:518:28)
prunner[1160]: at emitReadable
(node:internal/streams/readable:832:12)
prunner[1160]: at process.processTicksAndRejections (node:internal/process/task_queues:81:21)
prunner[1160]: }
prunner[1160]: [00:01:34.107] INFO (1160): Cleaning up after program exit
prunner[1175]: [00:01:34.460] INFO (1175): Running PeerTube runner in server mode
prunner[1175]: [00:01:34.464] INFO (1175): Using /srv/prunner/.config/peertube-runner-nodejs/default/config.toml as configuration file
prunner[1175]: [00:01:34.470] INFO (1175): IPC socket created on /srv/prunner/.local/share/peertube-runner-nodejs/default/peertube-runner.sock
prunner[1175]: [00:01:34.471] INFO (1175): Using /srv/prunner/.cache/peertube-runner-nodejs/default/transcoding for transcoding directory
prunner[1175]: [00:01:35.630] ERROR (1175): uncaughtException

@Chocobozzz
Copy link
Owner

Chocobozzz commented Jan 17, 2024

@KuJoe & @alacava can you display the output of node -v?

Can you also display the output of ls /usr/lib/node_modules/ | grep msgpack and ls /usr/lib/node_modules/ | grep zlib?

@KuJoe
Copy link

KuJoe commented Jan 17, 2024

@KuJoe & @alacava can you display the output of node -v?

Can you also display the output of ls /usr/lib/node_modules/ | grep msgpack and ls /usr/lib/node_modules/ | grep zlib?

Here you go:

run01:~# node -v
v20.11.0
run01:~# ls /usr/lib/node_modules/ | grep msgpack
run01:~# ls /usr/lib/node_modules/ | grep zlib
run01:~#

@alacava
Copy link
Author

alacava commented Jan 17, 2024

@KuJoe & @alacava can you display the output of node -v?

Can you also display the output of ls /usr/lib/node_modules/ | grep msgpack and ls /usr/lib/node_modules/ | grep zlib?

Here you go as well
root@:~# node -v
v20.11.0
root@:~# ls /usr/lib/node_modules/ | grep msgpack
root@:~# ls /usr/lib/node_modules/ | grep zlib
root@:~# 

@KuJoe
Copy link

KuJoe commented Jan 18, 2024

I tried it with different versions of NodeJS on clean OS installs since it was something @alacava and I had in common without any luck. I'm running Ubuntu 22.04 but I'm going to give a different distro a try to see if that helps.

@KuJoe
Copy link

KuJoe commented Jan 18, 2024

It appears to be something specific to Ubuntu 22.04, I followed the guide using a clean install of AlmaLinux 9.3 and aside from a few minor extra steps it registered successfully.

run01 ~]$ peertube-runner register --url https://mysite --registration-token ptrrt-... --runner-name runner01
PeerTube instance registered

For completeness sake, here are all of the commands I ran:

dnf update
dnf install epel-release
dnf config-manager --set-enabled crb
dnf install --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm -y
dnf install --nogpgcheck https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-$(rpm -E %rhel).noarch.rpm -y
dnf install nodejs ffmpeg ffmpeg-devel
npm install -g @peertube/peertube-runner
useradd -m -d /srv/prunner -s /bin/bash -p prunner prunner
(Create /etc/systemd/system/prunner.service per the guide.)
systemctl daemon-reload
systemctl enable prunner.service
systemctl restart prunner.service
su - prunner
peertube-runner register --url https://mysite --registration-token ptrrt-... --runner-name runner01

@ROBERT-MCDOWELL
Copy link
Contributor

did you try to disable selinux?

@Chocobozzz
Copy link
Owner

Can someone give me access to your server so I can debug the issue? You can send me credentials by email (in my github profile)

@alacava
Copy link
Author

alacava commented Jan 18, 2024

Just emailed you the login for a test instance I setup that you can play with.

@Chocobozzz
Copy link
Owner

Thanks. I was able to debug the ipc code and found the issue is a change in node 20.11 that breaks the ipc library we use.

I created a PR on the ipc repository and published a fix available in peertube-runner 0.0.10

Chocobozzz added a commit that referenced this issue Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Waiting for answer Waiting issue author answer
Projects
None yet
Development

No branches or pull requests

4 participants