Chocobozzz / PeerTube

ActivityPub-federated video streaming platform using P2P directly in your web browser
https://joinpeertube.org/
GNU Affero General Public License v3.0
13.04k stars 1.5k forks source link

Public, normal live session return 404 for all playlist files #6560

Closed kontrollanten closed 1 month ago

kontrollanten commented 1 month ago

Describe the current behavior

When creating a public live it seems that the streaming playlists files will occur in the private folder, even though the video privacy setting is Public in step 2, 4 and 6.

Steps to reproduce

  1. Create a normal live with privacy public.
  2. When coming to the video edit view, check the RTMP key and enter into OBS.
  3. Start stream from OBS.
  4. Click Update in video edit.
  5. Wait until live starts in Peertube client.
  6. master.m3u8 will return 404.

Describe the expected behavior

It should be in the public folder so the live is working as expected.

Additional information

Relevant Peertube config: object_storage.enabled: true object_storage.store_live_streams: false

Files in the system during the live:

ubuntu@test-www2:/var/www/peertube/storage/streaming-playlists/hls$ ls -l
Aug 29 21:07 8d590de1-5206-417b-b8a9-607bd31ea59e
Aug 26 09:20 d52a4afa-2d07-47f3-a253-7c265e29e0b9
Aug 30 09:25 private
ubuntu@test-www2:/var/www/peertube/storage/streaming-playlists/hls$ ls -l private
Aug 30 09:24 2e113f9a-4e63-4086-b507-ca09268e8581
Aug 30 08:59 939da551-4301-4f29-849f-26fa2e3b44ac
Aug 30 09:33 a68ab9bb-bd23-4835-98e8-3b00ffbcc408

Peertube logs

{"level":"info","message":"Video live Live with uuid a68ab9bb-bd23-4835-98e8-3b00ffbcc408 created.","label":"test.env.se:443","tags":["api","live"],"timestamp":"2024-08-30T09:25:02.157Z"}
{"err":{"stack":"unauthorized_request: Unauthorized request: no authentication given\n    at AuthenticateHandler.getTokenFromRequest (/var/www/peertube/versions/peertube-v6.2.1-c1/node_modules/@node-oauth/oauth2-server/lib/handlers/authenticate-handler.js:132:11)\n    at AuthenticateHandler.handle (/var/www/peertube/versions/peertube-v6.2.1-c1/node_modules/@node-oauth/oauth2-server/lib/handlers/authenticate-handler.js:67:39)\n    at OAuth2Server.authenticate (/var/www/peertube/versions/peertube-v6.2.1-c1/node_modules/@node-oauth/oauth2-server/lib/server.js:38:45)\n    at handleOAuthAuthenticate (file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/lib/auth/oauth.js:92:24)\n    at authenticate (file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/middlewares/auth.js:7:5)\n    at file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/middlewares/auth.js:53:9\n    at new Promise (<anonymous>)\n    at authenticatePromise (file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/middlewares/auth.js:42:12)\n    at checkCanSeeUserAuthVideo (file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/middlewares/validators/shared/videos.js:92:11)\n    at checkCanSeeVideo (file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/middlewares/validators/shared/videos.js:72:16)\n    at listVideoCommentThreadsValidator (file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/middlewares/validators/videos/video-comments.js:66:20)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","message":"Unauthorized request: no authentication given","statusCode":401,"status":401,"code":401,"name":"unauthorized_request"},"level":"info","message":"Cannot authenticate.","label":"test.env.se:443","timestamp":"2024-08-30T09:25:18.393Z"}
{"err":{"stack":"unauthorized_request: Unauthorized request: no authentication given\n    at AuthenticateHandler.getTokenFromRequest (/var/www/peertube/versions/peertube-v6.2.1-c1/node_modules/@node-oauth/oauth2-server/lib/handlers/authenticate-handler.js:132:11)\n    at AuthenticateHandler.handle (/var/www/peertube/versions/peertube-v6.2.1-c1/node_modules/@node-oauth/oauth2-server/lib/handlers/authenticate-handler.js:67:39)\n    at OAuth2Server.authenticate (/var/www/peertube/versions/peertube-v6.2.1-c1/node_modules/@node-oauth/oauth2-server/lib/server.js:38:45)\n    at handleOAuthAuthenticate (file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/lib/auth/oauth.js:92:24)\n    at authenticate (file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/middlewares/auth.js:7:5)\n    at file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/middlewares/auth.js:53:9\n    at new Promise (<anonymous>)\n    at authenticatePromise (file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/middlewares/auth.js:42:12)\n    at checkCanSeeUserAuthVideo (file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/middlewares/validators/shared/videos.js:92:11)\n    at checkCanSeeVideo (file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/middlewares/validators/shared/videos.js:72:16)\n    at listVideoCommentThreadsValidator (file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/middlewares/validators/videos/video-comments.js:66:20)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","message":"Unauthorized request: no authentication given","statusCode":401,"status":401,"code":401,"name":"unauthorized_request"},"level":"info","message":"Cannot authenticate.","label":"test.env.se:443","timestamp":"2024-08-30T09:25:48.285Z"}
{"level":"info","message":"Video with name Live and uuid a68ab9bb-bd23-4835-98e8-3b00ffbcc408 updated.","label":"test.env.se:443","tags":["api","video","a68ab9bb-bd23-4835-98e8-3b00ffbcc408"],"timestamp":"2024-08-30T09:25:54.151Z"}
{"level":"info","message":"Processing video federation in job 6af00308-4107-4681-a245-a662039b41e7.","label":"test.env.se:443","timestamp":"2024-08-30T09:25:54.175Z"}
{"level":"info","message":"Creating job to send video creation of https://test.env.se/videos/watch/a68ab9bb-bd23-4835-98e8-3b00ffbcc408.","label":"test.env.se:443","tags":["ap","create","a68ab9bb-bd23-4835-98e8-3b00ffbcc408"],"timestamp":"2024-08-30T09:25:54.190Z"}
{"level":"info","message":"Creating job to send announce https://test.env.se/videos/watch/a68ab9bb-bd23-4835-98e8-3b00ffbcc408/announces/3.","label":"test.env.se:443","timestamp":"2024-08-30T09:25:54.205Z"}
{"level":"info","message":"Creating job to send announce https://test.env.se/videos/watch/a68ab9bb-bd23-4835-98e8-3b00ffbcc408/announces/1.","label":"test.env.se:443","timestamp":"2024-08-30T09:25:54.207Z"}
{"level":"info","message":"Processing new-video notification in job f61cfadf-af8f-4a16-b065-30a118f0233c.","label":"test.env.se:443","timestamp":"2024-08-30T09:25:54.238Z"}
{"level":"info","message":"rtmp://127.0.0.1:1935/live/2a62416a-2501-4bc0-bd71-591d43ab5ab0 probing took 2142 ms (bitrate: 2560000, fps: 30, resolution: 720)","label":"test.env.se:443","tags":["live","UU7BO43Q","a68ab9bb-bd23-4835-98e8-3b00ffbcc408"],"timestamp":"2024-08-30T09:25:55.035Z"}
{"level":"info","message":"Handling live video of original resolution 720.","label":"test.env.se:443","allResolutions":[480,720,240],"tags":["live","UU7BO43Q","a68ab9bb-bd23-4835-98e8-3b00ffbcc408"],"timestamp":"2024-08-30T09:25:55.036Z"}
{"level":"info","message":"Running local live muxing/transcoding for a68ab9bb-bd23-4835-98e8-3b00ffbcc408.","label":"test.env.se:443","tags":["live","UU7BO43Q","a68ab9bb-bd23-4835-98e8-3b00ffbcc408"],"timestamp":"2024-08-30T09:25:55.074Z"}
{"level":"info","message":"Master playlist file for a68ab9bb-bd23-4835-98e8-3b00ffbcc408 has been created","label":"test.env.se:443","tags":["live","UU7BO43Q","a68ab9bb-bd23-4835-98e8-3b00ffbcc408"],"timestamp":"2024-08-30T09:25:59.202Z"}
{"level":"info","message":"Will publish and federate live https://test.env.se/videos/watch/a68ab9bb-bd23-4835-98e8-3b00ffbcc408.","label":"test.env.se:443","tags":["live","UU7BO43Q","a68ab9bb-bd23-4835-98e8-3b00ffbcc408"],"timestamp":"2024-08-30T09:26:03.636Z"}
{"err":{"stack":"unauthorized_request: Unauthorized request: no authentication given\n    at AuthenticateHandler.getTokenFromRequest (/var/www/peertube/versions/peertube-v6.2.1-c1/node_modules/@node-oauth/oauth2-server/lib/handlers/authenticate-handler.js:132:11)\n    at AuthenticateHandler.handle (/var/www/peertube/versions/peertube-v6.2.1-c1/node_modules/@node-oauth/oauth2-server/lib/handlers/authenticate-handler.js:67:39)\n    at OAuth2Server.authenticate (/var/www/peertube/versions/peertube-v6.2.1-c1/node_modules/@node-oauth/oauth2-server/lib/server.js:38:45)\n    at handleOAuthAuthenticate (file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/lib/auth/oauth.js:92:24)\n    at authenticate (file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/middlewares/auth.js:7:5)\n    at file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/middlewares/auth.js:53:9\n    at new Promise (<anonymous>)\n    at authenticatePromise (file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/middlewares/auth.js:42:12)\n    at checkCanSeeUserAuthVideo (file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/middlewares/validators/shared/videos.js:92:11)\n    at checkCanSeeVideo (file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/middlewares/validators/shared/videos.js:72:16)\n    at listVideoCommentThreadsValidator (file:///var/www/peertube/versions/peertube-v6.2.1-c1/dist/core/middlewares/validators/videos/video-comments.js:66:20)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","message":"Unauthorized request: no authentication given","statusCode":401,"status":401,"code":401,"name":"unauthorized_request"},"level":"info","message":"Cannot authenticate.","label":"test.env.se:443","timestamp":"2024-08-30T09:26:18.407Z"}
{"level":"info","message":"Creating job to update video https://test.env.se/videos/watch/a68ab9bb-bd23-4835-98e8-3b00ffbcc408.","label":"test.env.se:443","timestamp":"2024-08-30T09:26:19.668Z"}
{"level":"info","message":"Notifying 1 users of new video https://test.env.se/videos/watch/a68ab9bb-bd23-4835-98e8-3b00ffbcc408.","label":"test.env.se:443","timestamp":"2024-08-30T09:26:19.699Z"}
{"level":"info","message":"Processing email in job 79.","label":"test.env.se:443","timestamp":"2024-08-30T09:26:19.734Z"}
{"level":"info","message":"Connection established to 34.95.107.114:587","label":"test.env.se:443","component":"smtp-connection","sid":"iw44y7mVnw","tnx":"network","localAddress":"10.1.0.106","localPort":51368,"remoteAddress":"34.95.107.114","remotePort":587,"timestamp":"2024-08-30T09:26:19.817Z"}
{"component":"smtp-connection","sid":"iw44y7mVnw","tnx":"smtp","level":"info","message":"Connection upgraded with STARTTLS","label":"test.env.se:443","timestamp":"2024-08-30T09:26:19.988Z"}
{"level":"info","message":"User \"postmaster@test.env.se\" authenticated","label":"test.env.se:443","component":"smtp-connection","sid":"iw44y7mVnw","tnx":"smtp","username":"postmaster@test.env.se","action":"authenticated","method":"PLAIN","timestamp":"2024-08-30T09:26:20.074Z"}
{"level":"info","message":"Sending message <854123f4-3d51-eac5-973a-4b993cd02aa6@test.env.se> to <user4661@test.env.se>","label":"test.env.se:443","component":"smtp-transport","tnx":"send","messageId":"<854123f4-3d51-eac5-973a-4b993cd02aa6@test.env.se>","timestamp":"2024-08-30T09:26:20.076Z"}
{"level":"info","message":"<12944 bytes encoded mime message (source size 12673 bytes)>","label":"test.env.se:443","component":"smtp-connection","sid":"iw44y7mVnw","tnx":"message","inByteCount":12673,"outByteCount":12944,"timestamp":"2024-08-30T09:26:20.267Z"}
{"component":"smtp-connection","sid":"iw44y7mVnw","tnx":"network","level":"info","message":"Connection closed","label":"test.env.se:443","timestamp":"2024-08-30T09:26:20.459Z"}
{"tags":["client"],"username":"root","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","meta":"{\"currentTime\":0,\"data\":{\"type\":\"networkError\",\"details\":\"manifestLoadError\",\"fatal\":true,\"url\":\"https://test.env.se/static/streaming-playlists/hls/a68ab9bb-bd23-4835-98e8-3b00ffbcc408/master.m3u8\",\"loader\":{\"impl\":{\"segmentManager\":{\"masterPlaylist\":null,\"variantPlaylists\":{},\"segmentRequest\":null,\"playQueue\":[],\"settings\":{\"forwardSegmentCount\":20,\"swarmId\":\"https://test.env.se/static/streaming-playlists/hls/a68ab9bb-bd23-4835-98e8-3b00ffbcc408/master.m3u8\"},\"loader\":{\"_events\":{\"segment_loaded\":[null,null],\"segment_error\":[null,null],\"segment_abort\":[null,null]},\"_eventsCount\":9,\"segmentsQueue\":[],\"bandwidthApproximator\":{\"lastBytes\":[],\"currentBytesSum\":0,\"lastBandwidth\":[]},\"httpDownloadInitialTimeoutTimestamp\":null,\"settings\":{\"cachedSegmentExpiration\":300000,\"cachedSegmentsCount\":30,\"useP2P\":true,\"consumeOnly\":false,\"requiredSegmentsPriority\":1,\"skipSegmentBuilderPriority\":1,\"simultaneousHttpDownloads\":1,\"httpDownloadProbability\":0.1,\"httpDownloadProbabilityInterval\":1000,\"httpDownloadProbabilitySkipIfNoPeers\":false,\"httpFailedSegmentTimeout\":1000,\"httpDownloadMaxPriority\":20,\"httpDownloadInitialTimeout\":0,\"httpDownloadInitialTimeoutPerSegment\":4000,\"httpUseRanges\":false,\"simultaneousP2PDownloads\":3,\"p2pDownloadMaxPriority\":20,\"p2pSegmentDownloadTimeout\":60000,\"webRtcMaxMessageSize\":65535,\"trackerAnnounce\":[\"wss://test.env.se:443/tracker/socket\"],\"peerRequestsPerAnnounce\":10,\"rtcConfig\":{\"iceServers\":[{\"urls\":\"stun:stun.stunprotocol.org\"},{\"urls\":\"stun:stun.framasoft.org\"}]}},\"segmentsStorage\":{\"settings\":{\"cachedSegmentExpiration\":300000,\"cachedSegmentsCount\":30,\"useP2P\":true,\"consumeOnly\":false,\"requiredSegmentsPriority\":1,\"skipSegmentBuilderPriority\":1,\"simultaneousHttpDownloads\":1,\"httpDownloadProbability\":0.1,\"httpDownloadProbabilityInterval\":1000,\"httpDownloadProbabilitySkipIfNoPeers\":false,\"httpFailedSegmentTimeout\":1000,\"httpDownloadMaxPriority\":20,\"httpDownloadInitialTimeout\":0,\"httpDownloadInitialTimeoutPerSegment\":4000,\"httpUseRanges\":false,\"simultaneousP2PDownloads\":3,\"p2pDownloadMaxPriority\":20,\"p2pSegmentDownloadTimeout\":60000,\"webRtcMaxMessageSize\":65535,\"trackerAnnounce\":[\"wss://test.env.se:443/tracker/socket\"],\"peerRequestsPerAnnounce\":10,\"rtcConfig\":{\"iceServers\":[{\"urls\":\"stun:stun.stunprotocol.org\"},{\"urls\":\"stun:stun.framasoft.org\"}]}},\"cache\":{}},\"httpManager\":{\"_events\":{},\"_eventsCount\":5,\"settings\":{\"cachedSegmentExpiration\":300000,\"cachedSegmentsCount\":30,\"useP2P\":true,\"consumeOnly\":false,\"requiredSegmentsPriority\":1,\"skipSegmentBuilderPriority\":1,\"simultaneousHttpDownloads\":1,\"httpDownloadProbability\":0.1,\"httpDownloadProbabilityInterval\":1000,\"httpDownloadProbabilitySkipIfNoPeers\":false,\"httpFailedSegmentTimeout\":1000,\"httpDownloadMaxPriority\":20,\"httpDownloadInitialTimeout\":0,\"httpDownloadInitialTimeoutPerSegment\":4000,\"httpUseRanges\":false,\"simultaneousP2PDownloads\":3,\"p2pDownloadMaxPriority\":20,\"p2pSegmentDownloadTimeout\":60000,\"webRtcMaxMessageSize\":65535,\"trackerAnnounce\":[\"wss://test.env.se:443/tracker/socket\"],\"peerRequestsPerAnnounce\":10,\"rtcConfig\":{\"iceServers\":[{\"urls\":\"stun:stun.stunprotocol.org\"},{\"urls\":\"stun:stun.framasoft.org\"}]}},\"xhrRequests\":{},\"failedSegments\":{}},\"p2pManager\":{\"_events\":{},\"_eventsCount\":10,\"segmentsStorage\":{\"settings\":{\"cachedSegmentExpiration\":300000,\"cachedSegmentsCount\":30,\"useP2P\":true,\"consumeOnly\":false,\"requiredSegmentsPriority\":1,\"skipSegmentBuilderPriority\":1,\"simultaneousHttpDownloads\":1,\"httpDownloadProbability\":0.1,\"httpDownloadProbabilityInterval\":1000,\"httpDownloadProbabilitySkipIfNoPeers\":false,\"httpFailedSegmentTimeout\":1000,\"httpDownloadMaxPriority\":20,\"httpDownloadInitialTimeout\":0,\"httpDownloadInitialTimeoutPerSegment\":4000,\"httpUseRanges\":false,\"simultaneousP2PDownloads\":3,\"p2pDownloadMaxPriority\":20,\"p2pSegmentDownloadTimeout\":60000,\"webRtcMaxMessageSize\":65535,\"trackerAnnounce\":[\"wss://test.env.se:443/tracker/socket\"],\"peerRequestsPerAnnounce\":10,\"rtcConfig\":{\"iceServers\":[{\"urls\":\"stun:stun.stunprotocol.org\"},{\"urls\":\"stun:stun.framasoft.org\"}]}},\"cache\":{}},\"settings\":{\"cachedSegmentExpiration\":300000,\"cachedSegmentsCount\":30,\"useP2P\":true,\"consumeOnly\":false,\"requiredSegmentsPriority\":1,\"skipSegmentBuilderPriority\":1,\"simultaneousHttpDownloads\":1,\"httpDownloadProbability\":0.1,\"httpDownloadProbabilityInterval\":1000,\"httpDownloadProbabilitySkipIfNoPeers\":false,\"httpFailedSegmentTimeout\":1000,\"httpDownloadMaxPriority\":20,\"httpDownloadInitialTimeout\":0,\"httpDownloadInitialTimeoutPerSegment\":4000,\"httpUseRanges\":false,\"simultaneousP2PDownloads\":3,\"p2pDownloadMaxPriority\":20,\"p2pSegmentDownloadTimeout\":60000,\"webRtcMaxMessageSize\":65535,\"trackerAnnounce\":[\"wss://test.env.se:443/tracker/socket\"],\"peerRequestsPerAnnounce\":10,\"rtcConfig\":{\"iceServers\":[{\"urls\":\"stun:stun.stunprotocol.org\"},{\"urls\":\"stun:stun.framasoft.org\"}]}},\"trackerClient\":null,\"peers\":{},\"peerCandidates\":{},\"peerSegmentRequests\":{},\"streamSwarmId\":null,\"pendingTrackerClient\":null,\"peerId\":{}}}},\"stats\":{\"loaded\":0,\"total\":0,\"aborted\":false,\"retry\":0,\"chunkCount\":0,\"bwEstimate\":0,\"loading\":{\"start\":151375,\"end\":0,\"first\":151375},\"parsing\":{\"start\":0,\"end\":0},\"buffering\":{\"start\":0,\"end\":0,\"first\":0}},\"debugId\":\"\",\"context\":{\"id\":null,\"level\":0,\"responseType\":\"text\",\"type\":\"manifest\",\"url\":\"https://test.env.se/static/streaming-playlists/hls/a68ab9bb-bd23-4835-98e8-3b00ffbcc408/master.m3u8\",\"deliveryDirectives\":null},\"callbacks\":{}},\"stats\":{\"loaded\":0,\"total\":0,\"aborted\":false,\"retry\":0,\"chunkCount\":0,\"bwEstimate\":0,\"loading\":{\"start\":151375,\"end\":0,\"first\":151375},\"parsing\":{\"start\":0,\"end\":0},\"buffering\":{\"start\":0,\"end\":0,\"first\":0}},\"context\":{\"id\":null,\"level\":0,\"responseType\":\"text\",\"type\":\"manifest\",\"url\":\"https://test.env.se/static/streaming-playlists/hls/a68ab9bb-bd23-4835-98e8-3b00ffbcc408/master.m3u8\",\"deliveryDirectives\":null},\"callbacks\":{}},\"context\":{\"id\":null,\"level\":0,\"responseType\":\"text\",\"type\":\"manifest\",\"url\":\"https://test.env.se/static/streaming-playlists/hls/a68ab9bb-bd23-4835-98e8-3b00ffbcc408/master.m3u8\",\"deliveryDirectives\":null},\"error\":{},\"stats\":{\"loaded\":0,\"total\":0,\"aborted\":false,\"retry\":0,\"chunkCount\":0,\"bwEstimate\":0,\"loading\":{\"start\":151375,\"end\":0,\"first\":151375},\"parsing\":{\"start\":0,\"end\":0},\"buffering\":{\"start\":0,\"end\":0,\"first\":0}}}}","url":"https://test.env.se/w/myMFtAKLaijPx4Euhz4iLC","level":"error","message":"Client log: HLS.js error: networkError - fatal: true - manifestLoadError","label":"test.env.se:443","timestamp":"2024-08-30T09:26:22.075Z"}
Chocobozzz commented 1 month ago

Thanks! Should be fixed by https://github.com/Chocobozzz/PeerTube/commit/06934fee4ef2c6744de58b99f5ca72c7ef24ef4e

leonrobintaylor commented 1 month ago

Hola, we are currently having the same issues with public videos

Chocobozzz commented 1 month ago

@leonrobintaylor Please create a dedicated issue and fill the template :)