The output of dehydrated which I pipe to a logfile is the folowing:
Do 15. Mär 07:15:01 CET 2018
# INFO: Using main config file /opt/dehydrated/config
Processing tb-itf.de with alternative names: www.domain.de
+ Checking domain name(s) of existing cert... unchanged.
+ Checking expire date of existing cert...
+ Valid till Apr 3 22:05:12 2018 GMT Certificate will expire
(Less than 30 days). Renewing!
+ Signing domains...
+ Generating private key...
+ Generating signing request...
+ Requesting new certificate order from CA...`
If I call the script directly on the bash, everything works fine.
I set the PATH and environment SHELL in the crontab. I also tried to run the command above with /usr/bin/bash -c but no change in the result.
Any ideas? Thank you!
Originally created by @TB1234 on GitHub (Mar 15, 2018).
Old Version: VERSION="0.4.0" -> working - no problem
Vew Version: VERSION="git-master-after-0.6.1" -> throws this problem
System: ArchLinux x64
I create an renew certificates with dehydrated. For this I call the script with a PHP-Script with call the paramteres. A call looks like this:
$cmd = '/opt/dehydrated/dehydrated -c -o '.CertStore.' -a '.$row3['algo'].' -d '.$row3['domain'].' 2>&1 >> /var/log/dehydrated/dehydrated.log';
// other Code for addional Domains and --force Parameter if required
exec($cmd, $return, $ret_val);
In the old version everything works fine. New certificates are created an old ones are renewed.
If this script is called in a cronjob I cot a broken pipe error:
cat: Schreibfehler: Datenübergabe unterbrochen (broken pipe)
The output of dehydrated which I pipe to a logfile is the folowing:
Do 15. Mär 07:15:01 CET 2018
# INFO: Using main config file /opt/dehydrated/config
Processing tb-itf.de with alternative names: www.domain.de
+ Checking domain name(s) of existing cert... unchanged.
+ Checking expire date of existing cert...
+ Valid till Apr 3 22:05:12 2018 GMT Certificate will expire
(Less than 30 days). Renewing!
+ Signing domains...
+ Generating private key...
+ Generating signing request...
+ Requesting new certificate order from CA...`
If I call the script directly on the bash, everything works fine.
I set the PATH and environment SHELL in the crontab. I also tried to run the command above with `/usr/bin/bash -c` but no change in the result.
Any ideas? Thank you!
@TB1234 please run it like this: bash -x /opt/dehydrated/dehydrated -c -o /etc/ssl/reksys -a secp384r1 -d domain.de >> /var/log/dehydrated/dehydrated.log 2>&1
@lukas2511 commented on GitHub (Mar 15, 2018):
@TB1234 please run it like this: `bash -x /opt/dehydrated/dehydrated -c -o /etc/ssl/reksys -a secp384r1 -d domain.de >> /var/log/dehydrated/dehydrated.log 2>&1`
@TB1234 please just run it exactly like this: bash -x /opt/dehydrated/dehydrated -c -o /etc/ssl/reksys -a secp384r1 -d domain.de
your output is unusable since you are passing your actual command as parameter, which makes no sense
@lukas2511 commented on GitHub (Mar 15, 2018):
@TB1234 please just run it exactly like this: `bash -x /opt/dehydrated/dehydrated -c -o /etc/ssl/reksys -a secp384r1 -d domain.de`
your output is unusable since you are passing your actual command as parameter, which makes no sense
Also the output of dehydrated --version would be helpful.
@lukas2511 commented on GitHub (Mar 15, 2018):
Hu, that looks really weird...
Can you look for this section in the code (end of `http_request` method)...
```
if { true >&4; } 2>/dev/null; then
cat "${tempheaders}" >&4
fi
cat "${tempcont}"
rm -f "${tempcont}"
rm -f "${tempheaders}"
```
...and add some debug code like this...
```
echo "checking pipe 4" >&2
if { true >&4; } 2>/dev/null; then
echo "using pipe 4" >&2
cat "${tempheaders}" >&4
fi
echo "getting curl output" >&2
cat "${tempcont}"
echo "deleting temp files" >&2
rm -f "${tempcont}"
rm -f "${tempheaders}"
```
... and tell me what the result is?
Also the output of `dehydrated --version` would be helpful.
My best guess is that somehow filedescriptor 4 is open when the script starts and closes on first operation (which would be the check if it's open...)
Could you try placing something like { true >&4; } 2>/dev/null || true right at the beginning of the script (above set -e) and see if that changes anything?
@lukas2511 commented on GitHub (Mar 15, 2018):
My best guess is that somehow filedescriptor 4 is open when the script starts and closes on first operation (which would be the check if it's open...)
Could you try placing something like `{ true >&4; } 2>/dev/null || true` right at the beginning of the script (above `set -e`) and see if that changes anything?
#!/usr/bin/env bash
# dehydrated by lukas2511
# Source: https://dehydrated.de
#
# This script is licensed under The MIT License (see LICENSE for more information).
{ true >&4; } 2>/dev/null || true
set -e
set -u
set -o pipefail
[[ -n "${ZSH_VERSION:-}" ]] && set -o SH_WORD_SPLIT && set +o FUNCTION_ARGZERO && set -o NULL_GLOB && set -o noglob
[[ -z "${ZSH_VERSION:-}" ]] && shopt -s nullglob && set -f
# Close weird external file descriptors
exec 3>&-
exec 4>&-
... above set -e and see if that changes anything?
@lukas2511 commented on GitHub (Mar 15, 2018):
Can you try adding...
```
# Close weird external file descriptors
exec 3>&-
exec 4>&-
```
... above `set -e` and see if that changes anything?
The Certificate was created sucessfully. I will test it the next days but at the moment that could be the solutions for this strange problem.
@TB1234 commented on GitHub (Mar 15, 2018):
IT WORKED! :-D
The Certificate was created sucessfully. I will test it the next days but at the moment that could be the solutions for this strange problem.
Merged into master, will be in the next release unless somebody screams that this breaks lots of other stuff ¯\(ツ)/¯
@lukas2511 commented on GitHub (Mar 15, 2018):
Merged into master, will be in the next release unless somebody screams that this breaks lots of other stuff ¯\\_(ツ)_/¯
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @TB1234 on GitHub (Mar 15, 2018).
Old Version: VERSION="0.4.0" -> working - no problem
Vew Version: VERSION="git-master-after-0.6.1" -> throws this problem
System: ArchLinux x64
I create an renew certificates with dehydrated. For this I call the script with a PHP-Script with call the paramteres. A call looks like this:
In the old version everything works fine. New certificates are created an old ones are renewed.
If this script is called in a cronjob I cot a broken pipe error:
The output of dehydrated which I pipe to a logfile is the folowing:
If I call the script directly on the bash, everything works fine.
I set the PATH and environment SHELL in the crontab. I also tried to run the command above with
/usr/bin/bash -cbut no change in the result.Any ideas? Thank you!
@lukas2511 commented on GitHub (Mar 15, 2018):
Can you run
bash -x dehydrated -cand post the last few lines before it exits?@TB1234 commented on GitHub (Mar 15, 2018):
Of course, here it is:
@lukas2511 commented on GitHub (Mar 15, 2018):
@TB1234 please run it like this:
bash -x /opt/dehydrated/dehydrated -c -o /etc/ssl/reksys -a secp384r1 -d domain.de >> /var/log/dehydrated/dehydrated.log 2>&1@TB1234 commented on GitHub (Mar 15, 2018):
Here it is, but also with an
unkown parameter detect?!@TB1234 commented on GitHub (Mar 15, 2018):
Oh, above there's an error in the call of dehydratet. I fixed that, but the problem is still the same:
@lukas2511 commented on GitHub (Mar 15, 2018):
@TB1234 please just run it exactly like this:
bash -x /opt/dehydrated/dehydrated -c -o /etc/ssl/reksys -a secp384r1 -d domain.deyour output is unusable since you are passing your actual command as parameter, which makes no sense
@TB1234 commented on GitHub (Mar 15, 2018):
Oh sorry, my fault...
@lukas2511 commented on GitHub (Mar 15, 2018):
Hu, that looks really weird...
Can you look for this section in the code (end of
http_requestmethod)......and add some debug code like this...
... and tell me what the result is?
Also the output of
dehydrated --versionwould be helpful.@TB1234 commented on GitHub (Mar 15, 2018):
Here's the version output:
And here's the output including your Debug Code:
@lukas2511 commented on GitHub (Mar 15, 2018):
My best guess is that somehow filedescriptor 4 is open when the script starts and closes on first operation (which would be the check if it's open...)
Could you try placing something like
{ true >&4; } 2>/dev/null || trueright at the beginning of the script (aboveset -e) and see if that changes anything?@TB1234 commented on GitHub (Mar 15, 2018):
I changes the script to this:
But there is noch change if I see that right:
@lukas2511 commented on GitHub (Mar 15, 2018):
Can you try adding...
... above
set -eand see if that changes anything?@TB1234 commented on GitHub (Mar 15, 2018):
IT WORKED! :-D
The Certificate was created sucessfully. I will test it the next days but at the moment that could be the solutions for this strange problem.
@lukas2511 commented on GitHub (Mar 15, 2018):
Merged into master, will be in the next release unless somebody screams that this breaks lots of other stuff ¯\(ツ)/¯