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

Trello JSON Import Error #5136

Open
rnaujack opened this issue Sep 21, 2023 · 6 comments · May be fixed by #5859
Open

Trello JSON Import Error #5136

rnaujack opened this issue Sep 21, 2023 · 6 comments · May be fixed by #5859

Comments

@rnaujack
Copy link

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
Copy link

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
Copy link
Author

rnaujack commented Sep 25, 2023

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
Copy link

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
Copy link
Contributor

jacksbox commented Dec 6, 2023

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

Would be great to add this change to the repo!

@jm355
Copy link

jm355 commented Feb 8, 2024

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
Copy link

ImaCrea commented May 5, 2024

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.

mulles added a commit to mulles/deck that referenced this issue May 7, 2024
Fixes the following issue: nextcloud#5136
By fixing the following error when running 'php occ deck:import --system=TrelloJson'

Error: Call to a member function getUID() on string in /home/sites/site100028002/web/nextcloud.enklaave.org/apps/deck/lib/Service/Importer/Systems/TrelloJsonService.php:136

and 

Error: Call to a member function getUID() on string in /home/sites/site100028002/web/nextcloud.enklaave.org/apps/deck/lib/Service/Importer/Systems/TrelloJsonService.php:364


Signed-off-by: mulles <com.github@emu.lu>
@mulles mulles linked a pull request May 7, 2024 that will close this issue
5 tasks
juliushaertl pushed a commit to mulles/deck that referenced this issue May 9, 2024
Fixes the following issue: nextcloud#5136
By fixing the following error when running 'php occ deck:import --system=TrelloJson'

Error: Call to a member function getUID() on string in /home/sites/site100028002/web/nextcloud.enklaave.org/apps/deck/lib/Service/Importer/Systems/TrelloJsonService.php:136

and 

Error: Call to a member function getUID() on string in /home/sites/site100028002/web/nextcloud.enklaave.org/apps/deck/lib/Service/Importer/Systems/TrelloJsonService.php:364


Signed-off-by: mulles <com.github@emu.lu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants