mirror of
https://github.com/certera-io/certera.git
synced 2026-04-25 11:15:55 +03:00
[GH-ISSUE #11] Exception during running DNS challenge scripts #10
Labels
No labels
bug
feature-request
feature-request
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/certera#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nomailme on GitHub (Sep 17, 2020).
Original GitHub issue: https://github.com/certera-io/certera/issues/11
Hello,
I have troubles using DNS challenge creation/deletion scripts. The thing is that when a certificate is being requested I get an exception during attempt to run a script.
System.ComponentModel.Win32Exception (2): No such file or directory at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec) at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at Certera.Web.AcmeProviders.CertesAcmeProvider.RunProcess(String file, String args, String envVars)I figured out that the scripts are running fine unless you set any Environment Variables. So I belive that the problem is at CertesAcmeProvider.cs line number 258:
if (!isWindows) { file = EnvironmentVariableHelper.ToNixEnvVars(envVars) + file; }I'll try to create a sample project this week to try to inject environment variables in a different manner and see if it will help
OS: Ubuntu 20.04
PS. These scripts work fine if I create a bash script and use environment variables there.
@certeraio commented on GitHub (Sep 17, 2020):
I suspected this could be an issue. I ran into some problems here due to the differences between Windows and *nix when it comes to setting environment variables.
I appreciate you looking into this! That is extremely helpful.
Also, I'm glad you found the work-around of using the bash script. That was exactly what I was going to recommend!
@nomailme commented on GitHub (Sep 18, 2020):
Everything turns out to be more simple than it looks. Submitted a pull request.
Works fine on Ubuntu 20.04
@certeraio commented on GitHub (Sep 20, 2020):
Hi @nomailme!
Thanks for the PR. Merged and new release here: https://github.com/certera-io/certera/releases/tag/2.1.3
Looks like it boiled down to the following:
process.StartInfo.EnvironmentVariables[kv.Key] = kv.Value;replaced with
process.StartInfo.Environment.Add(item.Key.Trim(), item.Value.Trim());Great find!