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.22k stars 278 forks source link

Trello JSON Import Error #5136

Open rnaujack opened 1 year ago

rnaujack commented 1 year ago

While importing with occ deck:import --system=TrelloJson --config=cofig.json --data=trello.json

the import aborted after partial import with this error: "Call to a member function getUID() on string in /var/www/html/custom_apps/deck/lib/Service/Importer/Systems/TrelloJsonService.php:136"

To reproduce this error the trello.json file must contain an action with "type": "commentCard".

Error: Call to a member function getUID() on string in /var/www/html/custom_apps/deck/lib/Service/Importer/Systems/TrelloJsonService.php:136
Stack trace:
#0 /var/www/html/custom_apps/deck/lib/Service/Importer/BoardImportService.php(341): OCA\Deck\Service\Importer\Systems\TrelloJsonService->getComments()
#1 /var/www/html/custom_apps/deck/lib/Service/Importer/BoardImportCommandService.php(236): OCA\Deck\Service\Importer\BoardImportService->importComments()
#2 /var/www/html/custom_apps/deck/lib/Command/BoardImport.php(92): OCA\Deck\Service\Importer\BoardImportCommandService->import()
#3 /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))
#4 /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))
#5 /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))
#6 /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))
#7 /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))
#8 /var/www/html/console.php(100): OC\Console\Application->run()
#9 /var/www/html/occ(11): require_once('/var/www/html/c...')
#10 {main}e72ee909ae7d:/var/www/html# sudo -u www-data php occ deck:import --system=TrelloJson --config=/mnt/ncdata/r.naujack/files/Documents/trello-app-import.json --data=/mnt/ncdata/r.naujack/files/Documents/App_trello.json 

Nextcloud version: 27.1.0.

Where did you install Nextcloud from: all-in-one

Signing status:

No errors have been found.

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
Enabled:
  - activity: 2.19.0
  - admin_audit: 1.17.0
  - announcementcenter: 6.6.2
  - bookmarks: 13.1.1
  - bruteforcesettings: 2.7.0
  - calendar: 4.5.0
  - circles: 27.0.1
  - cloud_federation_api: 1.10.0
  - collectives: 2.7.1
  - comments: 1.17.0
  - contacts: 5.4.0
  - contactsinteraction: 1.8.0
  - dashboard: 7.7.0
  - dav: 1.27.0
  - deck: 1.11.0
  - drawio: 2.1.2
  - external: 5.2.1
  - federatedfilesharing: 1.17.0
  - federation: 1.17.0
  - files: 1.22.0
  - files_antivirus: 5.2.2
  - files_bpm: 1.2.0
  - files_markdown: 2.4.1
  - files_mindmap: 0.0.28
  - files_pdfviewer: 2.8.0
  - files_reminders: 1.0.0
  - files_rightclick: 1.6.0
  - files_sharing: 1.19.0
  - files_trashbin: 1.17.0
  - files_versions: 1.20.0
  - fileslibreofficeedit: 1.1.0
  - firstrunwizard: 2.16.0
  - groupfolders: 15.3.0
  - logreader: 2.12.0
  - lookup_server_connector: 1.15.0
  - mail: 3.4.0
  - nextcloud-aio: 0.4.0
  - nextcloud_announcements: 1.16.0
  - notes: 4.8.1
  - notifications: 2.15.0
  - notify_push: 0.6.3
  - oauth2: 1.15.1
  - password_policy: 1.17.0
  - photos: 2.3.0
  - polls: 5.3.2
  - privacy: 1.11.0
  - provisioning_api: 1.17.0
  - quicknotes: 0.8.10
  - recommendations: 1.6.0
  - related_resources: 1.2.0
  - richdocuments: 8.2.0
  - serverinfo: 1.17.0
  - settings: 1.9.0
  - sharebymail: 1.17.0
  - socialsharing_email: 2.6.0
  - spreed: 17.1.0
  - support: 1.10.0
  - survey_client: 1.15.0
  - suspicious_login: 5.0.0
  - systemtags: 1.17.0
  - tasks: 0.15.0
  - text: 3.8.0
  - theming: 2.2.0
  - theming_customcss: 1.14.0
  - twofactor_backupcodes: 1.16.0
  - twofactor_totp: 9.0.0
  - user_status: 1.7.0
  - viewer: 2.1.0
  - weather_status: 1.7.0
  - workflowengine: 2.9.0
