Chocobozzz / PeerTube

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

502 Bad Gateway after upgrade from 4.0.0 to 4.1.0 #4827

Closed pat971 closed 2 years ago

pat971 commented 2 years ago

Hi :wave:

Describe the problem After upgrade from 4.0.0 to 4.1.0, i've a 502 error. I'm on Debian 10 (Buster) It's a non-docker installation

Provide the exact sequence of commands / steps that you executed before running into the problem

After the sql backup i made the upgrade with the script : cd /var/www/peertube/peertube-latest/scripts && sudo -H -u peertube ./upgrade.sh

There were no errors during the update. But in the browser there was a 502 error

result of sudo journalctl -eu peertube


peertube[28611]: npm ERR! code ELIFECYCLE
peertube[28611]: npm ERR! errno 1
peertube[28611]: npm ERR! peertube@4.1.0 start: `node dist/server`
peertube[28611]: npm ERR! Exit status 1
peertube[28611]: npm ERR!
peertube[28611]: npm ERR! Failed at the peertube@4.1.0 start script.
peertube[28611]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
peertube[28611]: npm ERR! A complete log of this run can be found in:
peertube[28611]: npm ERR!     /var/www/peertube/.npm/_logs/2022-03-02T03_19_50_215Z-debug.log
systemd[1]: peertube.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: peertube.service: Failed with result 'exit-code'.
systemd[1]: peertube.service: Service RestartSec=100ms expired, scheduling restart.
systemd[1]: peertube.service: Scheduled restart job, restart counter is at 126.
systemd[1]: Stopped PeerTube daemon.
systemd[1]: Started PeerTube daemon.
peertube[28649]: > peertube@4.1.0 start /var/www/peertube/versions/peertube-v4.1.0
peertube[28649]: > node dist/server

