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

tracker, private: true = error 403 on wss://host/tracker/socket #6603

Open
ClusterM opened this issue Sep 21, 2024 · 8 comments
Open

tracker, private: true = error 403 on wss://host/tracker/socket #6603

ClusterM opened this issue Sep 21, 2024 · 8 comments
Labels
Status: Waiting for answer Waiting issue author answer

Comments

@ClusterM
Copy link

ClusterM commented Sep 21, 2024

Describe the current behavior

Tried versions 6.2.1 and 6.3.0 with the same result. Using tracker in private mode:

tracker:
  # If you disable the tracker, you disable the P2P on your PeerTube instance
  enabled: true
  # Only handle requests on your videos
  # If you set this to false it means you have a public tracker
  # Then, it is possible that clients overload your instance with external torrents
  private: true
  # Reject peers that do a lot of announces (could improve privacy of TCP/UDP peers)
  reject_too_many_announces: false

When I open and play any video, everything works fine the first time. However, after refreshing the page and clicking play again, I see the following error in the browser console: "WebSocket connection to 'wss://peertube.cluster.wtf/tracker/socket' failed."

I captured the traffic using Wireshark. Here's the request:

GET /tracker/socket HTTP/1.1
X-Forwarded-For: 109.75.37.219
Host: peertube.cluster.wtf
X-Real-IP: 109.75.37.219
Upgrade: websocket
Connection: upgrade
X-Forwarded-Proto: https
Pragma: no-cache
Cache-Control: no-cache
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Origin: https://peertube.cluster.wtf
Sec-WebSocket-Version: 13
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7,es-ES;q=0.6,es;q=0.5,hy;q=0.4,sr;q=0.3
Cookie: _ym_uid=1702386692149719549; _ym_d=1721495874; _ga_KFGNEREP09=GS1.2.1723906768.16.0.1723906768.0.0.0; __utma=125388683.463117433.1701005819.1724323437.1724323437.1; __utmz=125388683.1724323437.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); _ga=GA1.1.463117433.1701005819; _ga_S2B025ZGBN=deleted; _ga_H5XS8EQPP2=GS1.1.1726149866.12.1.1726149887.0.0.0; clientLanguage=ru-RU; _ga_EQDN3BWDSD=GS1.1.1726507536.33.0.1726507536.0.0.0; _ga_S2B025ZGBN=GS1.1.1726915654.110.1.1726917591.0.0.0
Sec-WebSocket-Key: s3bdGH59sAB5abay99FDBw==
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits

And the response:

HTTP/1.1 403 Forbidden

It seems like the PeerTube log doesn't contain any specific information about this issue when I request a video, but sometimes I see this error (109.75.37.219 is my local IP):

{
   "err":{
      "stack":"Error: Unknown infoHash 921d167a1ef158020d4a1622938fa17056690628 requested by ip 109.75.37.219\n    at Server.filter [as _filter] (file:///home/peertube/versions/peertube-v6.3.0/dist/core/controllers/tracker.js:50:16)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
      "message":"Unknown infoHash 921d167a1ef158020d4a1622938fa17056690628 requested by ip 109.75.37.219"
   },
   "level":"warn",
   "message":"Warning in tracker.",
   "label":"peertube.cluster.wtf:443",
   "timestamp":"2024-09-21T12:15:25.467Z"
}

My nginx configuration is nearly the same as the one provided in support/nginx/peertube.

As a result, the video plays, but every viewer only sees "1 peer." But everything works as expected if I set private to false.

Steps to reproduce

  1. Set enabled and private to true in the tracker section of config file.
  2. Try to play any video multiple times.
  3. Check console of your web browser and peer counter.

Describe the expected behavior

  1. No errors in the browser console
  2. P2P that actually works

Additional information

  • PeerTube instance:

  • Browser name, version and platforms on which you could reproduce the bug: Chrome on Windows (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36), Chromium on Linux (Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36), Chrome for Android (Mozilla/5.0 (Linux; Android 14; SM-S908B Build/UP1A.231005.007; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/128.0.6613.146 Mobile Safari/537.36 GoogleApp/15.37.41.28.arm64), Firefox on Linux (Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0)

  • Link to browser console log if relevant: https://pastebin.com/pk2Wyc6i

  • Link to server log if relevant (journalctl or /var/www/peertube/storage/logs/): https://pastebin.com/vDTZ1DaS

  • Plugins installed: playlist-reverse-order custom-transcoding-profile originally-published-at google-analytics background-play

  • nginx config: https://pastebin.com/8bPPwjEf

@Chocobozzz
Copy link
Owner

Hi,

Does your instance currently use private: false? Because I can't reproduce with one of your latest local video

@Chocobozzz Chocobozzz added the Status: Waiting for answer Waiting issue author answer label Sep 23, 2024
@ClusterM
Copy link
Author

Does your instance currently use private: false? Because I can't reproduce with one of your latest local video

It's private: true now. Try to refresh the page multiple times or play the video in multiple tabs.

@Chocobozzz
Copy link
Owner

Are you able to reproduce with https://peertube.cluster.wtf/w/kCv7MiMTqgsMLZm2qM6uwS?

@ClusterM
Copy link
Author

Are you able to reproduce with https://peertube.cluster.wtf/w/kCv7MiMTqgsMLZm2qM6uwS?

Yes, after multiple page refreshes and playing video in multiple tabs. Try it right now.

@ClusterM
Copy link
Author

It works now. Weird. Try this video: https://peertube.cluster.wtf/w/2WPxHKxccHgFvCWJW62Q7D

@Chocobozzz
Copy link
Owner

Thanks! Then I think it's the same issue as #6516
But it's weird you still have the issue with 6.2.1. How did you configure S3 on your instance?

@ClusterM
Copy link
Author

I'm using my own Python script to upload files to the Google Cloud: https://pastebin.com/qrMH25Y6
But I 100% saw this error on local videos too.
My friend uses PeerTube with local videos only (and embedded only): https://kinamania.com/video/na-kukhne/49-7-season-nakuhne/315-na-kuhne-76
Try to open this URL in multiple tabs. Same problem.

@Chocobozzz
Copy link
Owner

Chocobozzz commented Sep 23, 2024

I'm using my own Python script to upload files to the Google Cloud: https://pastebin.com/qrMH25Y6

Please use https://docs.joinpeertube.org/maintain/tools#move-video-files-from-object-storage-to-filesystem instead, your method that update directly the database is not supported by PeerTube.

My friend uses PeerTube with local videos only

Can he provide more information on how he uploaded the videos/what is the PeerTube configuration? Can he try to update the video privacy from public -> private and then private -> public?

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

2 participants