deck icon indicating copy to clipboard operation
deck copied to clipboard

Trello JSON Import Error

Open 88fingerslukee opened this issue 2 years ago • 4 comments

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('...')

88fingerslukee avatar Jun 15 '23 19:06 88fingerslukee

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?

solracsf avatar Jun 24 '23 17:06 solracsf

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

dewittlebook avatar Jul 02 '23 01:07 dewittlebook

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.

ArkadRadz avatar Jul 12 '23 23:07 ArkadRadz

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

dewittlebook avatar Jul 24 '23 04:07 dewittlebook

Fixed in #4939

joshtrichards avatar May 05 '25 21:05 joshtrichards