Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation of version 0.2.1 fails on PostgreSQL #558

Closed
KopfKrieg opened this issue May 31, 2019 · 13 comments · Fixed by #563
Closed

Installation of version 0.2.1 fails on PostgreSQL #558

KopfKrieg opened this issue May 31, 2019 · 13 comments · Fixed by #563
Labels
bug Something isn't working

Comments

@KopfKrieg
Copy link

KopfKrieg commented May 31, 2019

Describe the bug
I've tried to install version 0.2.1 on my test system using Nextcloud 16 with PostgreSQL 11. I've had version 0.1.4 running before, but disabled it. After the latest release I wanted to test it again, but the following error occurred after trying to update it:

$ ./occ app:install social
Error: An exception occurred while executing 'INSERT INTO "social_a2_follows" ("id", "id_prim", "type", "actor_id", "object_id", "follow_id", "accepted", "creation") VALUES(?, ?, ?, ?, ?, ?, ?, ?)' with params ["45800873-29a9-4708-818d-ca4053070d22", "28900b2613cbd600396a9b8f1a0484cab9a27b1e35203e028903f8ad12228f1ca4fff44eca04f7a341ed57c17be1115c3f1a62d8dc4a25323b55a52c003d71dc", "Unknown", "59b65973-7b8e-40ec-a60d-940f96eba771", "2ef69e36-67b7-4976-a716-166ec40c1589", "39e8ae7a-4c4e-452f-8163-3efe6385398c", "", "2019-01-12 13:33:46"]:

SQLSTATE[22P02]: Invalid text representation: 7 ERROR:  invalid input syntax for type boolean: ""
$

I tried to completely remove the app using occ app:remove social, which worked fine, but now I'm not able to install it again. Is there a way to "reset" everything (including database tables, etc.?)

Expected behavior
Installation/Update should running fine, but doesn't :/

Technical details:

  • Social app version: 0.2.1
  • Operating system: Ubuntu 18.04 LTS
  • Web server: Apache 2
  • Database: PostgreSQL 11.3
  • PHP version: 7.3.5
  • Nextcloud version: 16.0.1
@agates
Copy link

agates commented May 31, 2019

Ran into this last night too... seems something is off with the library the code is using to pull the data during migration. I checked the existing follows table to verify that the values were not empty strings, and they do indeed exist as non-null booleans in my case at least. So I don't know why it's converting them to empty strings here.

@ArtificialOwl
Copy link
Member

I will work on a patch (I am currently moving) but you can still downgrade to 0.1.4: your old database is untouched !

  • download Social v0.1.4 and extract the content in your apps/ folder
  • downgrade the version in the database:
 ./occ config:app:set --value '0.1.4' social installed_version

@lachmanfrantisek
Copy link

@daita Thanks for the info!

Do I need to manually remove database tables created by the failed upgrade when you release the fixed version?

@ArtificialOwl
Copy link
Member

No, you can keep it like this

@lachmanfrantisek
Copy link

No, you can keep it like this

Thanks, looking forward to the fixed version. Thank you for your work!

@KopfKrieg
Copy link
Author

KopfKrieg commented May 31, 2019

I will work on a patch (I am currently moving) but you can still downgrade to 0.1.4: your old database is untouched !

Unfortunately it didn't work:

$ ./occ app:enable social                                      
An exception occurred while executing 'INSERT INTO "social_a2_follows" ("id", "id_prim", "type", "actor_id", "object_id", "follow_id", "accepted", "creation") VALUES(?, ?, ?, ?, ?, ?, ?, ?)' with params ["45800873-29a9-4708-818d-ca4053070d22", "28900b2613cbd600396a9b8f1a0484cab9a27b1e35203e028903f8ad12228f1ca4fff44eca04f7a341ed57c17be1115c3f1a62d8dc4a25323b55a52c003d71dc", "Unknown", "59b65973-7b8e-40ec-a60d-940f96eba771", "2ef69e36-67b7-4976-a716-166ec40c1589", "39e8ae7a-4c4e-452f-8163-3efe6385398c", "", "2019-01-12 13:33:46"]:

SQLSTATE[22P02]: Invalid text representation: 7 ERROR:  invalid input syntax for type boolean: ""
$

I got the error now with version 0.1.4. What I don't understand: On another system, that didn't have the social app installed until now, v0.2.1 works without problems (completely same setup).

If I want to start all over, do you know what I need to do? AFAIK uninstalling/removing the app and dropping all tables with oc_social_a2* should be enough, right?

Edit: Sorry, it works now. Had to enable it from the menu (enabling it using the occ command didn't work).

@ArtificialOwl
Copy link
Member

please test 0.2.2

@lachmanfrantisek
Copy link

lachmanfrantisek commented Jun 2, 2019

$ occ app:update social
social new version available: 0.2.2
An unhandled exception has been thrown:
Error: Undefined class constant 'TABLE_ACTORS' in /apps2/social/lib/Migration/Version0002Date20190506000001.php:121
Stack trace:
#0 /apps2/social/lib/Migration/Version0002Date20190506000001.php(79): OCA\Social\Migration\Version0002Date20190506000001->createActors(Object(OC\DB\SchemaWrapper))
#1 /nextcloud/lib/private/DB/MigrationService.php(475): OCA\Social\Migration\Version0002Date20190506000001->changeSchema(Object(OC\Migration\SimpleOutput), Object(Closure), Array)
#2 /nextcloud/lib/private/DB/MigrationService.php(411): OC\DB\MigrationService->executeStep('0002Date2019050...', false)
#3 /nextcloud/lib/private/legacy/app.php(900): OC\DB\MigrationService->migrate()
#4 /nextcloud/lib/private/Installer.php(186): OC_App::updateApp('social')
#5 /nextcloud/core/Command/App/Update.php(105): OC\Installer->updateAppstoreApp('social')
#6 /nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\App\Update->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /nextcloud/3rdparty/symfony/console/Application.php(901): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /nextcloud/3rdparty/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\App\Update), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /nextcloud/3rdparty/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /nextcloud/console.php(97): OC\Console\Application->run()
#12 /nextcloud/occ(11): require_once('/nextcloud/cons...')
#13 {main}

edit:

Do I need to manually change the version in settings? I still have 0.1.4 after yesterday's downgrade:

$ occ config:app:get social installed_version
0.1.4

@lachmanfrantisek
Copy link

@daita Thanks for the new version. Can you please take a look at the error?

@ArtificialOwl
Copy link
Member

Thanks for the report, one of the file is not loaded when using the command line. However, can you update it using the web client ?

@lachmanfrantisek
Copy link

lachmanfrantisek commented Jun 2, 2019

Thanks for the report, one of the file is not loaded when using the command line. However, can you update it using the web client ?

Works well, I thought it would be safer to use CLI...;-) Thank you for the tip!

edit: Two (mostly test) instances upgraded. The main one failed for the first time, but downgrade and second try works well. (I hope it was not related.)

@paulvt
Copy link

paulvt commented Jun 3, 2019

I just went via 0.2.1 to 0.2.2, both via the web update (and also on PostgreSQL), but I am now looking at a white page for the app on all my instances. There are no errors in the logs?

This seems to be basically what is described in #559, please ignore this comment!

@KopfKrieg
Copy link
Author

The upgrade to v0.2.2 worked, thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants