Internal Service Error Changing Application Settings (API)

When trying to change my application settings in my local GitLab instance using
root@gitlabvm:/# curl --request PUT --header “PRIVATE-TOKEN: EC5mPx1sMayCLquXPmRJ” “http://192.168.0.9/api/v4/application/settings?local_markdown_version=1

I’m getting this error
{“message”:“500 Internal Server Error”}

I can check the settings with:
root@gitlabvm:/# curl --header “PRIVATE-TOKEN: EC5mPx1sMayCLquXPmRJ” “http://192.168.0.9/api/v4/application/settings”
and get back the ‘expected response’.

What is preventing me from changing the setting using this API call? Is there another way to change the setting?

Hi,

First question, is the token that you using an admin token? The settings can only be changed by a user that is an admin. From here: Application settings API | GitLab

These API calls allow you to read and modify GitLab instance application settings as they appear in /admin/application_settings/general . You must be an administrator to perform this action.

Otherwise, according to the above link the curl command and url is correct, so I expect it’s not being attempted with an admin user login or token. The link below also hints that it’s correctly formatted. It can only be changed via API unfortunately, no GUI setting from browser to change this.

https://docs.gitlab.com/ee/administration/invalidate_markdown_cache.html

Thanks for your message.

I’d set the gitlab-rake backup location to a mounted disk on my network that the GitLab user didn’t have ownership of. After changing it back to the default and re-configuring, I’m able to use the command to change the setting.

Ah good find! Glad you got it sorted.