azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

az postgres up: failed to deploy database because of conflicting server name

Open chenlomis opened this issue 6 years ago • 2 comments

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug

Failed to deploy database because of conflicting server name, even though server name appears to be auto-generated

To Reproduce Steps to reproduce the behavior.

Expected behavior A clear and concise description of what you expected to happen.

Environment summary Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (az --version) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)

Additional context Add any other context about the problem here.

chenlomis avatar Dec 20 '19 18:12 chenlomis

add to S164.

yonzhan avatar Dec 21 '19 12:12 yonzhan

It is because we will cache first generated random server name.

Typically, when running az postgres up, we will find cached resource group and server name first. And if existing, we will upgrate the server with other parameters.

But in the video scenario, in the second time, with additional -g parameter, with first cached server name, CLI will try to create a server with existing name in a new resource group, which will cause error:

"Specified server name 'server458246064' is already used. Please use a different name and try again."

Juliehzl avatar Mar 12 '20 13:03 Juliehzl