Playing video on remote instance is sometime broken ("Safe mode validation error": AP regression?)
Describe the current behavior
I have 2 instances, using Peertube v6.1.0. Today, trying to play a video from one of them on the other failed:
https://videos.john-livingston.fr/w/2obDFRmxD7hTs2bFqKycaA
But the video is working on the origin instance:
https://www.yiny.org/w/0b321094-02a1-491a-92a6-e49eca24de28
I found this log that can explain:
error[03/05/2024 23:58:49] Cannot execute job 35196 in queue activitypub-http-broadcast.
{
"payload": {
"uris": [
"https://anticapitalist.party/inbox",
"https://cloudtube.ise.fraunhofer.de/inbox",
"https://dalek.zone/inbox",
"https://fediverse.tv/inbox",
"https://freediverse.com/inbox",
"https://hitchtube.fr/inbox",
"https://mamot.fr/inbox",
"https://mastodon.social/inbox",
"https://pawoo.net/inbox",
"https://peertube.1312.media/inbox",
"https://peertube2.cpy.re/inbox",
"https://peertube3.cpy.re/inbox",
"https://peertube.anduin.net/inbox",
"https://peertube.automat.click/inbox",
"https://peertube.biz/inbox",
"https://peertube.bubuit.net/inbox",
"https://peertube.cirkau.art/inbox",
"https://peertube.datura.network/inbox",
"https://peertube.dk/inbox",
"https://peertube.fr/inbox",
"https://peertube.heraut.eu/inbox",
"https://p.eertu.be/inbox",
"https://peertube.in.ua/inbox",
"https://peertube.it-arts.net/inbox",
"https://peertube.makotoworkshop.org/inbox",
"https://peertube.mygaia.org/inbox",
"https://peertube.nomagic.uk/inbox",
"https://peertube.stream/inbox",
"https://peertube.tmp.rcp.tf/inbox",
"https://peertube.wtfayla.net/inbox",
"https://poast.tv/inbox",
"https://ptb.lunarviews.net/inbox",
"https://rankett.net/inbox",
"https://repro.video/inbox",
"https://tube.anjara.eu/inbox",
"https://tube.archworks.co/inbox",
"https://tube.crapaud-fou.org/inbox",
"https://tube.fedi.quebec/inbox",
"https://tube.gayfr.online/inbox",
"https://tube.nogafa.org/inbox",
"https://tube.plaf.fr/inbox",
"https://tube.shanti.cafe/inbox",
"https://tube.skrep.in/inbox",
"https://tube.spdns.org/inbox",
"https://tv.mattchristiansenmedia.com/inbox",
"https://v.9tail.net/inbox",
"https://video.antopie.org/inbox",
"https://video.barcelo.ynh.fr/inbox",
"https://video.causa-arcana.com/inbox",
"https://video.liberta.vip/inbox",
"https://videomensoif.ynh.fr/inbox",
"https://video.netsyms.com/inbox",
"https://video.omada.cafe/inbox",
"https://video.paradigmthreat.net/inbox",
"https://video.ploud.jp/inbox",
"https://video.sadmin.io/inbox",
"https://videos.john-livingston.fr/inbox",
"https://videos.pair2jeux.tube/inbox",
"https://videos.viorsan.com/inbox",
"https://watch.libertaria.space/inbox",
"https://www.wuwox.com/inbox"
],
"signatureActorId": 404204,
"body": {
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"https://www.yiny.org/accounts/olivierd/followers"
],
"type": "Update",
"id": "https://www.yiny.org/videos/watch/0b321094-02a1-491a-92a6-e49eca24de28/updates/2024-05-03T21:58:49.052Z",
"actor": "https://www.yiny.org/accounts/olivierd",
"object": {
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"https://www.yiny.org/accounts/olivierd/followers"
],
"type": "Video",
"id": "https://www.yiny.org/videos/watch/0b321094-02a1-491a-92a6-e49eca24de28",
"name": "Matos De Merde \"Fin De Monde\" + \"Petit Bolide\" - Le QG Oberkampf Paris le 03/05/2024",
"duration": "PT257S",
"uuid": "0b321094-02a1-491a-92a6-e49eca24de28",
"views": 1,
"sensitive": false,
"waitTranscoding": true,
"state": 1,
"commentsEnabled": true,
"downloadEnabled": true,
"published": "2024-05-03T18:52:34.601Z",
"originallyPublishedAt": "2024-05-03T00:00:00.000Z",
"updated": "2024-05-03T21:58:49.052Z",
"tag": [],
"mediaType": "text/markdown",
"content": null,
"support": null,
"subtitleLanguage": [],
"icon": [
{
"type": "Image",
"url": "https://www.yiny.org/lazy-static/thumbnails/66f38942-5c39-4be1-9d2e-ea7f42a368a6.jpg",
"mediaType": "image/jpeg",
"width": 280,
"height": 157
},
{
"type": "Image",
"url": "https://www.yiny.org/lazy-static/previews/7c3bbab4-afd9-47dd-9647-fcaf69f9d2f9.jpg",
"mediaType": "image/jpeg",
"width": 850,
"height": 480
}
],
"preview": [
{
"type": "Image",
"rel": [
"storyboard"
],
"url": [
{
"mediaType": "image/jpeg",
"href": "https://www.yiny.org/lazy-static/storyboards/d3dbd5b0-d009-427f-83b1-9ee983f36444.jpg",
"width": 1728,
"height": 972,
"tileWidth": 192,
"tileHeight": 108,
"tileDuration": "PT3S"
}
]
}
],
"aspectRatio": 1.7778,
"url": [
{
"type": "Link",
"mediaType": "text/html",
"href": "https://www.yiny.org/videos/watch/0b321094-02a1-491a-92a6-e49eca24de28"
},
{
"type": "Link",
"mediaType": "application/x-mpegURL",
"href": "https://www.yiny.org/static/streaming-playlists/hls/0b321094-02a1-491a-92a6-e49eca24de28/a80bb480-f443-4722-8f98-6490c778593b-master.m3u8",
"tag": [
{
"type": "Infohash",
"name": "e36b0d91e473b5d2944843aea62fdb31cd43cb3c"
},
{
"type": "Infohash",
"name": "6da164f5819fde6cd87dcc1cea3211e4189f26c6"
},
{
"type": "Infohash",
"name": "f52357f0d7f4a149312c296e036d14ea810dad42"
},
{
"type": "Infohash",
"name": "e2f0336dad21be9a0358f2caa6fa498d065432e4"
},
{
"type": "Infohash",
"name": "2ab1bbe35328c65df9207b2844d8b17cda29ce9b"
},
{
"type": "Link",
"name": "sha256",
"mediaType": "application/json",
"href": "https://www.yiny.org/static/streaming-playlists/hls/0b321094-02a1-491a-92a6-e49eca24de28/9206fee6-c2b7-4418-a062-c2e72d36cd03-segments-sha256.json"
},
{
"type": "Link",
"mediaType": "video/mp4",
"href": "https://www.yiny.org/static/streaming-playlists/hls/0b321094-02a1-491a-92a6-e49eca24de28/65e54a1a-57f5-4da2-a142-c8143f6f56fe-1080-fragmented.mp4",
"height": 1080,
"width": 1920,
"size": 204435974,
"fps": 30
},
{
"type": "Link",
"rel": [
"metadata",
"video/mp4"
],
"mediaType": "application/json",
"href": "https://www.yiny.org/api/v1/videos/0b321094-02a1-491a-92a6-e49eca24de28/metadata/243393",
"height": 1080,
"width": 1920,
"fps": 30
},
{
"type": "Link",
"mediaType": "application/x-bittorrent",
"href": "https://www.yiny.org/lazy-static/torrents/0ff495a2-20e9-4638-96c2-0e92fee73691-1080-hls.torrent",
"height": 1080,
"width": 1920,
"fps": 30
},
{
"type": "Link",
"mediaType": "application/x-bittorrent;x-scheme-handler/magnet",
"href": "magnet:?xs=https%3A%2F%2Fwww.yiny.org%2Flazy-static%2Ftorrents%2F0ff495a2-20e9-4638-96c2-0e92fee73691-1080-hls.torrent&xt=urn:btih:21de08415c629a25637260e2f2e4693567695eb9&dn=Matos+De+Merde+%22Fin+De+Monde%22+%2B+%22Petit+Bolide%22+-++Le+QG+Oberkampf+Paris+le+03%2F05%2F2024&tr=https%3A%2F%2Fwww.yiny.org%2Ftracker%2Fannounce&tr=wss%3A%2F%2Fwww.yiny.org%3A443%2Ftracker%2Fsocket&ws=https%3A%2F%2Fwww.yiny.org%2Fstatic%2Fstreaming-playlists%2Fhls%2F0b321094-02a1-491a-92a6-e49eca24de28%2F65e54a1a-57f5-4da2-a142-c8143f6f56fe-1080-fragmented.mp4",
"height": 1080,
"width": 1920,
"fps": 30
},
{
"type": "Link",
"mediaType": "video/mp4",
"href": "https://www.yiny.org/static/streaming-playlists/hls/0b321094-02a1-491a-92a6-e49eca24de28/0268b4c3-c8b1-47cb-82e2-ba672e5d9721-720-fragmented.mp4",
"height": 720,
"width": 1280,
"size": 102133999,
"fps": 30
},
{
"type": "Link",
"rel": [
"metadata",
"video/mp4"
],
"mediaType": "application/json",
"href": "https://www.yiny.org/api/v1/videos/0b321094-02a1-491a-92a6-e49eca24de28/metadata/243391",
"height": 720,
"width": 1280,
"fps": 30
},
{
"type": "Link",
"mediaType": "application/x-bittorrent",
"href": "https://www.yiny.org/lazy-static/torrents/44773443-38a4-45f1-ac59-61832339567f-720-hls.torrent",
"height": 720,
"width": 1280,
"fps": 30
},
{
"type": "Link",
"mediaType": "application/x-bittorrent;x-scheme-handler/magnet",
"href": "magnet:?xs=https%3A%2F%2Fwww.yiny.org%2Flazy-static%2Ftorrents%2F44773443-38a4-45f1-ac59-61832339567f-720-hls.torrent&xt=urn:btih:a118d4d5d03a023b47f801495ddc2ff88f79e478&dn=Matos+De+Merde+%22Fin+De+Monde%22+%2B+%22Petit+Bolide%22+-++Le+QG+Oberkampf+Paris+le+03%2F05%2F2024&tr=https%3A%2F%2Fwww.yiny.org%2Ftracker%2Fannounce&tr=wss%3A%2F%2Fwww.yiny.org%3A443%2Ftracker%2Fsocket&ws=https%3A%2F%2Fwww.yiny.org%2Fstatic%2Fstreaming-playlists%2Fhls%2F0b321094-02a1-491a-92a6-e49eca24de28%2F0268b4c3-c8b1-47cb-82e2-ba672e5d9721-720-fragmented.mp4",
"height": 720,
"width": 1280,
"fps": 30
},
{
"type": "Link",
"mediaType": "video/mp4",
"href": "https://www.yiny.org/static/streaming-playlists/hls/0b321094-02a1-491a-92a6-e49eca24de28/804688bc-cc45-4b4d-9c32-76aa5de75427-480-fragmented.mp4",
"height": 480,
"width": 854,
"size": 51726849,
"fps": 30
},
{
"type": "Link",
"rel": [
"metadata",
"video/mp4"
],
"mediaType": "application/json",
"href": "https://www.yiny.org/api/v1/videos/0b321094-02a1-491a-92a6-e49eca24de28/metadata/243389",
"height": 480,
"width": 854,
"fps": 30
},
{
"type": "Link",
"mediaType": "application/x-bittorrent",
"href": "https://www.yiny.org/lazy-static/torrents/5248ec71-3a03-4baf-9fa1-8ee960ddd0bd-480-hls.torrent",
"height": 480,
"width": 854,
"fps": 30
},
{
"type": "Link",
"mediaType": "application/x-bittorrent;x-scheme-handler/magnet",
"href": "magnet:?xs=https%3A%2F%2Fwww.yiny.org%2Flazy-static%2Ftorrents%2F5248ec71-3a03-4baf-9fa1-8ee960ddd0bd-480-hls.torrent&xt=urn:btih:7710e20d032a18ab525aee31a5fafe1665e99481&dn=Matos+De+Merde+%22Fin+De+Monde%22+%2B+%22Petit+Bolide%22+-++Le+QG+Oberkampf+Paris+le+03%2F05%2F2024&tr=https%3A%2F%2Fwww.yiny.org%2Ftracker%2Fannounce&tr=wss%3A%2F%2Fwww.yiny.org%3A443%2Ftracker%2Fsocket&ws=https%3A%2F%2Fwww.yiny.org%2Fstatic%2Fstreaming-playlists%2Fhls%2F0b321094-02a1-491a-92a6-e49eca24de28%2F804688bc-cc45-4b4d-9c32-76aa5de75427-480-fragmented.mp4",
"height": 480,
"width": 854,
"fps": 30
},
{
"type": "Link",
"mediaType": "video/mp4",
"href": "https://www.yiny.org/static/streaming-playlists/hls/0b321094-02a1-491a-92a6-e49eca24de28/808457da-930b-4f70-ab44-bdb65aab4336-240-fragmented.mp4",
"height": 240,
"width": 426,
"size": 21073188,
"fps": 30
},
{
"type": "Link",
"rel": [
"metadata",
"video/mp4"
],
"mediaType": "application/json",
"href": "https://www.yiny.org/api/v1/videos/0b321094-02a1-491a-92a6-e49eca24de28/metadata/243388",
"height": 240,
"width": 426,
"fps": 30
},
{
"type": "Link",
"mediaType": "application/x-bittorrent",
"href": "https://www.yiny.org/lazy-static/torrents/5ff9c29b-ddac-40b9-9d67-56be4e2cbdf3-240-hls.torrent",
"height": 240,
"width": 426,
"fps": 30
},
{
"type": "Link",
"mediaType": "application/x-bittorrent;x-scheme-handler/magnet",
"href": "magnet:?xs=https%3A%2F%2Fwww.yiny.org%2Flazy-static%2Ftorrents%2F5ff9c29b-ddac-40b9-9d67-56be4e2cbdf3-240-hls.torrent&xt=urn:btih:af550a3797eb08797b4a9ec6e09a54537afd3d3f&dn=Matos+De+Merde+%22Fin+De+Monde%22+%2B+%22Petit+Bolide%22+-++Le+QG+Oberkampf+Paris+le+03%2F05%2F2024&tr=https%3A%2F%2Fwww.yiny.org%2Ftracker%2Fannounce&tr=wss%3A%2F%2Fwww.yiny.org%3A443%2Ftracker%2Fsocket&ws=https%3A%2F%2Fwww.yiny.org%2Fstatic%2Fstreaming-playlists%2Fhls%2F0b321094-02a1-491a-92a6-e49eca24de28%2F808457da-930b-4f70-ab44-bdb65aab4336-240-fragmented.mp4",
"height": 240,
"width": 426,
"fps": 30
},
{
"type": "Link",
"mediaType": "video/mp4",
"href": "https://www.yiny.org/static/streaming-playlists/hls/0b321094-02a1-491a-92a6-e49eca24de28/db7e31b6-e471-4d94-abb5-793d0f33fb48-0-fragmented.mp4",
"height": 0,
"width": 0,
"size": 4165921,
"fps": 0
},
{
"type": "Link",
"rel": [
"metadata",
"video/mp4"
],
"mediaType": "application/json",
"href": "https://www.yiny.org/api/v1/videos/0b321094-02a1-491a-92a6-e49eca24de28/metadata/243386",
"height": 0,
"width": 0,
"fps": 0
},
{
"type": "Link",
"mediaType": "application/x-bittorrent",
"href": "https://www.yiny.org/lazy-static/torrents/26cc029d-fb57-45c0-b3ce-4bb1deee0f2c-0-hls.torrent",
"height": 0,
"width": 0,
"fps": 0
},
{
"type": "Link",
"mediaType": "application/x-bittorrent;x-scheme-handler/magnet",
"href": "magnet:?xs=https%3A%2F%2Fwww.yiny.org%2Flazy-static%2Ftorrents%2F26cc029d-fb57-45c0-b3ce-4bb1deee0f2c-0-hls.torrent&xt=urn:btih:bf886dc7c58c07db141558a5376aef4a9bab7356&dn=Matos+De+Merde+%22Fin+De+Monde%22+%2B+%22Petit+Bolide%22+-++Le+QG+Oberkampf+Paris+le+03%2F05%2F2024&tr=https%3A%2F%2Fwww.yiny.org%2Ftracker%2Fannounce&tr=wss%3A%2F%2Fwww.yiny.org%3A443%2Ftracker%2Fsocket&ws=https%3A%2F%2Fwww.yiny.org%2Fstatic%2Fstreaming-playlists%2Fhls%2F0b321094-02a1-491a-92a6-e49eca24de28%2Fdb7e31b6-e471-4d94-abb5-793d0f33fb48-0-fragmented.mp4",
"height": 0,
"width": 0,
"fps": 0
}
]
},
{
"type": "Link",
"name": "tracker-http",
"rel": [
"tracker",
"http"
],
"href": "https://www.yiny.org/tracker/announce"
},
{
"type": "Link",
"name": "tracker-websocket",
"rel": [
"tracker",
"websocket"
],
"href": "wss://www.yiny.org:443/tracker/socket"
}
],
"likes": "https://www.yiny.org/videos/watch/0b321094-02a1-491a-92a6-e49eca24de28/likes",
"dislikes": "https://www.yiny.org/videos/watch/0b321094-02a1-491a-92a6-e49eca24de28/dislikes",
"shares": "https://www.yiny.org/videos/watch/0b321094-02a1-491a-92a6-e49eca24de28/announces",
"comments": "https://www.yiny.org/videos/watch/0b321094-02a1-491a-92a6-e49eca24de28/comments",
"hasParts": "https://www.yiny.org/videos/watch/0b321094-02a1-491a-92a6-e49eca24de28/chapters",
"attributedTo": [
{
"type": "Person",
"id": "https://www.yiny.org/accounts/olivierd"
},
{
"type": "Group",
"id": "https://www.yiny.org/video-channels/olirock"
}
],
"isLiveBroadcast": false,
"liveSaveReplay": null,
"permanentLive": null,
"latencyMode": null,
"peertubeLiveChat": false
}
},
"contextType": "Video"
},
"err": {
"stack": "jsonld.ValidationError: Safe mode validation error.\n at safeEventHandler (/var/www/peertube/versions/peertube-v6.1.0/node_modules/jsonld/lib/events.js:135:11)\n at _handle (/var/www/peertube/versions/peertube-v6.1.0/node_modules/jsonld/lib/events.js:82:7)\n at api.handleEvent (/var/www/peertube/versions/peertube-v6.1.0/node_modules/jsonld/lib/events.js:71:3)\n at _graphToRDF (/var/www/peertube/versions/peertube-v6.1.0/node_modules/jsonld/lib/toRdf.js:175:13)\n at api.toRDF (/var/www/peertube/versions/peertube-v6.1.0/node_modules/jsonld/lib/toRdf.js:90:5)\n at jsonld.toRDF (/var/www/peertube/versions/peertube-v6.1.0/node_modules/jsonld/lib/jsonld.js:691:19)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async jsonld.normalize.jsonld.canonize (/var/www/peertube/versions/peertube-v6.1.0/node_modules/jsonld/lib/jsonld.js:589:19)\n at async hashObject (file:///var/www/peertube/versions/peertube-v6.1.0/dist/core/helpers/peertube-jsonld.js:90:17)\n at async Promise.all (index 0)",
"message": "Safe mode validation error."
}
}
I guess its the AP message when the video is transcoded that did not pass (and therefore the remote instance has not the right filepaths).
Steps to reproduce
- try to play https://videos.john-livingston.fr/w/2obDFRmxD7hTs2bFqKycaA
Describe the expected behavior
No response
Additional information
-
PeerTube instance:
- URL: https://videos.john-livingston.fr and https://www.yiny.org
- Version: 6.1.0
- NodeJS version:
- Ffmpeg version:
-
Browser name, version and platforms on which you could reproduce the bug:
-
Link to browser console log if relevant:
-
Link to server log if relevant (
journalctlor/var/www/peertube/storage/logs/):
Seems related to the data the livechat plugin adds in the AP object (removing the plugin fix the issue).
Don't know if it is a Peertube regression, or a problem related to invalid JSON-LD data format for the livechat plugin (i struggle understanding JSON-LD...). I will make some tests.
I can confirm that the issue is on the livechat end. The plugin stores some data that are not fully JSON-LD compliant. Peertube v6.1.0 adds some checks on the AP object, leading to this error.
fixed in livechat 9.0.2: https://github.com/JohnXLivingston/peertube-plugin-livechat/releases/tag/v9.0.2
Instances that are running Peertube v6.1.0 should update the livechat plugin as soon as possible, otherwise it breaks the federation of all videos. Sorry for that :/
Thanks @JohnXLivingston for the fix on your plugin.
I don't know if we can consider this issue as fixed though. This error could come from any plugin trying to pass data through the AP objects. Something should be done to make sure it doesn't happen again in Peertube :
- We should validate and notify users of federation issues, even altogether deactivate plugins when they make federation fail
- The AP object should make room for non-linked data. All data used by peertube might not be relevant for AP in general
- The AP object could have an object that contains plugin specific linked data (debatable depending on AP spec)
- Plugin updates are taking too much time for fixes to reach users because of the scheme used
Yes, you are right. Moreover, the error log don't give any usefull information of what is happening. It should at least contain the field responsible for the error. I re-open the issue, waiting for an answer of Peertube maintainers :)
Hi,
This is a regression that should not happen anymore now we correctly compact data before sending it. We can add a field so plugins inject custom data in AP objects if it's needed, but please open a dedicated issue.
I'll also investigate how we can have faster plugin updates