Page MenuHomePhabricator

Error when opening "/conduit/method/project.search/"
Closed, ResolvedPublic

Description

After installing Sprint extension I get following error message when opening "/conduit/method/project.search/"

SearchFields "custom:scsOmkpB9Tqi" (of class "PhabricatorSearchCustomFieldProxyField") and "custom:sS__iDJ26B7u" (of class "PhabricatorSearchCustomFieldProxyField") both define the same Conduit key ("custom."). Keys must be unique.

Environment

  • PHP version
PHP 5.6.24 (cli) (built: Jul 21 2016 07:42:08)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
  • phabricator.conf.php
<?php

return array(
	'mysql.host' => '127.0.0.1',
	'mysql.user' => '{{phabricator_db_user}}',
	'mysql.pass' => '{{phabricator_db_pass}}',
	'phabricator.base-uri' => 'https://{{phabricator_host}}/',
	'phabricator.timezone' => 'Asia/Jakarta',
	'repository.default-local-path' => '/data/repositories',
	'pygments.enabled' => true,
	'storage.local-disk.path' => '{{phabricator_local_storage}}',
	'security.alternate-file-domain' => 'https://{{phabricator_host}}/',
	'maniphest.points' => array(
		'enabled' => true,
		'label' => 'Estimated Hours',
		'action' => 'Change Estimate'
	)
);
  • maniphest.custom-field-definitions
$ [ec2-user@virtual bin]$ ./config get maniphest.custom-field-definitions
{
  "config": [
    {
      "key": "maniphest.custom-field-definitions",
      "source": "local",
      "value": null,
      "status": "unset",
      "errorInfo": null
    },
    {
      "key": "maniphest.custom-field-definitions",
      "source": "database",
      "value": null,
      "status": "unset",
      "errorInfo": null
    }
  ]
}

Event Timeline

Hi, you need to use the master branch for Phabricator-extensions-Sprint since wmf/stable is for the stable production version were running.

Please try with https://phab-01.wmflabs.org/conduit/method/project.search/

since that is running wmf/dev and the master branch for Phabricator-extensions-Sprint

Also you linked to https://secure.phabricator.com/rPHUc8b76485ef845a40af96c132c16e0f28f145bdd2 for Phabricator-extensions-Sprint, since the repo is only here https://phabricator.wikimedia.org/diffusion/PHSP/

Alos are you sure it is the extension causing the problem since it dosent show where the error is coming from that extension.

Heres a recent fix https://phabricator.wikimedia.org/rPHSP92223987987c10a6a406494acde20104dcc1e555

Sorry, I use wrong link for revision link. See edited task.

Hi, you need to use the master branch for Phabricator-extensions-Sprint since wmf/stable is for the stable production version were running.

I already use master branch with latest commit for sprint extension.

Please try with https://phab-01.wmflabs.org/conduit/method/project.search/
since that is running wmf/dev and the master branch for Phabricator-extensions-Sprint

What Phabricator version did phab-01 use? Did it use the latest commit of master branch too?

Alos are you sure it is the extension causing the problem since it dosent show where the error is coming from that extension.

Yes. If I remove "conf/local/local.json", which contain load-libraries of sprint extension, the "/conduit/method/project.search/" does not output any error message.

Content of my conf/local/local.json file,

{
  "load-libraries": {
    "sprint": "/data/phabricator/sprint/src"
  }
}

Oh, yeh phab-01 is using the latest from upstream.

Could you see if you could reproduce with https://phab-01.wmflabs.org/ please?

And also are there any errors in your error logs, ie /var/log/apache2/error.log or /var/log/apache2/phabricator_error.log

Maybe @Christopher will know since he is the author of the extension.

I looked at this briefly and made a patch.
https://github.com/wikimedia/phabricator-extensions-Sprint/commit/800a5e776027c974140daaf90383750e2e3b9bb6

I have not tested it too extensively, but it seems to fix the conduit issue. For some unknown reasoning, upstream made a decision to create a new setter method for custom field keys ("getModernFieldKey()") and then create external dependencies on it, without deprecating the existing setter method ("getFieldKey()"), that still exists in parallel with the other. It defies comprehension what the difference is between a "modern" field key and a normal one.

Also, I should point out that there is no reason why they should be checking for duplicate keys in the conduit method, which is the "error" that is reported here. There should be a cardinality constraint on the setter, and if the key already exists then throw an exception there.

The reason for the falsely assumed duplication is from PhabricatorStandardCustomField line 491, where they arbitrarily default all unset custom field keys to "custom." This is an upstream bug in my opinion. They should know if a key needs to be set before setting it and throw an appropriate "key not set" exception.

Sulhan claimed this task.

Thank you @Christopher, its working now on my environment.