Skip to content

Fix duplicate role key in committee roster JSON - #326

Merged
sebbASF merged 1 commit into
apache:masterfrom
lhotari:fix-duplicate-role-key
Oct 14, 2026
Merged

sebbASF merged 1 commit into
apache:masterfrom
lhotari:fix-duplicate-role-key

Conversation

@lhotari

@lhotari lhotari commented Oct 14, 2026

Copy link
Copy Markdown
Member

Problem

The committee roster JSON endpoint fails with HTTP 500 for committees with a chair. Example: https://whimsy.apache.org/roster/committee/pulsar.json

sinatra.error = detected duplicate key "role" in {:name=>"Matteo Merli", :date=>"2018-09-19", :role=>"PMC member", "ldap"=>true, "githubUsername"=>"merlimat", "asf_githubStringID"=>"merlimat", :member=>true, "role"=>"PMC chair"}
sinatra.route = GET /committee/:name.json
REQUEST_URI = /roster/committee/pulsar.json

Cause

Roster entries store the role under the symbol key :role, but the chair's role was set with the string key 'role'. The chair's hash therefore has both :role and "role". Older versions of the json gem wrote "role" twice, while newer versions raise "detected duplicate key".

Fix

Set the chair role with :role in Committee (www/roster/models/committee.rb) and NonPMC (www/roster/models/nonpmc.rb), so that it replaces the existing value rather than adding a second key.

The roster entries use a symbol :role key, but the chair role was set
with a string 'role' key. This produced a hash with both keys, and newer
versions of the json gem reject it with "detected duplicate key", which
makes /roster/committee/<name>.json fail with HTTP 500.

Assisted-by: Claude Code (claude-opus-5-5)
@dave2wave
dave2wave requested a review from sebbASF October 14, 2026 09:53
@sebbASF
sebbASF merged commit 3d6b284 into apache:master Oct 14, 2026
1 check passed
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 this pull request may close these issues.

2 participants