nextcloud / social

šŸŽ‰ Social can be used for work, or to connect to the fediverse!
https://apps.nextcloud.com/apps/social
GNU Affero General Public License v3.0
489 stars 59 forks source link

Increase the size of the source column #175

Closed tcitworld closed 5 years ago

tcitworld commented 5 years ago

Describe the bug The source column width in the oc_social_cache_actors table (can probably be the same with the oc_social_server_notes table) is too low.

To Reproduce Steps to reproduce the behavior:

  1. Send a follow your account from a Mastodon account so that my remote actor is inserted into oc_social_cache_actors.

Expected behavior Actor is successfully inserted

Actual behavior

String data, right truncated: 7 ERREUR: valeur trop longue pour le type character varying

(french saying the data is basically too long).

Workaround Setting the column to varchar(5000) fixed it.

Server details **Social app version:** 0.1.0 **Operating system**: Debian **Web server:** nginx **Database:** PostgreSQL 11.1 **PHP version:** 7.3 **Nextcloud version:** (see Nextcloud admin page) 15.0.0 RC 3
Logs #### Nextcloud log (data/nextcloud.log) ``` 500 - {"status":-1,"exception":"OCA\\Social\\Exceptions\\InvalidResourceException","message":"An exception occurred while executing 'INSERT INTO \"oc_social_cache_actors\" (\"id\", \"account\", \"type\", \"local\", \"following\", \"followers\", \"inbox\", \"shared_inbox\", \"outbox\", \"featured\", \"url\", \"preferred_username\", \"name\", \"summary\", \"public_key\", \"source\", \"details\", \"creation\", \"icon_id\") VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [\"https:\\\/\\\/social.tcit.fr\\\/users\\\/tcit\", \"tcit@social.tcit.fr\", \"Person\", \"0\", \"https:\\\/\\\/social.tcit.fr\\\/users\\\/tcit\\\/following\", \"https:\\\/\\\/social.tcit.fr\\\/users\\\/tcit\\\/followers\", \"https:\\\/\\\/social.tcit.fr\\\/users\\\/tcit\\\/inbox\", \"https:\\\/\\\/social.tcit.fr\\\/inbox\", \"https:\\\/\\\/social.tcit.fr\\\/users\\\/tcit\\\/outbox\", \"https:\\\/\\\/social.tcit.fr\\\/users\\\/tcit\\\/collections\\\/featured\", \"https:\\\/\\\/social.tcit.fr\\\/@tcit\", \"tcit\", \"\\ud83e\\udd84 Thomas Citharel\", \"Hoping to make people's life better with free software at @Framasoft.\", \"-----BEGIN PUBLIC KEY-----\\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApXwYMUdFg3XUd+bGsh8C\\nyiMRGpRGAWuCdM5pDWx5uM4pW2pM3xbHbcI21j9h8BmlAiPg6hbZD73KGly2N8Rt\\n5iIS0I+l6i8kA1JCCdlAaDTRd41RKMggZDoQvjVZQtsyE1VzMeU2kbqqTFN6ew7H\\nvbd6O0NhixoKoZ5f3jwuBDZoT0p1TAcaMdmG8oqHD97isizkDnRn8cOBA6wtI+xb\\n5xP2zxZMsLpTDZLiKU8XcPKZCw4OfQfmDmKkHtrFb77jCAQj\\\/s\\\/FxjVnvxRwmfhN\\nnWy0D+LUV\\\/g63nHh\\\/b5zXIeV92QZLvDYbgbezmzUzv9UeA1s70GGbaDqCIy85gw9\\n+wIDAQAB\\n-----END PUBLIC KEY-----\\n\", \"{\\\"@context\\\":[\\\"https:\\\/\\\/www.w3.org\\\/ns\\\/activitystreams\\\",\\\"https:\\\/\\\/w3id.org\\\/security\\\/v1\\\",{\\\"manuallyApprovesFollowers\\\":\\\"as:manuallyApprovesFollowers\\\",\\\"sensitive\\\":\\\"as:sensitive\\\",\\\"movedTo\\\":{\\\"@id\\\":\\\"as:movedTo\\\",\\\"@type\\\":\\\"@id\\\"},\\\"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\\\":{\\\"@id\\\":\\\"toot:featured\\\",\\\"@type\\\":\\\"@id\\\"},\\\"schema\\\":\\\"http:\\\/\\\/schema.org#\\\",\\\"PropertyValue\\\":\\\"schema:PropertyValue\\\",\\\"value\\\":\\\"schema:value\\\"}],\\\"id\\\":\\\"https:\\\/\\\/social.tcit.fr\\\/users\\\/tcit\\\",\\\"type\\\":\\\"Person\\\",\\\"following\\\":\\\"https:\\\/\\\/social.tcit.fr\\\/users\\\/tcit\\\/following\\\",\\\"followers\\\":\\\"https:\\\/\\\/social.tcit.fr\\\/users\\\/tcit\\\/followers\\\",\\\"inbox\\\":\\\"https:\\\/\\\/social.tcit.fr\\\/users\\\/tcit\\\/inbox\\\",\\\"outbox\\\":\\\"https:\\\/\\\/social.tcit.fr\\\/users\\\/tcit\\\/outbox\\\",\\\"featured\\\":\\\"https:\\\/\\\/social.tcit.fr\\\/users\\\/tcit\\\/collections\\\/featured\\\",\\\"preferredUsername\\\":\\\"tcit\\\",\\\"name\\\":\\\"\\\\ud83e\\\\udd84 Thomas Citharel\\\",\\\"summary\\\":\\\"

