Can't create users from Sonarqube due to 404 error

I can navigate the Sonarqube pages, deactivate users no problem, but when I go to add a user I get a 404 error here:

POST https://server_name/api/v2/users 404 (Not Found)

In looking further, I notice that the deactivate command goes here:

Request URL:
Request URL:
https://server_name/sonarqube/api/v2/users/some_user@xompany.com?anonymize=false
Request Method:
DELETE
Status Code:
204 No Content

However, when I click create, it goes here, leaving out the sonarqube segment of the URL:

Request URL:
https://server_name/api/v2/users
Request Method:
POST
Status Code:
404 Not Found
Remote Address:
Referrer Policy:
strict-origin-when-cross-origin

I’m using SonarQube ID information
Version: 10.3.0.82913
Date: 2024-06-04
Installed on Windows, using IIS reverse proxy:

    <rule name="ReverseProxyInboundRule1" stopProcessing="true">
        <match url="(.*)" />
        <action type="Rewrite" url="http://server_name:9000/sonarqube/{R:1}" logRewrittenUrl="false" />
        <serverVariables>
                <set name="X_FORWARDED_PROTO" value="https" />
        </serverVariables>
    </rule>

I notice in your code, users.ts you do something different for postUser and deleteUser:

export function postUser(data: {
  email?: string;
  login: string;
  name: string;
  password?: string;
  scmAccounts: string[];
}) {
  return axiosToCatch.post<RestUserDetailed>('/api/v2/users', data);
}

export function updateUser(
  id: string,
  data: Partial<Pick<RestUserDetailed, 'email' | 'name' | 'scmAccounts'>>,
) {
  return axiosToCatch.patch<RestUserDetailed>(`/api/v2/users/${id}`, data);
}

export function deleteUser({ login, anonymize }: { login: string; anonymize?: boolean }) {
  return axios.delete(`/api/v2/users/${login}`, { params: { anonymize } });
}

Hey there.

This is an inactive version of SonarQube – the latest version is v10.5 and should provide a fix for this. SONAR-21118