debug log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using npm@6.14.16
3 info using node@v14.19.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle peertube@4.1.0~prestart: peertube@4.1.0
6 info lifecycle peertube@4.1.0~start: peertube@4.1.0
7 verbose lifecycle peertube@4.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle peertube@4.1.0~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/www/peertube/versions/peertube-v4.1.0/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
9 verbose lifecycle peertube@4.1.0~start: CWD: /var/www/peertube/versions/peertube-v4.1.0
10 silly lifecycle peertube@4.1.0~start: Args: [ '-c', 'node dist/server' ]
11 silly lifecycle peertube@4.1.0~start: Returned: code: 1  signal: null
12 info lifecycle peertube@4.1.0~start: Failed to exec start script
13 verbose stack Error: peertube@4.1.0 start: `node dist/server`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:400:28)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:400:28)
13 verbose stack     at maybeClose (internal/child_process.js:1058:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
14 verbose pkgid peertube@4.1.0
15 verbose cwd /var/www/peertube/versions/peertube-v4.1.0
16 verbose Linux 4.19.0-14-amd64
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v14.19.0
19 verbose npm  v6.14.16
20 error code ELIFECYCLE
21 error errno 1
22 error peertube@4.1.0 start: `node dist/server`
22 error Exit status 1
23 error Failed at the peertube@4.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Additional information

Chocobozzz commented 2 years ago

Hi,

Try to run peertube manually:

NODE_ENV=production NODE_CONFIG_DIR=/var/www/peertube/config /usr/bin/node dist/server

To have a better logs

pat971 commented 2 years ago

Result after NODE_ENV=production NODE_CONFIG_DIR=/var/www/peertube/config /usr/bin/node dist/server

[mydomain:443] 2022-03-02 10:53:52.331 info: Database peertube_prod is ready.
[mydomain:443] 2022-03-02 10:53:52.559 info: Using smtpserver:587 as SMTP server.
[mydomain:443] 2022-03-02 10:53:52.562 info: Testing SMTP server...
[mydomain:443] 2022-03-02 10:53:52.757 info: Connection established to remoteip:587 {
  "component": "smtp-connection",
  "sid": "dzIwlO5yVg",
  "tnx": "network",
  "localAddress": "myip",
  "localPort": 44618,
  "remoteAddress": "remoteip",
  "remotePort": 587
}
[mydomain:443] 2022-03-02 10:53:53.217 info: Connection upgraded with STARTTLS {
  "component": "smtp-connection",
  "sid": "dzIwlO5yVg",
  "tnx": "smtp"
}
[mydomain:443] 2022-03-02 10:53:53.638 info: User "user@mydomain" authenticated {
  "component": "smtp-connection",
  "sid": "dzIwlO5yVg",
  "tnx": "smtp",
  "username": "kontak@mydomain",
  "action": "authenticated",
  "method": "LOGIN"
}
[mydomain:443] 2022-03-02 10:53:53.640 info: Successfully connected to SMTP server.
[mydomain:443] 2022-03-02 10:53:53.653 info: Connecting to redis...
[mydomain:443] 2022-03-02 10:53:53.658 info: Running RTMP server on port 1935
[mydomain:443] 2022-03-02 10:53:53.665 info: Cleaning HTML cache.
[mydomain:443] 2022-03-02 10:53:53.668 info: Connected to redis.
[mydomain:443] 2022-03-02 10:53:53.672 info: Registering plugin or theme peertube-theme-black-red.
[mydomain:443] 2022-03-02 10:53:53.681 info: Registering plugin or theme peertube-theme-dark.
[mydomain:443] 2022-03-02 10:53:53.683 info: Registering plugin or theme peertube-theme-bittube-dark-mode.
[mydomain:443] 2022-03-02 10:53:53.684 info: HTTP server listening on localhost:9000
[mydomain:443] 2022-03-02 10:53:53.684 info: Web server: https://mydomain
[mydomain:443] 2022-03-02 10:53:53.725 info: Connection closed {
  "component": "smtp-connection",
  "sid": "dzIwlO5yVg",
  "tnx": "network"
}
[mydomain:443] 2022-03-02 10:53:55.831 error: uncaughtException: Socket closed unexpectedly
Error: Socket closed unexpectedly
    at Socket.<anonymous> (/var/www/peertube/versions/peertube-v4.1.0/node_modules/@node-redis/client/dist/lib/client/socket.js:182:118)
    at Object.onceWrapper (events.js:520:26)
    at Socket.emit (events.js:400:28)
    at Socket.emit (domain.js:475:12)
    at TCP.<anonymous> (net.js:686:12) {
  "error": {
    "stack": "Error: Socket closed unexpectedly\n    at Socket.<anonymous> (/var/www/peertube/versions/peertube-v4.1.0/node_modules/@node-redis/client/dist/lib/client/socket.js:182:118)\n    at Object.onceWrapper (events.js:520:26)\n    at Socket.emit (events.js:400:28)\n    at Socket.emit (domain.js:475:12)\n    at TCP.<anonymous> (net.js:686:12)",
    "message": "Socket closed unexpectedly"
  },
  "stack": "Error: Socket closed unexpectedly\n    at Socket.<anonymous> (/var/www/peertube/versions/peertube-v4.1.0/node_modules/@node-redis/client/dist/lib/client/socket.js:182:118)\n    at Object.onceWrapper (events.js:520:26)\n    at Socket.emit (events.js:400:28)\n    at Socket.emit (domain.js:475:12)\n    at TCP.<anonymous> (net.js:686:12)",
  "exception": true,
  "date": "Wed Mar 02 2022 10:53:55 GMT+0000 (Coordinated Universal Time)",
  "process": {
    "pid": 7931,
    "uid": 1002,
    "gid": 1002,
    "cwd": "/var/www/peertube/versions/peertube-v4.1.0",
    "execPath": "/usr/bin/node",
    "version": "v14.19.0",
    "argv": [
      "/usr/bin/node",
      "/var/www/peertube/versions/peertube-v4.1.0/dist/server"
    ],
    "memoryUsage": {
      "rss": 202031104,
      "heapTotal": 147562496,
      "heapUsed": 119705984,
      "external": 3911811,
      "arrayBuffers": 1546513
    }
  },
  "os": {
    "loadavg": [
      0.63,
      0.6,
      0.54
    ],
    "uptime": 692769.55
  },
  "trace": [
    {
      "column": 118,
      "file": "/var/www/peertube/versions/peertube-v4.1.0/node_modules/@node-redis/client/dist/lib/client/socket.js",
      "function": null,
      "line": 182,
      "method": null,
      "native": false
    },
    {
      "column": 26,
      "file": "events.js",
      "function": "Object.onceWrapper",
      "line": 520,
      "method": "onceWrapper",
      "native": false
    },
    {
      "column": 28,
      "file": "events.js",
      "function": "Socket.emit",
      "line": 400,
      "method": "emit",
      "native": false
    },
    {
      "column": 12,
      "file": "domain.js",
      "function": "Socket.emit",
      "line": 475,
      "method": "emit",
      "native": false
    },
    {
      "column": 12,
      "file": "net.js",
      "function": null,
      "line": 686,
      "method": null,
      "native": false
    }
  ]
}
Chocobozzz commented 2 years ago

It seems there is an issue with the Redis connection. Can you check it is running and you correctly configured it in peertube config?

pat971 commented 2 years ago

I'm sorry I don't know anything about Redis result sudo systemctl status redis-server

● redis-server.service - Advanced key-value store
   Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2022-03-02 17:32:45 UTC; 14min ago
     Docs: http://redis.io/documentation,
           man:redis-server(1)
  Process: 13316 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=0/SUCCESS)
 Main PID: 13318 (redis-server)
    Tasks: 4 (limit: 4915)
   Memory: 58.7M
   CGroup: /system.slice/redis-server.service
           └─13318 /usr/bin/redis-server 127.0.0.1:6379