Hoping to make people's life better with free software at @Framasoft<\\\/span><\\\/a><\\\/span>.<\\\/p>\\\",\\\"url\\\":\\\"https:\\\/\\\/social.tcit.fr\\\/@tcit\\\",\\\"manuallyApprovesFollowers\\\":false,\\\"publicKey\\\":{\\\"id\\\":\\\"https:\\\/\\\/social.tcit.fr\\\/users\\\/tcit#main-key\\\",\\\"owner\\\":\\\"https:\\\/\\\/social.tcit.fr\\\/users\\\/tcit\\\",\\\"publicKeyPem\\\":\\\"-----BEGIN PUBLIC KEY-----\\\\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApXwYMUdFg3XUd+bGsh8C\\\\nyiMRGpRGAWuCdM5pDWx5uM4pW2pM3xbHbcI21j9h8BmlAiPg6hbZD73KGly2N8Rt\\\\n5iIS0I+l6i8kA1JCCdlAaDTRd41RKMggZDoQvjVZQtsyE1VzMeU2kbqqTFN6ew7H\\\\nvbd6O0NhixoKoZ5f3jwuBDZoT0p1TAcaMdmG8oqHD97isizkDnRn8cOBA6wtI+xb\\\\n5xP2zxZMsLpTDZLiKU8XcPKZCw4OfQfmDmKkHtrFb77jCAQj\\\/s\\\/FxjVnvxRwmfhN\\\\nnWy0D+LUV\\\/g63nHh\\\/b5zXIeV92QZLvDYbgbezmzUzv9UeA1s70GGbaDqCIy85gw9\\\\n+wIDAQAB\\\\n-----END PUBLIC KEY-----\\\\n\\\"},\\\"tag\\\":[],\\\"attachment\\\":[{\\\"type\\\":\\\"PropertyValue\\\",\\\"name\\\":\\\"Works at\\\",\\\"value\\\":\\\"@Framasoft<\\\/span><\\\/a><\\\/span>\\\"},{\\\"type\\\":\\\"PropertyValue\\\",\\\"name\\\":\\\"Pronouns\\\",\\\"value\\\":\\\"He\\\/Him\\\"},{\\\"type\\\":\\\"PropertyValue\\\",\\\"name\\\":\\\"Work Account\\\",\\\"value\\\":\\\"https:\\\/\\\/<\\\/span>framapiaf.org\\\/@tcit<\\\/span><\\\/span><\\\/a>\\\"},{\\\"type\\\":\\\"PropertyValue\\\",\\\"name\\\":\\\"Site\\\",\\\"value\\\":\\\"https:\\\/\\\/<\\\/span>tcit.fr<\\\/span><\\\/span><\\\/a>\\\"}],\\\"endpoints\\\":{\\\"sharedInbox\\\":\\\"https:\\\/\\\/social.tcit.fr\\\/inbox\\\"},\\\"icon\\\":{\\\"type\\\":\\\"Image\\\",\\\"mediaType\\\":\\\"image\\\/jpeg\\\",\\\"url\\\":\\\"https:\\\/\\\/media.social.tcit.fr\\\/mastodontcit\\\/accounts\\\/avatars\\\/000\\\/000\\\/001\\\/original\\\/a28c50ce5f2b13fd.jpg\\\"},\\\"image\\\":{\\\"type\\\":\\\"Image\\\",\\\"mediaType\\\":\\\"image\\\/jpeg\\\",\\\"url\\\":\\\"https:\\\/\\\/media.social.tcit.fr\\\/mastodontcit\\\/accounts\\\/headers\\\/000\\\/000\\\/001\\\/original\\\/4d1ab77c20265ee9.jpg\\\"},\\\"_address\\\":\\\"social.tcit.fr\\\",\\\"_path\\\":\\\"\\\/users\\\/tcit\\\",\\\"_code\\\":200,\\\"_host\\\":\\\"social.tcit.fr\\\"}\", \"[]\", \"2018-12-08 10:17:09\", \"https:\\\/\\\/cloud.tcit.fr\\\/documents\\\/g\\\/a26d3e36-ea39-4794-989c-73e08f9b296a\"]:\n\nSQLSTATE[22001]: String data, right truncated: 7 ERREUR: valeur trop longue pour le type character varying(3000)"} ```

Additional information I'll have to check with the Doctrine DBAL version but maybe this column could be used as JSON when availableĀ ?

ArtificialOwl commented 5 years ago

194 should do the trick

tcitworld commented 5 years ago

Closing since https://github.com/nextcloud/social/pull/194 is merged. Consequence was https://github.com/nextcloud/social/issues/207 though