Disabled:
  - dokuwiki: 1.0.1 (installed 1.0.1)
  - encryption: 2.15.0
  - files_external: 1.19.0
  - integration_collaboard: 1.0.6 (installed 1.0.6)
  - integration_openproject: 2.4.4 (installed 2.4.4)
  - user_ldap: 1.17.0
  - xwiki: 0.1.1 (installed 0.1.1)

Nextcloud configuration:

{
    "system": {
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "overwritehost": "nextcloud.domain.de",
        "overwriteprotocol": "https",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "nextcloud.domain.de"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "27.1.0.7",
        "overwrite.cli.url": "https:\/\/nextcloud.domain.de\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "check_data_directory_permissions": false,
        "maintenance": false,
        "loglevel": "2",
        "log_type": "file",
        "logfile": "\/var\/www\/html\/data\/nextcloud.log",
        "log_rotate_size": "10485760",
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "jpeg_quality": "60",
        "enabledPreviewProviders": {
            "1": "OC\\Preview\\Image",
            "2": "OC\\Preview\\MarkDown",
            "3": "OC\\Preview\\MP3",
            "4": "OC\\Preview\\TXT",
            "5": "OC\\Preview\\OpenDocument",
            "6": "OC\\Preview\\Movie",
            "0": "OC\\Preview\\Imaginary"
        },
        "enable_previews": true,
        "upgrade.disable-web": true,
        "mail_smtpmode": "smtp",
        "trashbin_retention_obligation": "auto, 30",
        "versions_retention_obligation": "auto, 30",
        "activity_expire_days": "30",
        "simpleSignUpLink.shown": false,
        "share_folder": "\/Shared",
        "one-click-instance": true,
        "one-click-instance.user-limit": 100,
        "one-click-instance.link": "https:\/\/nextcloud.com\/all-in-one\/",
        "updatedirectory": "\/nc-updater",
        "htaccess.RewriteBase": "\/",
        "files_external_allow_create_new_local": false,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "allow_local_remote_servers": true,
        "mail_sendmailmode": "smtp",
        "preview_imaginary_url": "http:\/\/nextcloud-aio-imaginary:9000",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "\u201cDE\u201d",
        "upgrade.cli-upgrade-link": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/2726",
        "davstorage.request_timeout": 3600,
        "dbpersistent": true,
        "mail_smtpstreamoptions": {
            "ssl": {
                "allow_self_signed": true,
                "verify_peer": false,
                "verify_peer_name": false
            }
        }
    }
}

Logs #### Nextcloud log (data/nextcloud.log) ``` ``` #### Browser log ``` ```

And i've fixed it for me changing the file /var/www/html/custom_apps/deck/lib/Service/Importer/Systems/TrelloJsonService.php

line136:

$actor = $this->getImportService()->getConfig('uidRelation')->{$trelloComment->memberCreator->username};

instead of

$actor = $this->getImportService()->getConfig('uidRelation')->{$trelloComment->memberCreator->username}->getUID();
TeleRocker22 commented 1 year ago

I am experiencing the same issue, but the solution provided did not work in my case. I get the same error, but it now references line 364 instead of line 136.

rnaujack commented 1 year ago

I've forgotten the second change i've made: line 364: $text = str_replace($trello, $nextcloud, $text); instead of $text = str_replace($trello, $nextcloud->getUID(), $text);

TeleRocker22 commented 1 year ago

Thank you for sharing the additional change. I made the same changes as you, and it worked for me as well. I tried on a very small board, so I might give it another shot on a larger board at a later time.

I will note for anyone else looking for the config file mine was in a slightly different location.

/var/www/nextcloud/apps/deck/lib/Service/Importer/Systems/TrelloJsonService.php

jacksbox commented 11 months ago

I had the same problem and the proposed changes solved it. Thanks @rnaujack.

Would be great to add this change to the repo!

jm355 commented 9 months ago

I got this issue with TrelloJson and TrelloApi, this change fixed it for TrelloApi (I didn't bother trying TrelloJson after going to the trouble of setting up trelloapi thinking that might be the root cause before I found this)

ImaCrea commented 6 months ago

thanks @rnaujack ! It worked also on my side. (Use TrelloAPI importer on NC 28.0.4 - Deck 1.12.2). Fancy making a PR with your fix? That'd be great.

ant0nwax commented 2 months ago

I confirm,

after backup cp -p TrelloJsonService.php TrelloJsonService.php_bak

in mentioned document it is necessary to remove ->getUID() twice.

line 136 and line 364

to find the mentioned document use this bullshit:

[root@antcloud nextcloud]# pwd && find -type f -name TrelloJsonService.php
/var/www/html/nextcloud
./apps/deck/lib/Service/Importer/Systems/TrelloJsonService.php