Mar 02 17:32:44  systemd[1]: Starting Advanced key-value store...
Mar 02 17:32:45  systemd[1]: redis-server.service: Can't open PID file /run/redis/redis-server.pid (yet?) after start: No such file or directory
Mar 02 17:32:45  systemd[1]: Started Advanced key-value store.

I kept the default peertube config

redis:
  hostname: 'localhost'
  port: 6379
  auth: null
  db: 0
Chocobozzz commented 2 years ago

Try to set 127.0.0.1 instead of localhost

If it still doesn't work, try to search in redis logs if it sees the peertube connectionn (https://stackoverflow.com/questions/16337107/how-to-access-redis-log-file)

pat971 commented 2 years ago

To be precise, since the update I don't have the 502 every time. When I refresh, sometimes the instance page is displayed but without the videos with a message in the bottom right corner. "Error Could not load more videos. Try again later". Sometimes the videos are displayed but when I click on a video I get the error page 502

I changed hostname to 127.0.0.1, same result

redis log :

32420:C 03 Mar 2022 15:47:12.668 * RDB: 8 MB of memory used by copy-on-write
13318:M 03 Mar 2022 15:47:12.675 * Background saving terminated with success
13318:M 03 Mar 2022 15:52:13.065 * 10 changes in 300 seconds. Saving...
13318:M 03 Mar 2022 15:52:13.066 * Background saving started by pid 599
599:C 03 Mar 2022 15:52:13.598 * DB saved on disk
599:C 03 Mar 2022 15:52:13.601 * RDB: 7 MB of memory used by copy-on-write
13318:M 03 Mar 2022 15:52:13.668 * Background saving terminated with success
13318:M 03 Mar 2022 15:57:14.088 * 10 changes in 300 seconds. Saving...
13318:M 03 Mar 2022 15:57:14.091 * Background saving started by pid 1927
1927:C 03 Mar 2022 15:57:14.612 * DB saved on disk
1927:C 03 Mar 2022 15:57:14.615 * RDB: 9 MB of memory used by copy-on-write
13318:M 03 Mar 2022 15:57:14.696 * Background saving terminated with success
13318:M 03 Mar 2022 16:02:15.025 * 10 changes in 300 seconds. Saving...
13318:M 03 Mar 2022 16:02:15.028 * Background saving started by pid 3045
3045:C 03 Mar 2022 16:02:15.564 * DB saved on disk
3045:C 03 Mar 2022 16:02:15.568 * RDB: 9 MB of memory used by copy-on-write
13318:M 03 Mar 2022 16:02:15.629 * Background saving terminated with success
13318:M 03 Mar 2022 16:07:16.046 * 10 changes in 300 seconds. Saving...
13318:M 03 Mar 2022 16:07:16.049 * Background saving started by pid 4161
4161:C 03 Mar 2022 16:07:16.582 * DB saved on disk
4161:C 03 Mar 2022 16:07:16.584 * RDB: 9 MB of memory used by copy-on-write
13318:M 03 Mar 2022 16:07:16.653 * Background saving terminated with success

result redis-cli monitor

