500 error previewing variables when unset tenant template variables

(Richard Reeves) #1

When accessing the preview of the variables at… “/api/variables/preview?project={projectId}&environment={environmentId}&tenant={tenantId}” …we got:

System.Net.Http.HttpRequestException : Response status code does not indicate success: 500 (Internal Server Error).

This occurred when a new “Variable Templates” template had been added to an existing “Variable Set” which was used by the project; but the values for that template had not yet been set up.

As an aside: the reason it didn’t have values is that I was not able to set values for this new template because the Library Set is used by other projects which I do not have permissions on. This seems problematic; but that isn’t the main point of this topic.

I would have expected the API to be able to return, rather than crash with a 500 error.

Server is v2018.12.1