YunoHost-Apps / peertube_ynh

Federated (ActivityPub) video streaming platform using P2P for YunoHost
https://joinpeertube.org/fr/
GNU Affero General Public License v3.0
87 stars 27 forks source link

Fails to retrieve lists of videos from other servers #283

Closed matlag closed 2 years ago

matlag commented 2 years ago

Describe the bug

Server fails to retrieve list of videos from other instances, error seen in logs. No longer receiving any new videos listing from any subscribed channel, from different instances. Can't get list of videos beyond time of upgrade from any followed instances

Context

Steps to reproduce

I believe this issue is related to the latest upgrade of the package, 3.4.1~ynh2

Expected behavior

Updated list of new videos in notification. Ability to see videos published after the upgrade by exploring videos.

Logs

journalctl reports, for every followed instance

Dec 01 11:08:28 myserver.ext peertube[29075]: [peertube.myserver.ext:443] 2021-12-01 11:08:28.104 info: Receiving inbox requests for 1 activities by https://followed.instance.ext/accounts/peertube.
Dec 01 11:08:28 myserver.ext peertube[29075]: [peertube.myserver.ext:443] 2021-12-01 11:08:28.106 info: 185.34.32.181 - - [01/Dec/2021:16:08:28 +0000] "POST /inbox HTTP/1.0" 204 - "-" "PeerTube/3.1.0 (+https://followed.instance.ext)"
Dec 01 11:08:28 myserver.ext peertube[29075]: [peertube.myserver.ext:443] 2021-12-01 11:08:28.107 info: Fetching remote video https://followed.instance.ext/videos/watch/7ea4a521-7bee-4243-847d-6a2f5e027855.
Dec 01 11:08:28 myserver.ext peertube[29075]: [peertube.myserver.ext:443] 2021-12-01 11:08:28.109 warn: Cannot process activity View. {
Dec 01 11:08:28 myserver.ext peertube[29075]:   "err": {
Dec 01 11:08:28 myserver.ext peertube[29075]:     "stack": "SystemError [ERR_SYSTEM_ERROR]: A system error occurred: uv_interface_addresses returned Unknown system error 97 (Unknown system error 97)\n    at Object.networkInterfaces (os.js:259:16)\n    at getIfaceInfo (/var/www/peertube/node_modules/cacheable-lookup/source/index.js:41:40)\n    at new CacheableLookup (/var/www/peertube/node_modules/cacheable-lookup/source/index.js:93:17)\n    at normalizeArguments (/var/www/peertube/node_modules/got/dist/source/core/index.js:590:34)\n    at got (/var/www/peertube/node_modules/got/dist/source/create.js:112:39)\n    at Object.doJSONRequest (/var/www/peertube/dist/server/helpers/requests.js:79:12)\n    at Object.<anonymous> (/var/www/peertube/dist/server/lib/activitypub/videos/shared/url-to-object.js:13:55)\n    at Generator.next (<anonymous>)\n    at /var/www/peertube/node_modules/tslib/tslib.js:117:75\n    at new Promise (<anonymous>)\n    at Object.__awaiter (/var/www/peertube/node_modules/tslib/tslib.js:113:16)\n    at Object.fetchRemoteVideo (/var/www/peertube/dist/server/lib/activitypub/videos/shared/url-to-object.js:11:20)\n    at Object.<anonymous> (/var/www/peertube/dist/server/lib/activitypub/videos/get.js:24:48)\n    at Generator.next (<anonymous>)\n    at fulfilled (/var/www/peertube/node_modules/tslib/tslib.js:114:62)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)",
Dec 01 11:08:28 myserver.ext peertube[29075]:     "message": "A system error occurred: uv_interface_addresses returned Unknown system error 97 (Unknown system error 97)",
Dec 01 11:08:28 myserver.ext peertube[29075]:     "name": "SystemError"
Dec 01 11:08:28 myserver.ext peertube[29075]:   }
Dec 01 11:08:28 myserver.ext peertube[29075]: }

Proposed solution

A very (same) issue occurred on Ghost package. Solution was to comment out an entry in the systemd service file:

#RestrictAddressFamilies disabled, prevents any write access on the app
#RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6

I have tested this, reloaded the systemd files, restarted peertube, and so far, no sign of this error anymore. I can see recent videos, from after the upgrade.

isAAAc commented 2 years ago

same issue to follow a new instance:

Dec 01 18:21:32 krashboyz.org peertube[9450]: [media.krashboyz.org:443] 2021-12-01 18:21:32.935 info: 82.65.0.0 - - [01/Dec/2021:17:21:32 +0000] "POST /api/v1/server/following HTTP/1.0" 204 - "https://media.krashboyz.org/admin/follows/following-list" "Firefox"
Dec 01 18:21:32 krashboyz.org peertube[9450]: [media.krashboyz.org:443] 2021-12-01 18:21:32.944 info: Processing ActivityPub follow in job 6.
Dec 01 18:21:33 krashboyz.org peertube[9450]: [media.krashboyz.org:443] 2021-12-01 18:21:33.931 info: Creating job to send follow request to https://tube.aquilenet.fr/accounts/peertube.
Dec 01 18:21:34 krashboyz.org peertube[9450]: [media.krashboyz.org:443] 2021-12-01 18:21:34.024 info: Processing ActivityPub unicast in job 215.
Dec 01 18:21:34 krashboyz.org peertube[9450]: [media.krashboyz.org:443] 2021-12-01 18:21:34.127 info: Updating 0 good actor follows and 1 bad actor follows scores in cache.
Dec 01 18:21:34 krashboyz.org peertube[9450]: [media.krashboyz.org:443] 2021-12-01 18:21:34.244 error: Cannot execute job 215 in queue activitypub-http-unicast. {
Dec 01 18:21:34 krashboyz.org peertube[9450]:   "payload": {
Dec 01 18:21:34 krashboyz.org peertube[9450]:     "uri": "https://tube.aquilenet.fr/accounts/peertube/inbox",
Dec 01 18:21:34 krashboyz.org peertube[9450]:     "signatureActorId": 1,
Dec 01 18:21:34 krashboyz.org peertube[9450]:     "body": {
Dec 01 18:21:34 krashboyz.org peertube[9450]:       "type": "Follow",
Dec 01 18:21:34 krashboyz.org peertube[9450]:       "id": "https://media.krashboyz.org/accounts/peertube/follows/1284",
Dec 01 18:21:34 krashboyz.org peertube[9450]:       "actor": "https://media.krashboyz.org/accounts/peertube",
Dec 01 18:21:34 krashboyz.org peertube[9450]:       "object": "https://tube.aquilenet.fr/accounts/peertube"
Dec 01 18:21:34 krashboyz.org peertube[9450]:     }
Dec 01 18:21:34 krashboyz.org peertube[9450]:   },
Dec 01 18:21:34 krashboyz.org peertube[9450]:   "err": {
Dec 01 18:21:34 krashboyz.org peertube[9450]:     "stack": "SystemError [ERR_SYSTEM_ERROR]: A system error occurred: uv_interface_addresses returned Unknown system error 97 (Unknown system error 97)\n    at Object.networkInterfaces (os.js:259:16)\n    at getIfaceInfo (/var/www/peertube/node_modules/cacheable-lookup/source/index.js:41:40)\n    at new CacheableLookup (/var/www/peertube/node_modules/cacheable-lookup/source/index.js:93:17)\n    at normalizeArguments (/var/www/peertube/node_modules/got/dist/source/core/index.js:590:34)\n    at got (/var/www/peertube/node_modules/got/dist/source/create.js:112:39)\n    at Object.doRequest (/var/www/peertube/dist/server/helpers/requests.js:73:12)\n    at Queue.<anonymous> (/var/www/peertube/dist/server/lib/job-queue/handlers/activitypub-http-unicast.js:23:30)\n    at Generator.next (<anonymous>)\n    at fulfilled (/var/www/peertube/node_modules/tslib/tslib.js:114:62)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)",
Dec 01 18:21:34 krashboyz.org peertube[9450]:     "message": "A system error occurred: uv_interface_addresses returned Unknown system error 97 (Unknown system error 97)",
Dec 01 18:21:34 krashboyz.org peertube[9450]:     "name": "SystemError"
Dec 01 18:21:34 krashboyz.org peertube[9450]:   }
Dec 01 18:21:34 krashboyz.org peertube[9450]: }
Dec 01 18:21:35 krashboyz.org peertube[9450]: [media.krashboyz.org:443] 2021-12-01 18:21:35.957 info: Updating live video views.
Dec 01 18:21:36 krashboyz.org peertube[9450]: [media.krashboyz.org:443] 2021-12-01 18:21:36.090 info: Creating job to update video https://media.krashboyz.org/videos/watch/fcaf351a-edb2-4298-b9e3-420b49da1028.
Dec 01 18:21:36 krashboyz.org peertube[9450]: [media.krashboyz.org:443] 2021-12-01 18:21:36.157 info: Processing ActivityPub broadcast in job 2278.
Dec 01 18:21:36 krashboyz.org peertube[9450]: [media.krashboyz.org:443] 2021-12-01 18:21:36.292 info: Updating 0 good actor follows and 30 bad actor follows scores in cache.
h3ndrik commented 2 years ago

same issue here. can confirm commenting out RestrictAddressFamilies also makes it work again for me. haven't had time to dig into it.

BDouze commented 2 years ago

I also had this error when testing the update of peertube to 4.0.0 After the upgrade peertube was failing to start. It seems it was having the error uv_interface_addresses returned Unknown system error 97 while testing connectivity to the mail server.

I have removed RestrictAddressFamilies from the systemd service file in the pull request I made to update peertube to 4.0.0 : https://github.com/YunoHost-Apps/peertube_ynh/pull/289/commits/05151573d0bb89b1b0f79281b0da68616fd6c3d1

fflorent commented 2 years ago

I propose another fix here: https://github.com/fflorent/peertube_ynh/commit/c31925604574cb53be2fb70a86cb799060e3a3a3

It keeps security in mind, but the caveat may be that other modules / situations / lines of code needs more permissions.