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.03k stars 1.5k forks source link

Expose database connection pool configuration #518

Closed ghost closed 6 years ago

ghost commented 6 years ago

When I start following peertube account from Mastodon instance my peertube instance throws this error

error: Cannot create remote actor and check signature. { "err": "TimeoutError: ResourceRequest timed out\n at ResourceRequest._fireTimeout (/var/www/peertube/versions/peertube-v1.0.0-beta.3/node_modules/generic-pool/lib/ResourceRequest.js:62:17)\n at Timeout.bound (/var/www/peertube/versions/peertube-v1.0.0-beta.3/node_modules/generic-pool/lib/ResourceRequest.js:8:15)\n at ontimeout (timers.js:482:11)\n at tryOnTimeout (timers.js:317:5)\n at Timer.listOnTimeout (timers.js:277:5)"

Thanks to point me to the right direction to solve this.

Chocobozzz commented 6 years ago

What is your Mastodon username/instance?

ghost commented 6 years ago

https://mastodont.cat/users/spla

Chocobozzz commented 6 years ago

On your peertube server, what is the output of curl -H 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams"' https://mastodont.cat/@spla?

ghost commented 6 years ago

{"@context":["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1",{"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","sensitive":"as:sensitive","movedTo":"as:movedTo","Hashtag":"as:Hashtag","ostatus":"http://ostatus.org#","atomUri":"ostatus:atomUri","inReplyToAtomUri":"ostatus:inReplyToAtomUri","conversation":"ostatus:conversation","toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","focalPoint":{"@container":"@list","@id":"toot:focalPoint"},"featured":"toot:featured"}],"id":"https://mastodont.cat/users/spla","type":"Person","following":"https://mastodont.cat/users/spla/following","followers":"https://mastodont.cat/users/spla/followers","inbox":"https://mastodont.cat/users/spla/inbox","outbox":"https://mastodont.cat/users/spla/outbox","featured":"https://mastodont.cat/users/spla/collections/featured","preferredUsername":"spla","name":"spla ✅","summary":"\u003cp\u003e\u003ca href=\"https://mastodont.cat\" rel=\"nofollow noopener\" target=\"_blank\"\u003e\u003cspan class=\"invisible\"\u003ehttps://\u003c/span\u003e\u003cspan class=\"\"\u003emastodont.cat\u003c/span\u003e\u003cspan class=\"invisible\"\u003e\u003c/span\u003e\u003c/a\u003e, la xarxa social per als catalans d’arreu.\u003c/p\u003e","url":"https://mastodont.cat/@spla","manuallyApprovesFollowers":false,"publicKey":{"id":"https://mastodont.cat/users/spla#main-key","owner":"https://mastodont.cat/users/spla","publicKeyPem":"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA08u9SxRE2ts2Ci970gut\nyHvctKvnI7zxa2GpCn0Qe/qpdvsxOHB9EX2GGe/7OoiglhBeD6Bq6HlhfMJR0C/d\nwENylTV/ctJEw4OfEqX3VxG++cnTvASoZ1JrZqyAcyIfNc3Joo+MU2Dwf32wegj9\nfsKJ5QBY598rHzvhl5Iv8UTJ0GcIkiMHbwxwtg0H9dLhF6TsKCdvSPLgSjP6Pjsn\n5QDYobhVjHC6ee8SjQsBoPbocCarlZYrhZ2Iuu6Cuclb5XyUUqDmd3fXMGyIOAaF\n1pE3VsuUndqhveXPCvx3KxNVzkrqrNF57lcWkgwLVRLt7FELghJpeRIyD30O9CTc\npQIDAQAB\n-----END PUBLIC KEY-----\n"},"endpoints":{"sharedInbox":"https://mastodont.cat/inbox"},"icon":{"type":"Image","mediaType":"image/jpeg","url":"https://mastodont.cat/system/accounts/avatars/000/000/001/original/b321c7c099a1a353727f91b55225f489.jpeg"},"image":{"type":"Image","mediaType":"image/jpeg","url":"https://mastodont.cat/system/accounts/headers/000/000/001/original/2babb6dcdfd0f186.jpeg"}}

Chocobozzz commented 6 years ago

:thinking:

What is your peertube instance url?

ghost commented 6 years ago

https://peertube.cat

ghost commented 6 years ago

I see now this error as you are checking

error: Error in controller. { "error": "TimeoutError: ResourceRequest timed out\n at ResourceRequest._fireTimeout (/var/www/peertube/versions/peertube-v1.0.0-beta.3/node_modules/generic-pool/lib/ResourceRequest.js:62:17)\n at Timeout.bound (/var/www/peertube/versions/peertube-v1.0.0-beta.3/node_modules/generic-pool/lib/ResourceRequest.js:8:15)\n at ontimeout (timers.js:482:11)\n at tryOnTimeout (timers.js:317:5)\n at Timer.listOnTimeout (timers.js:277:5)"

Chocobozzz commented 6 years ago

It seems to be a connection error with your database. Seems related to https://github.com/Chocobozzz/PeerTube/issues/424.

What is your setup? Dedicated server? The database is on the same server?

ghost commented 6 years ago

Yes. dedicated server with database in the very same server. mastodont.cat is also in the same server but different IP

Chocobozzz commented 6 years ago

If your Mastodon server uses the same PostgreSQL server than PeerTube, maybe our connection pool is too small (5 by default). I think we should expose it as a config parameter.

ghost commented 6 years ago

Yes, same PG server. I will do some tests increasing that parameter.

rigelk commented 6 years ago

@salvadorpla I know it's coming late, but if you still have the issue, could you try and see if #880 solves it?