nextcloud / deck

🗂 Kanban-style project & personal management tool for Nextcloud, similar to Trello
https://apps.nextcloud.com/apps/deck
GNU Affero General Public License v3.0
1.17k stars 267 forks source link

Trello JSON Import Error #4818

Open 88fingerslukee opened 1 year ago

88fingerslukee commented 1 year ago

I'm trying to do a JSON Trello Import and I Get the following error. Any ideas?

An unhandled exception has been thrown: Error: Typed property OCA\Deck\Service\Importer\BoardImportService::$systemInstance must not be accessed before initialization in /var/www/nextcloud/apps/deck/lib/Service/Importer/BoardImportService.php:184 Stack trace:

0 /var/www/nextcloud/apps/deck/lib/Service/Importer/BoardImportService.php(414): OCA\Deck\Service\Importer\BoardImportService->getImportSystem()

1 /var/www/nextcloud/apps/deck/lib/Service/Importer/BoardImportService.php(398): OCA\Deck\Service\Importer\BoardImportService->getJsonSchemaPath()

2 /var/www/nextcloud/apps/deck/lib/Service/Importer/BoardImportCommandService.php(91): OCA\Deck\Service\Importer\BoardImportService->validateConfig()

3 /var/www/nextcloud/apps/deck/lib/Service/Importer/BoardImportService.php(430): OCA\Deck\Service\Importer\BoardImportCommandService->validateConfig()

4 /var/www/nextcloud/apps/deck/lib/Service/Importer/BoardImportCommandService.php(176): OCA\Deck\Service\Importer\BoardImportService->bootstrap()

5 /var/www/nextcloud/apps/deck/lib/Service/Importer/BoardImportCommandService.php(181): OCA\Deck\Service\Importer\BoardImportCommandService->bootstrap()

6 /var/www/nextcloud/apps/deck/lib/Command/BoardImport.php(87): OCA\Deck\Service\Importer\BoardImportCommandService->import()

7 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Deck\Command\BoardImport->execute()

8 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()

9 /var/www/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()

10 /var/www/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()

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

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

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

solracsf commented 1 year ago

Can you edit /var/www/nextcloud/apps/deck/lib/Service/Importer/BoardImportService.php

And replace:

if (!is_object($this->systemInstance)) {

with

if (!is_object($this->systemInstance) || $this->systemInstance === null) {

And retry please?

dewittlebook commented 1 year ago

So I get the same issue (posted below is after the change and docker down/up was run):

Error: Typed property OCA\Deck\Service\Importer\BoardImportService::$systemInstance must not be accessed before initialization in /var/www/html/custom_apps/deck/lib/Service/Importer/BoardImportService.php:184
Stack trace:
#0 /var/www/html/custom_apps/deck/lib/Service/Importer/BoardImportService.php(414): OCA\Deck\Service\Importer\BoardImportService->getImportSystem()
#1 /var/www/html/custom_apps/deck/lib/Service/Importer/BoardImportService.php(398): OCA\Deck\Service\Importer\BoardImportService->getJsonSchemaPath()
#2 /var/www/html/custom_apps/deck/lib/Service/Importer/BoardImportCommandService.php(91): OCA\Deck\Service\Importer\BoardImportService->validateConfig()
#3 /var/www/html/custom_apps/deck/lib/Service/Importer/BoardImportService.php(430): OCA\Deck\Service\Importer\BoardImportCommandService->validateConfig()
#4 /var/www/html/custom_apps/deck/lib/Service/Importer/BoardImportCommandService.php(176): OCA\Deck\Service\Importer\BoardImportService->bootstrap()
#5 /var/www/html/custom_apps/deck/lib/Service/Importer/BoardImportCommandService.php(181): OCA\Deck\Service\Importer\BoardImportCommandService->bootstrap()
#6 /var/www/html/custom_apps/deck/lib/Command/BoardImport.php(87): OCA\Deck\Service\Importer\BoardImportCommandService->import()
#7 /var/www/html/3rdparty/symfony/console/Command/Command.php(298): OCA\Deck\Command\BoardImport->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/html/3rdparty/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/html/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Deck\Command\BoardImport), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/html/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/html/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/html/console.php(100): OC\Console\Application->run()
#13 /var/www/html/occ(11): require_once('/var/www/html/c...')
#14 {main}

However, my ../deck directory is under ../custom_apps instead of just ../apps I did try running it again after doing your recommended change and then again after after stopping and starting the stack again

It is also extremely likely that my config.json and data.json are incorrectly setup, but that is a different issue I think..

If it is relevant I am running inside of a docker container instead of bare metal

ArkadRadz commented 1 year ago

Just had the same issue. What solved it for me was editing the following line 64 and changing it from:

    private ?ABoardImportService $systemInstance;

to:

    private ?ABoardImportService $systemInstance = null;

I also initially replaced the following line 186 but this did not fix the issue.

        if (!is_object($this->systemInstance)) {

with

                if (!is_object($this->systemInstance) || $this->systemInstance === null) {

For more info I'm using PHP 8.2.7 using the linuxserver.io nextcloud docker image. I did not restart the container after making the changes in the PHP script.

dewittlebook commented 11 months ago

That seems to have fixed it for me, I successfully imported a Trello JSON file, thanks all