1646323548.354679 [0 lua] "ZRANGEBYSCORE" "bull-mydomain:activitypub-http-broadcast:delayed" "0" "6743341254053888" "LIMIT" "0" "1000"
1646323548.354742 [0 lua] "ZRANGE" "bull-mydomain:activitypub-http-broadcast:delayed" "0" "0" "WITHSCORES"
1646323548.355719 [0 127.0.0.1:54132] "evalsha" "8b912cdc5b4c20108ef73d952464fba3a7470d7b" "6" "bull-mydomain:activitypub-http-fetcher:delayed" "bull-mydomain:activitypub-http-fetcher:active" "bull-mydomain:activitypub-http-fetcher:wait" "bull-mydomain:activitypub-http-fetcher:priority" "bull-mydomain:activitypub-http-fetcher:paused" "bull-mydomain:activitypub-http-fetcher:meta-paused" "bull-mydomain:activitypub-http-fetcher:" "1646323548355" "b28b7c12-b5f4-43dc-bef5-c5886daa0662"
1646323548.355992 [0 lua] "ZRANGEBYSCORE" "bull-mydomain:activitypub-http-fetcher:delayed" "0" "6743341254062080" "LIMIT" "0" "1000"
1646323548.356053 [0 lua] "ZRANGE" "bull-mydomain:activitypub-http-fetcher:delayed" "0" "0" "WITHSCORES"
1646323548.356265 [0 127.0.0.1:54140] "evalsha" "8b912cdc5b4c20108ef73d952464fba3a7470d7b" "6" "bull-mydomain:activitypub-http-unicast:delayed" "bull-mydomain:activitypub-http-unicast:active" "bull-mydomain:activitypub-http-unicast:wait" "bull-mydomain:activitypub-http-unicast:priority" "bull-mydomain:activitypub-http-unicast:paused" "bull-mydomain:activitypub-http-unicast:meta-paused" "bull-mydomain:activitypub-http-unicast:" "1646323548355" "99d52396-0108-47df-8a81-a4846d2460a8"
1646323548.356515 [0 lua] "ZRANGEBYSCORE" "bull-mydomain:activitypub-http-unicast:delayed" "0" "6743341254062080" "LIMIT" "0" "1000"
1646323548.356571 [0 lua] "ZRANGE" "bull-mydomain:activitypub-http-unicast:delayed" "0" "0" "WITHSCORES"
1646323548.356641 [0 127.0.0.1:54126] "evalsha" "8b912cdc5b4c20108ef73d952464fba3a7470d7b" "6" "bull-mydomain:video-file-import:delayed" "bull-mydomain:video-file-import:active" "bull-mydomain:video-file-import:wait" "bull-mydomain:video-file-import:priority" "bull-mydomain:video-file-import:paused" "bull-mydomain:video-file-import:meta-paused" "bull-mydomain:video-file-import:" "1646323548355" "276c6b2b-cde9-42d8-8a98-82ffd13f7e15"
1646323548.356860 [0 lua] "ZRANGEBYSCORE" "bull-mydomain:video-file-import:delayed" "0" "6743341254062080" "LIMIT" "0" "1000"
1646323548.356911 [0 lua] "ZRANGE" "bull-mydomain:video-file-import:delayed" "0" "0" "WITHSCORES"
1646323548.357108 [0 127.0.0.1:54128] "evalsha" "8b912cdc5b4c20108ef73d952464fba3a7470d7b" "6" "bull-mydomain:activitypub-follow:delayed" "bull-mydomain:activitypub-follow:active" "bull-mydomain:activitypub-follow:wait" "bull-mydomain:activitypub-follow:priority" "bull-mydomain:activitypub-follow:paused" "bull-mydomain:activitypub-follow:meta-paused" "bull-mydomain:activitypub-follow:" "1646323548356" "8b892d3c-c30c-4a05-9480-0506d4d7f872"
1646323548.357335 [0 lua] "ZRANGEBYSCORE" "bull-mydomain:activitypub-follow:delayed" "0" "6743341254066176" "LIMIT" "0" "1000"
1646323548.357388 [0 lua] "ZRANGE" "bull-mydomain:activitypub-follow:delayed" "0" "0" "WITHSCORES"
1646323548.357455 [0 127.0.0.1:54134] "evalsha" "8b912cdc5b4c20108ef73d952464fba3a7470d7b" "6" "bull-mydomain:activitypub-cleaner:delayed" "bull-mydomain:activitypub-cleaner:active" "bull-mydomain:activitypub-cleaner:wait" "bull-mydomain:activitypub-cleaner:priority" "bull-mydomain:activitypub-cleaner:paused" "bull-mydomain:activitypub-cleaner:meta-paused" "bull-mydomain:activitypub-cleaner:" "1646323548356" "42a539ae-4633-415e-8c5a-f632ce7944ac"
1646323548.357701 [0 lua] "ZRANGEBYSCORE" "bull-mydomain:activitypub-cleaner:delayed" "0" "6743341254066176" "LIMIT" "0" "1000"
1646323548.357753 [0 lua] "ZRANGE" "bull-mydomain:activitypub-cleaner:delayed" "0" "0" "WITHSCORES"
1646323548.357950 [0 127.0.0.1:54154] "evalsha" "8b912cdc5b4c20108ef73d952464fba3a7470d7b" "6" "bull-mydomain:videos-views-stats:delayed" "bull-mydomain:videos-views-stats:active" "bull-mydomain:videos-views-stats:wait" "bull-mydomain:videos-views-stats:priority" "bull-mydomain:videos-views-stats:paused" "bull-mydomain:videos-views-stats:meta-paused" "bull-mydomain:videos-views-stats:" "1646323548356" "35093077-7aa8-4639-a745-0a27f235efb1"
1646323548.358174 [0 lua] "ZRANGEBYSCORE" "bull-mydomain:videos-views-stats:delayed" "0" "6743341254066176" "LIMIT" "0" "1000"
1646323548.358231 [0 lua] "ZRANGE" "bull-mydomain:videos-views-stats:delayed" "0" "0" "WITHSCORES"
1646323548.358288 [0 lua] "PUBLISH" "bull-mydomain:videos-views-stats:delayed" "1646323560000.145"
1646323548.358968 [0 127.0.0.1:54130] "evalsha" "8b912cdc5b4c20108ef73d952464fba3a7470d7b" "6" "bull-mydomain:video-transcoding:delayed" "bull-mydomain:video-transcoding:active" "bull-mydomain:video-transcoding:wait" "bull-mydomain:video-transcoding:priority" "bull-mydomain:video-transcoding:paused" "bull-mydomain:video-transcoding:meta-paused" "bull-mydomain:video-transcoding:" "1646323548358" "077939ce-66f2-433c-861d-5a6ffbddc556"
1646323548.359221 [0 lua] "ZRANGEBYSCORE" "bull-mydomain:video-transcoding:delayed" "0" "6743341254074368" "LIMIT" "0" "1000"
1646323548.359278 [0 lua] "ZRANGE" "bull-mydomain:video-transcoding:delayed" "0" "0" "WITHSCORES"
1646323548.359744 [0 127.0.0.1:54150] "evalsha" "8b912cdc5b4c20108ef73d952464fba3a7470d7b" "6" "bull-mydomain:video-import:delayed" "bull-mydomain:video-import:active" "bull-mydomain:video-import:wait" "bull-mydomain:video-import:priority" "bull-mydomain:video-import:paused" "bull-mydomain:video-import:meta-paused" "bull-mydomain:video-import:" "1646323548358" "913c83bf-4b99-49fa-b1ad-13b3a3ee2863"
1646323548.359961 [0 lua] "ZRANGEBYSCORE" "bull-mydomain:video-import:delayed" "0" "6743341254074368" "LIMIT" "0" "1000"
1646323548.360012 [0 lua] "ZRANGE" "bull-mydomain:video-import:delayed" "0" "0" "WITHSCORES"
1646323548.360073 [0 127.0.0.1:54152] "evalsha" "8b912cdc5b4c20108ef73d952464fba3a7470d7b" "6" "bull-mydomain:email:delayed" "bull-mydomain:email:active" "bull-mydomain:email:wait" "bull-mydomain:email:priority" "bull-mydomain:email:paused" "bull-mydomain:email:meta-paused" "bull-mydomain:email:" "1646323548359" "dd3602a6-1015-4d45-98d2-db5009182214"
1646323548.360255 [0 lua] "ZRANGEBYSCORE" "bull-mydomain:email:delayed" "0" "6743341254078464" "LIMIT" "0" "1000"
1646323548.360302 [0 lua] "ZRANGE" "bull-mydomain:email:delayed" "0" "0" "WITHSCORES"
1646323548.360362 [0 127.0.0.1:54146] "evalsha" "8b912cdc5b4c20108ef73d952464fba3a7470d7b" "6" "bull-mydomain:activitypub-refresher:delayed" "bull-mydomain:activitypub-refresher:active" "bull-mydomain:activitypub-refresher:wait" "bull-mydomain:activitypub-refresher:priority" "bull-mydomain:activitypub-refresher:paused" "bull-mydomain:activitypub-refresher:meta-paused" "bull-mydomain:activitypub-refresher:" "1646323548359" "27b94e23-fcaa-4d14-a56a-2f9f66e12121"
1646323548.360589 [0 lua] "ZRANGEBYSCORE" "bull-mydomain:activitypub-refresher:delayed" "0" "6743341254078464" "LIMIT" "0" "1000"
1646323548.360642 [0 lua] "ZRANGE" "bull-mydomain:activitypub-refresher:delayed" "0" "0" "WITHSCORES"
1646323548.360869 [0 127.0.0.1:54138] "evalsha" "8b912cdc5b4c20108ef73d952464fba3a7470d7b" "6" "bull-mydomain:actor-keys:delayed" "bull-mydomain:actor-keys:active" "bull-mydomain:actor-keys:wait" "bull-mydomain:actor-keys:priority" "bull-mydomain:actor-keys:paused" "bull-mydomain:actor-keys:meta-paused" "bull-mydomain:actor-keys:" "1646323548359" "5c15f875-45d5-4f4b-9b96-fd2075d9e856"
1646323548.361070 [0 lua] "ZRANGEBYSCORE" "bull-mydomain:actor-keys:delayed" "0" "6743341254078464" "LIMIT" "0" "1000"
1646323548.361119 [0 lua] "ZRANGE" "bull-mydomain:actor-keys:delayed" "0" "0" "WITHSCORES"
1646323548.361181 [0 127.0.0.1:54148] "evalsha" "8b912cdc5b4c20108ef73d952464fba3a7470d7b" "6" "bull-mydomain:video-live-ending:delayed" "bull-mydomain:video-live-ending:active" "bull-mydomain:video-live-ending:wait" "bull-mydomain:video-live-ending:priority" "bull-mydomain:video-live-ending:paused" "bull-mydomain:video-live-ending:meta-paused" "bull-mydomain:video-live-ending:" "1646323548359" "a40b3271-ad8a-4d35-be72-368ffe9ebcb5"
1646323548.361397 [0 lua] "ZRANGEBYSCORE" "bull-mydomain:video-live-ending:delayed" "0" "6743341254078464" "LIMIT" "0" "1000"
1646323548.361449 [0 lua] "ZRANGE" "bull-mydomain:video-live-ending:delayed" "0" "0" "WITHSCORES"
1646323548.361659 [0 127.0.0.1:54144] "evalsha" "8b912cdc5b4c20108ef73d952464fba3a7470d7b" "6" "bull-mydomain:move-to-object-storage:delayed" "bull-mydomain:move-to-object-storage:active" "bull-mydomain:move-to-object-storage:wait" "bull-mydomain:move-to-object-storage:priority" "bull-mydomain:move-to-object-storage:paused" "bull-mydomain:move-to-object-storage:meta-paused" "bull-mydomain:move-to-object-storage:" "1646323548361" "e6718715-1705-42b5-9b54-7916b1d8b1e6"
1646323548.361897 [0 lua] "ZRANGEBYSCORE" "bull-mydomain:move-to-object-storage:delayed" "0" "6743341254086656" "LIMIT" "0" "1000"
1646323548.361952 [0 lua] "ZRANGE" "bull-mydomain:move-to-object-storage:delayed" "0" "0" "WITHSCORES"
1646323548.362119 [0 127.0.0.1:54142] "evalsha" "8b912cdc5b4c20108ef73d952464fba3a7470d7b" "6" "bull-mydomain:video-redundancy:delayed" "bull-mydomain:video-redundancy:active" "bull-mydomain:video-redundancy:wait" "bull-mydomain:video-redundancy:priority" "bull-mydomain:video-redundancy:paused" "bull-mydomain:video-redundancy:meta-paused" "bull-mydomain:video-redundancy:" "1646323548361" "c3fe23ee-f167-43c3-8a69-b6d65cf2523a"
1646323548.362337 [0 lua] "ZRANGEBYSCORE" "bull-mydomain:video-redundancy:delayed" "0" "6743341254086656" "LIMIT" "0" "1000"
1646323548.362389 [0 lua] "ZRANGE" "bull-mydomain:video-redundancy:delayed" "0" "0" "WITHSCORES"
1646323548.621229 [0 127.0.0.1:54090] "brpoplpush" "bull-mydomain:video-live-ending:wait" "bull-mydomain:video-live-ending:active" "5"
1646323548.622746 [0 127.0.0.1:54088] "brpoplpush" "bull-mydomain:move-to-object-storage:wait" "bull-mydomain:move-to-object-storage:active" "5"
1646323548.623674 [0 127.0.0.1:54092] "brpoplpush" "bull-mydomain:video-redundancy:wait" "bull-mydomain:video-redundancy:active" "5"
1646323548.723022 [0 127.0.0.1:54080] "brpoplpush" "bull-mydomain:activitypub-refresher:wait" "bull-mydomain:activitypub-refresher:active" "5"
1646323548.723437 [0 127.0.0.1:54082] "brpoplpush" "bull-mydomain:actor-keys:wait" "bull-mydomain:actor-keys:active" "5"
1646323548.723978 [0 127.0.0.1:54084] "brpoplpush" "bull-mydomain:activitypub-cleaner:wait" "bull-mydomain:activitypub-cleaner:active" "5"
1646323548.724270 [0 127.0.0.1:54086] "brpoplpush" "bull-mydomain:activitypub-follow:wait" "bull-mydomain:activitypub-follow:active" "5"
1646323548.822807 [0 127.0.0.1:54078] "brpoplpush" "bull-mydomain:email:wait" "bull-mydomain:email:active" "5"
1646323548.822864 [0 127.0.0.1:54076] "brpoplpush" "bull-mydomain:video-import:wait" "bull-mydomain:video-import:active" "5"
1646323548.822915 [0 127.0.0.1:54074] "brpoplpush" "bull-mydomain:video-transcoding:wait" "bull-mydomain:video-transcoding:active" "5"
1646323548.823834 [0 127.0.0.1:54070] "brpoplpush" "bull-mydomain:video-file-import:wait" "bull-mydomain:video-file-import:active" "5"
1646323548.824292 [0 127.0.0.1:54072] "brpoplpush" "bull-mydomain:videos-views-stats:wait" "bull-mydomain:videos-views-stats:active" "5"
1646323548.923121 [0 127.0.0.1:54068] "brpoplpush" "bull-mydomain:activitypub-http-unicast:wait" "bull-mydomain:activitypub-http-unicast:active" "5"
1646323548.923208 [0 127.0.0.1:54066] "brpoplpush" "bull-mydomain:activitypub-http-fetcher:wait" "bull-mydomain:activitypub-http-fetcher:active" "5"
1646323548.924011 [0 127.0.0.1:54064] "brpoplpush" "bull-mydomain:activitypub-http-broadcast:wait" "bull-mydomain:activitypub-http-broadcast:active" "5"
lukaprincic commented 2 years ago

I just had a similar problem - not sure if it's related. It was a fresh install of 4.1.0 on an Ubuntu focal. error bad gateway was solved with changing 127.0.0.1 to localhost in nginx configuration for upstream backend:

upstream backend {
  # server 127.0.0.1:9000;
  server localhost:9000;
}

I think this should be fixed.

Chocobozzz commented 2 years ago

To be precise, since the update I don't have the 502 every time. When I refresh, sometimes the instance page is displayed but without the videos with a message in the bottom right corner. "Error Could not load more videos. Try again later". Sometimes the videos are displayed but when I click on a video I get the error page 502

Then is it the same error displayed in peertube logs regarding redis?

oxzi commented 2 years ago

The other day I have experienced a similar bug, whereby I am not sure whether it was the same one. My Redis configuration had a timeout of 300 seconds and Peertube restarted almost every five minutes (300 seconds) with a similar exception. Changing the timeout to 0 "fixed" this issue for me. On second thought, this might not really be related, but perhaps somebody with this problem will stumble about this comment.

oxzi commented 2 years ago

Please excuse the second comment.

Another thing I did, was switching to an Unix domain socket. @pat971, you might wanna try doing the same and check if it still errors.

pat971 commented 2 years ago

I'm really sorry. I was out of touch for a very long time πŸ™πŸΎ I tried to upgrade to version 4.2.0 and had the same problem. I took @oxzi 's advice and it worked.

For those who would have the same problem (debian / ubuntu):

sudo nano /etc/redis/redis.conf

Look for the line timeout

By default (maybe I changed it without remembering) it is : image

Change to 0 : image

Quit, save & restart redis :

sudo systemctl restart redis

Thank you for your help @oxzi @Chocobozzz πŸ™πŸΎπŸ™‚