Page MenuHomePhabricator

Fatal error attempting to create new Diffusion repositories using Striker
Closed, ResolvedPublic

Description

Reported by @Jnanaranjan_sahu on irc.

It looks like the Phabricator API has changed. Here's the useful info from the error logs:

Internal Server Error: /tools/id/twitter-to-commons/repos/create:228
Traceback (most recent call last):
  File "/srv/deployment/striker/venv/lib/python3.5/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/srv/deployment/striker/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 126, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/srv/deployment/striker/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 124, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/srv/deployment/striker/venv/lib/python3.5/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "./striker/tools/views/decorators.py", line 48, in decorated
    return f(*args, **kwargs)
  File "./striker/tools/views/repo.py", line 87, in create
    list(set(phab_maintainers))
  File "./striker/phabricator.py", line 203, in create_repository
    {'type': 'edit', 'value': custom_policy},
  File "./striker/phabricator.py", line 75, in post
    resp.get('result', None))
striker.phabricator.APIError: Transaction with key "6" has invalid type "autoclose". This type is not recognized. Valid types are: space, vcs, name, callsign, shortName, description, encoding, allowDangerousChanges, allowEnormousChanges, status, defaultBranch, fetchRefs, permanentRefs, trackOnly, importOnly, stagingAreaURI, automationBlueprintPHIDs, symbolLanguages, symbolRepositoryPHIDs, publish, filesizeLimit, copyTimeLimit, touchLimit, view, edit, policy.push, projects.add, projects.remove, projects.set, mfa. (ERR-CONDUIT-CORE)

Event Timeline

Easily recreated in my local dev environment after upgrading Phabricator to the latest version deployed in Wikimedia's production network.

APIError at /tools/id/t227508/repos/create

Transaction with key "6" has invalid type "autoclose". This type is not recognized. Valid types are: space, vcs, name, callsign, shortName, description, encoding, allowDangerousChanges, allowEnormousChanges, status, defaultBranch, fetchRefs, permanentRefs, trackOnly, importOnly, stagingAreaURI, automationBlueprintPHIDs, symbolLanguages, symbolRepositoryPHIDs, publish, filesizeLimit, copyTimeLimit, touchLimit, view, edit, policy.push, projects.add, projects.remove, projects.set, mfa. (ERR-CONDUIT-CORE)

Request Method: 	POST
Request URL: 	http://striker.local.wmftest.net:8080/tools/id/t227508/repos/create
Django Version: 	2.1.4
Exception Type: 	APIError
Exception Value: 	

Transaction with key "6" has invalid type "autoclose". This type is not recognized. Valid types are: space, vcs, name, callsign, shortName, description, encoding, allowDangerousChanges, allowEnormousChanges, status, defaultBranch, fetchRefs, permanentRefs, trackOnly, importOnly, stagingAreaURI, automationBlueprintPHIDs, symbolLanguages, symbolRepositoryPHIDs, publish, filesizeLimit, copyTimeLimit, touchLimit, view, edit, policy.push, projects.add, projects.remove, projects.set, mfa. (ERR-CONDUIT-CORE)

Exception Location: 	./striker/phabricator.py in post, line 75

Striker is trying to set "autoclose: false" on the newly created repo. This was done to keep folks from accidentally closing tasks just by committing a change that referenced the task. This feature was changed upstream in Phabricator relatively recently for https://secure.phabricator.com/T13277 (In repositories, realign "Track Only", "Autoclose", and "Publish/Notify" toward "Permanent Refs"). Specifically rPHAB8f43c773b832: Remove nearly all remaining references to "Autoclose" removed the old setting.

The choice we have now is to either disable all "publication" of Diffusion changes which means mostly that they will not show up in the timeline of mentioned tasks, or to allow that publication (Phabricator's default behavior) but also allow Diffusion commits to close tasks by referencing them in the commit message. Erroring on the side of caution and disabling publication entirely seems the best way forward.

Change 521367 had a related patch set uploaded (by BryanDavis; owner: Bryan Davis):
[labs/striker@master] Diffusion: change options for new repos

https://gerrit.wikimedia.org/r/521367

When will I be able to create one? After this getting deployed?

When will I be able to create one? After this getting deployed?

Yes, but I can also manually create a repo for you since deployment may take a a while longer. Would "tool-twitter-to-commons" be an acceptable repo name?

Yes, it is correct. Please create one.

Change 521367 merged by jenkins-bot:
[labs/striker@master] Diffusion: change options for new repos

https://gerrit.wikimedia.org/r/521367

Change 523480 had a related patch set uploaded (by BryanDavis; owner: Bryan Davis):
[labs/striker/deploy@master] Bump submodules

https://gerrit.wikimedia.org/r/523480

Change 523480 merged by jenkins-bot:
[labs/striker/deploy@master] Bump submodules

https://gerrit.wikimedia.org/r/523480

Mentioned in SAL (#wikimedia-operations) [2019-07-16T21:15:56Z] <bd808@deploy1001> Started deploy [striker/deploy@247a8a6]: Fixes for ssh key management, git repo creation, and Django upgrade (T221657, T227508)

Mentioned in SAL (#wikimedia-operations) [2019-07-16T21:17:04Z] <bd808@deploy1001> Finished deploy [striker/deploy@247a8a6]: Fixes for ssh key management, git repo creation, and Django upgrade (T221657, T227508) (duration: 01m 08s)

bd808 claimed this task.

Created https://phabricator.wikimedia.org/source/tool-axel/ after deploying fix to validate