Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL Certificate add failed, Error: 183 Cannot create a file when that file already exists #919

Open
jabteles opened this issue Mar 10, 2021 · 12 comments · May be fixed by #1153
Open

SSL Certificate add failed, Error: 183 Cannot create a file when that file already exists #919

jabteles opened this issue Mar 10, 2021 · 12 comments · May be fixed by #1153

Comments

@jabteles
Copy link

Hi,

Having the same issue as reported in #623, we created a new certificate, same subject name, different thumbprint.

In the task, only changed the thumbprint for the new cert and the task fails with the error "SSL Certificate add failed, Error: 183 Cannot create a file when that file already exists"

I attach the Task verbose_log

@SlyckLizzie
Copy link

I am also having this same problem.

@jabteles
Copy link
Author

Would be great to have news on this

@iambigred
Copy link

We are encountering the same issue. Seems like such a fundamental problem that has been unresolved for years.

It's been raised with MS since 2019: https://developercommunity.visualstudio.com/t/iis-web-app-manage-task-should-replace-the-certifi/547395

@lzocateli
Copy link

I'm having the same problem, does anyone have a workaround?

@jabteles
Copy link
Author

I'm having the same problem, does anyone have a workaround?

Removing the certificate (PowerShell) before executing this task

@yepeekai
Copy link

I found the problem. The output of "netsh http show sslcert" is different in new version of windows server vs older ones. The number of empty lines at the beginning varies.

Problematic file

The following line is there twice in the script and assume that the relevant information is at line 4 but for newer windows, the information is at line 6. I think this should be modified and be more robust.
$isItSameBinding = $result.Get(4).Contains([string]::Format("{0}:{1}", $hostname, $port))

I don't have time in the short term but the idea would be either to skip empty lines or having a regex searching for the relevant line.

yepeekai pushed a commit to yepeekai/azure-pipelines-extensions that referenced this issue Apr 26, 2023
…t of netsh. Also support if there is more than one certificate. fix microsoft#919
@coolhome
Copy link

@DrMueller
Copy link

Hello there
Got here because I'm currently wrestling with this error. Does anyone have an idea how to circumvent it for the time being?

@krilbe
Copy link

krilbe commented Feb 20, 2024

Can we get this fixed? As far as I know deployment groups are still officially supported and not deprecated, so the task IIS Web App Manage (for deployment groups) should be maintained and receive bugfixes. Or is it some kind of dead end?

@lobbo232
Copy link

Just started encountering this ourselves.
I didn't want to remove the certificate every time as makes rollbacks harder.

Can we get some feedback from developers on this please? There's still an open PR with a proposed fix for it too.
@omeshp perhaps you could shed some insight?

@alex-johnson24
Copy link

Updating our servers this month and just ran into this - would love to see it fixed to continue using ADO smoothly. The more custom powershell in a deployment, the more fragile it is.

@JasonRodman
Copy link

I see some fixes have been merged, but devops only shows 0.* version available. If this task is supposed to be version 3, why aren't any other versions showing up? When do these changes show up in devops?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet