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

At least one database table is missing after update #1161

Open chrbayer opened 3 years ago

chrbayer commented 3 years ago

After updating an outdated version to 0.4.2 (which was a bit messy...), at least one database table seem to be missing.

I have no data in my existing tables, just want to get the current version running.

Is there a possibility to recreate all tables or create all missing tables? Uninstalling and reinstalling does not do this...

occ social:reset gives me this message:

SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "oc_social_3_client_auth" does not exist
LINE 1: DELETE FROM "oc_social_3_client_auth"
chrbayer commented 3 years ago

Thank you for the hint! I created the two database tables but run into the exception mentioned in #1129. In what file do I have to insert your proposed addition?

chrbayer commented 3 years ago

Thanks for trying to help me!

I needed to correct the social_url, too. But I still get an error at the very end of the reset:

[root@beta nextcloud]# sudo -u http php occ social:reset
Beware, this operation will delete all content from the Social App.

Do you confirm this operation? (y/N) y
Operation is destructive. Are you sure about this? (y/N) y

flushing data... done

Now is a good time to change the base address of your cloud:  (https://criby.de/nextcloud/index.php)
An unhandled exception has been thrown:
TypeError: Return value of "OCA\Social\Command\Reset::execute()" must be of the type int, "null" returned. in /usr/local/share/webapps/nextcloud/apps/mail/vendor/symfony/console/Command/Command.php:261
Stack trace:
#0 /usr/local/share/webapps/nextcloud/core/Command/Base.php(169): Symfony\Component\Console\Command\Command->run()
#1 /usr/local/share/webapps/nextcloud/apps/mail/vendor/symfony/console/Application.php(920): OC\Core\Command\Base->run()
#2 /usr/local/share/webapps/nextcloud/apps/mail/vendor/symfony/console/Application.php(266): Symfony\Component\Console\Application->doRunCommand()
#3 /usr/local/share/webapps/nextcloud/apps/mail/vendor/symfony/console/Application.php(142): Symfony\Component\Console\Application->doRun()
#4 /usr/local/share/webapps/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#5 /usr/local/share/webapps/nextcloud/console.php(100): OC\Console\Application->run()
#6 /usr/local/share/webapps/nextcloud/occ(11): require_once('/usr/local/shar...')

I'm using postgres database instead of mysql, but I needed to create them. too.

Best regards, Christoph

elgorro commented 3 years ago

Its nearly the same error with this check - as well with postgresql: sudo -u www-data php occ social:check:install

0 invalid followers removed 0 invalid notes removed Your current configuration: { "cloud_url": "https:\/\/cloud.nextcloud.cloud\/", "social_url": "https:\/\/cloud.nextcloud.cloud\/apps\/social\/", "social_address": "", "service": 1, "max_size": 10, "access_type": "all_but", "access_list": "[]", "allow_self_signed": "0", "db_chunk_size": 10000 } An unhandled exception has been thrown: TypeError: Return value of "OCA\Social\Command\CheckInstall::execute()" must be of the type int, "null" returned. in /var/www/nextcloud/apps/mail/vendor/symfony/console/Command/Command.php:261 Stack trace:

0 /var/www/nextcloud/core/Command/Base.php(169): Symfony\Component\Console\Command\Command->run()

1 /var/www/nextcloud/apps/mail/vendor/symfony/console/Application.php(920): OC\Core\Command\Base->run()

2 /var/www/nextcloud/apps/mail/vendor/symfony/console/Application.php(266): Symfony\Component\Console\Application->doRunCommand()

3 /var/www/nextcloud/apps/mail/vendor/symfony/console/Application.php(142): Symfony\Component\Console\Application->doRun()

4 /var/www/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()

5 /var/www/nextcloud/console.php(100): OC\Console\Application->run()

6 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')

As I have strong Nginx-Configs (v-host) for nextcloud, its may related to to redirecting (social_url) or another thought is the nextcloud privacy settings (like mail-adress?).

Side effects are:

  1. if i want to follow a account - it says "wrong redirection (...)" on external pages
  2. I'm displayed online somehow
  3. I can't follow "nextcloud on mastodon.xyz" on Home etc.
  4. (Would wish a better wiki as well for beginners)
elgorro commented 3 years ago

I changed the nginx-config from return 301 to rewrite - but the same error.

From new to old logs:

  1. `[social] Info: Notice: LinkedDataSignatureMissingException while checkObject : missing signature --- {"@context":["https:\/\/www.w3.org\/ns\/activitystreams"],"id":"https:\/\/mastodon.xyz\/users\/nextcloud#accepts\/follows\/","type":"Accept","actor":"https:\/\/mastodon.xyz\/users\/nextcloud","object":{"id":"https:\/\/cloud.nextcloud.cloud\/guid>","type":"Follow","actor":"https:\/\/cloud.nextcloud.cloud\/index.php\/apps\/social\/@<accountid","object":"https:\/\/mastodon.xyz\/users\/nextcloud"}}

POST /index.php/apps/social/@/inbox from at 2021-01-09T09:09:55+00:00`

  1. `[] Warning: [warning] Saving Actor -- {"actor":{"@context":["https:\/\/www.w3.org\/ns\/activitystreams"],"id":"https:\/\/mastodon.xyz\/users\/nextcloud","type":"Person","url":"https:\/\/mastodon.xyz\/@nextcloud","summary":"

    A safe home for all your data, community-driven & open source!<br \/><a href=\"https:\/\/nextcloud.com\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https:\/\/<\/span><span class=\"\">nextcloud.com<\/span><span class=\"invisible\"><\/span><\/a><br \/>Join us at <a href=\"https:\/\/help.nextcloud.com\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https:\/\/<\/span><span class=\"\">help.nextcloud.com<\/span><span class=\"invisible\"><\/span><\/a> and <a href=\"https:\/\/github.com\/nextcloud\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https:\/\/<\/span><span class=\"\">github.com\/nextcloud<\/span><span class=\"invisible\"><\/span><\/a> \ud83d\ude0a<\/p>","icon":{"id":"https:\/\/cloud.nextcloud.cloud\/documents\/g\/","type":"Image","url":"https:\/\/6-28.mastodon.xyz\/accounts\/avatars\/000\/059\/736\/original\/23c78010f30dc575.jpg","mediaType":"image\/jpeg","mimeType":"","localCopy":"","resizedCopy":""},"aliases":["@nextcloud","users\/nextcloud"],"preferredUsername":"nextcloud","name":"Nextcloud \ud83d\udcf1\u2601\ufe0f\ud83d\udcbb","inbox":"https:\/\/mastodon.xyz\/users\/nextcloud\/inbox","outbox":"https:\/\/mastodon.xyz\/users\/nextcloud\/outbox","account":"nextcloud@mastodon.xyz","following":"https:\/\/mastodon.xyz\/users\/nextcloud\/following","followers":"https:\/\/mastodon.xyz\/users\/nextcloud\/followers","endpoints":{"sharedInbox":"https:\/\/mastodon.xyz\/inbox"},"publicKey":{"id":"https:\/\/mastodon.xyz\/users\/nextcloud#main-key","owner":"https:\/\/mastodon.xyz\/users\/nextcloud","publicKeyPem":"-----BEGIN PUBLIC KEY----- -----END PUBLIC KEY-----\n"}}}

GET /apps/social/api/v1/global/account/info?account=nextcloud@mastodon.xyz from by at 2021-01-09T09:09:41+00:00`

  1. retrieveObject : Status 200

  2. webfingerAccount : Status 200

  3. Initiated Reset

Edit: From the website I can follow now: On the social-app: 0 followers, but "nextcloud@mastodon.xyz" shows there. No global-posts yet.

I found from the tutorial I used once up in the time: `# The following 2 rules are only needed for the user_webfinger app. Uncomment it if you're planning to use this app.

rewrite ^/.well-known/host-meta /public.php?service=host-meta last;

#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;`

I don't know what it means... :)

pwFoo commented 3 years ago

Installed social plugin and found some problems like the missing tables and failing reset.

flushing data... An exception occurred while executing 'DELETE FROM `oc_social_3_client_auth`':

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_social_3_client_auth' doesn't exist
rancher:~$ 

Following here

stefan123t commented 3 years ago

The two tables should be created with your prefix in mind, eg. nc_1234_social_3_client_auth and nc_1234_social_3_client_token.

I did not find out why they are not created unlike all the other tables, probably the table structures are neither defined in lib/Migration/Version0003Date20200611000001.php nor lib/Command/MigrateAlpha3.php.

@juliushaertl, @daita are these two tables stale and should they simply be removed from the flush table in #1129 or is this something that is needed in future and hasn't been defined yet ?

stefan123t commented 3 years ago

I would have added the two tables using the InnoDB Engine as suggested in #1129, but I am undecided what the basic table layout (columns) should be ?

  1. nocolumn int suggested by @ozls

    CREATE TABLE nc_1234_social_3_client_auth (nocolumn int) ENGINE=InnoDB;
    CREATE TABLE nc_1234_3_client_token (nocolumn int) ENGINE=InnoDB;
  2. title VARCHAR(100) NOT NULL suggested by @xundeenergie

    CREATE TABLE nc_1234_social_3_client_auth (title VARCHAR(100) NOT NULL) ENGINE=InnoDB;
    CREATE TABLE nc_1234_3_client_token (title VARCHAR(100) NOT NULL) ENGINE=InnoDB;
ozls commented 3 years ago

@stefan123t I am not an expert but I think it doesn't really matter, the names and types I used were completely random and it worked anyway

sledz commented 2 years ago

Now is a good time to change the base address of your cloud: (https://criby.de/nextcloud/index.php) An unhandled exception has been thrown: TypeError: Return value of "OCA\Social\Command\Reset::execute()" must be of the type int, "null" returned. in /usr/local/share/webapps/nextcloud/apps/mail/vendor/symfony/console/Command/Command.php:261

I see the same behavior here. Is there a fix or workaround for this in the meantime?