Open psy-q opened 7 years ago
Looking at the thrown error PHP Fatal error: Uncaught exception 'JsonRPC\Exception\InvalidJsonFormatException' with message 'Malformed payload' in /home/rca/kanboard-import-trello/vendor/fguillot/json-rpc/src/JsonRPC/ValidatorJsonFormatValidator.php:26
it looks to me that the JSON returned by the server you are connecting to is not accepted as valid JSON. Strange that it does work in CURL and not with the library.
Unfortunately I am not actively supporting this library anymore, I made the migration from Trello to Kanboard a while ago and haven't regretted it yet. But if someone is willing to look into this, please do!
I've got same problem after disabling SSL certificate verification in vendor/fguillot/json-rpc/src/JsonRPC/HttpClient.php
(I know i is a bad idea but I don't know how to bypass it with my SlefSigned certificate
PHP Notice: date_default_timezone_set(): Timezone ID 'Europe/Paris
' is invalid in /tmp/kanboard-import-trello/util.php on line 31
PHP Fatal error: Uncaught exception 'JsonRPC\Exception\InvalidJsonFormatException' with message 'Malformed payload' in /tmp/kanboard-import-trello/vendor/fguillot/json-rpc/src/JsonRPC/Validator/JsonFormatValidator.php:26
Stack trace:
#0 /tmp/kanboard-import-trello/vendor/fguillot/json-rpc/src/JsonRPC/Response/ResponseParser.php(86): JsonRPC\Validator\JsonFormatValidator::validate(NULL)
#1 /tmp/kanboard-import-trello/vendor/fguillot/json-rpc/src/JsonRPC/Client.php(194): JsonRPC\Response\ResponseParser->parse()
#2 /tmp/kanboard-import-trello/vendor/fguillot/json-rpc/src/JsonRPC/Client.php(178): JsonRPC\Client->sendPayload('{"jsonrpc":"2.0...')
#3 /tmp/kanboard-import-trello/vendor/fguillot/json-rpc/src/JsonRPC/Client.php(126): JsonRPC\Client->execute('getAllProjects', Array)
#4 /tmp/kanboard-import-trello/import.php(58): JsonRPC\Client->__call('getAllProjects', Array)
#5 /tmp/kanboard-import-trello/import.php(58): JsonRPC\Client->getAllProjects()
#6 {main}
thrown in /tmp/kanboard-import-trello/vendor/fguillot/json-rpc/src/JsonRPC/Validator/JsonFormatValidator.php on line 26
I've written my own import script meanwhile, it can import lists, cards (they become tasks), checklists (they become subtasks of a task) and it tries to assign the correct users by using a mapping that you need to provide if the usernames between Trello and your Kanboard instance don't match.
I couldn't figure out what causes the 'Malformed payload' error, so writing my own was quicker. If anyone is interested, I could clean up the code a bit and put it online? I'm sorry I can't help with the actual issue in this library.
Looking at the first entry of the stacktrace, the response to the request seems to be NULL:
#0 /tmp/kanboard-import-trello/vendor/fguillot/json-rpc/src/JsonRPC/Response/ResponseParser.php(86): JsonRPC\Validator\JsonFormatValidator::validate(NULL)
As I have not implemented the JsonRPC library I do not know what is going on there. Maybe you can report it as an issue at their repository?
I've put up my script in the meantime, it's surely not as good as this one, but maybe it helps.
Thank you @psy-q , it works !
I had to mess around a bit because I was unable to make import.php connect to a server with an invalid certificate. That's why I switched to a newer version of json-rpc in #9 so that I could disable cert verification.
After that I still couldn't make it work. Below is a log with debug enabled. I verified that it works fine when done manually using curl. Curl example is on the bottom.
These are examples with curl: