tentwentyfour / remaim

Redmine to Maniphest migration utility
MIT License
8 stars 2 forks source link

Query is too long #22

Open cryptomilk opened 7 years ago

cryptomilk commented 7 years ago

Branch or version of remaim used

commit f19ee18a5fbc172fb7642d2bc86d6334d7fa9d3a (HEAD -> master, tag: 0.3.0, origin/master, origin/HEAD)
Merge: d3f5f2e 0985c16
Author:     David Raison <david@tentwentyfour.lu>
AuthorDate: Sun Jan 15 17:51:19 2017 +0100
Commit:     David Raison <david@tentwentyfour.lu>
CommitDate: Sun Jan 15 17:51:19 2017 +0100

    Merge branch 'development'

I'm trying to migrate: https://red.libssh.org/ to https://bugs.libssh.org and get the following error:

###################
# Pre-flight check #
####################
Redmine project named "libssh" with ID 1.
Target phabricator project named "libssh" with ID 1.
View policy: XXX, Edit policy: XXX
69 tickets to be migrated!

OK to continue? [y/N]
> y
Working...
Arrrgh… we're really sorry but something went a little haywire here.
Use the following information to help us fix it? Pretty please?

Exception message: ERR-CONDUIT-CORE: Query is too long (5,084 bytes, maximum is 1,024 bytes).
Exception trace:
#0 /srv/www/vhosts/libssh/bugs/libphutil/src/future/FutureProxy.php(58): ConduitFuture->didReceiveResult(Array)
#1 /srv/www/vhosts/libssh/bugs/libphutil/src/future/FutureProxy.php(35): FutureProxy->getResult()
#2 /srv/www/vhosts/libssh/bugs/libphutil/src/conduit/ConduitClient.php(64): FutureProxy->resolve()
#3 /home/asn/tmp/remaim/src/Traits/Phabricator.php(280): ConduitClient->callMethodSynchronous('maniphest.query', Array)
#4 /home/asn/tmp/remaim/src/Wizard.php(465): Ttf\Remaim\Wizard->findExistingTask(Array, 'PHID-PROJ-rc7op...', false)
#5 /home/asn/tmp/remaim/src/Wizard.php(440): Ttf\Remaim\Wizard->createManiphestTask(Array, 'PHID-USER-sw453...', 'PHID-PROJ-rc7op...', Array, false)
#6 [internal function]: Ttf\Remaim\Wizard->Ttf\Remaim\{closure}(Array)
#7 /home/asn/tmp/remaim/src/Wizard.php(442): array_map(Object(Closure), Array)
#8 /home/asn/tmp/remaim/src/Wizard.php(138): Ttf\Remaim\Wizard->migrateIssues(Array, Array, Array, false)
#9 /home/asn/tmp/remaim/bin/remaim(85): Ttf\Remaim\Wizard->run(false)
#10 {main}
kwisatz commented 7 years ago

Hi @cryptomilk and thanks for the report!

Looks like your issue descriptions are pretty long and we're not doing any shortening and very little sanitization to the description before using it to check for existing (duplicate) entries using maniphest.query.

We've had trouble making maniphest.query actually find tasks based on chunks of the original description because it doesn't do fuzzy search, that's why simply shortening the description to a kb here is not an option.

We should migrate to maniphest.search anyway and see if we can use attributes other than the title and description to match against existing items.

cryptomilk commented 7 years ago

Wouldn't be matching by title, reporter and assignee be enough?

kwisatz commented 7 years ago

Yes, that's what I had in mind for the new maniphest.search request. I've started this morning and will try to finish tonight.

kwisatz commented 7 years ago

The tests are broken now and it will take me a while to fix those for lack of time, but your case should be solved in release 0.4.1 now. Please let me know if it works or if you still encounter the same – or other – problems.

cryptomilk commented 7 years ago

Sorry, I had vacation last week.

PHP Fatal error:  'continue' not in the 'loop' or 'switch' context in /home/asn/tmp/remaim/src/Journal.php on line 47

Should be return "" ??

kwisatz commented 7 years ago

We're in the middle of moving offices… but you're right, it should be a return. That happens when you refactor without fixing your tests too.

cryptomilk commented 7 years ago

However, I've replaced it with 'return ""' and then the migration worked just fine! Thanks for you help!