API request to edit wiki page fails when project belongs to group
https://sentry.gitlap.com/gitlab/gitlabcom/issues/111669/
NoMethodError: undefined method `username' for Group
Did you mean? users
app/models/project_wiki.rb:191:in `default_message'
"#{@user.username} #{action} page: #{title}"
app/models/project_wiki.rb:185:in `commit_details'
commit_message = message || default_message(action, title)
app/models/project_wiki.rb:125:in `update_page'
commit = commit_details(:updated, message, page.title)
app/models/wiki_page.rb:219:in `block in update'
wiki.update_page(
app/models/wiki_page.rb:261:in `save'
unless yield
...
(138 additional frame(s) were not displayed)
NoMethodError: undefined method `username' for Group
Did you mean? users
API request to edit wiki page fails when project belongs to group
Description of the problem
Trying to edit existing page FAILS:
curl --request PUT \
--data "format=rdoc&content=put_documentation&title=foo" \
--header "PRIVATE-TOKEN: XXXXXXXXXXXXXXXXXXXX" \
"https://gitlab.com/api/v4/projects/3224882/wikis/foo"
Above seams to pass validation but fails with {"message":"500 Internal Server Error"}
Deleting a page FAILS:
curl --request DELETE \
--header "PRIVATE-TOKEN: XXXXXXXXXXXXXXXXXXXX" \
"https://gitlab.com/api/v4/projects/3224882/wikis/foo"
Also fails with {"message":"500 Internal Server Error"}
For personal project WORKS:
In my personal project thorandy/foobar everything seems to work fine. At first a suspected permission problems, but I can not figure it out. Also the error should not be code 500 then?
Which Group/Project (with full path) is experiencing the issue?
Reproduced with ModioAB/agile and ModioBoard/board But working fine for personal project thorandy/foobar
Approximate date/time when the error occurred
2017-10-10
Setup: Creating a page WORKS:
curl --request POST \
--data "format=rdoc&content=documentation_post&title=foo" \
--header "PRIVATE-TOKEN: XXXXXXXXXXXXXXXXXXXX" \
"https://gitlab.com/api/v4/projects/3224882/wikis"
Above works and page is created (verified in browser).
Edited by Mark Fletcher