line 515: deploy_args: unbound variable #174

Closed
opened 2025-12-29 00:26:27 +01:00 by adam · 7 comments
Owner

Originally created by @lingej on GitHub (Dec 20, 2016).

Hi

running dehydrated version 7f30826a6d on Debian 8

deploy_args is empty on line 515 if challenge_status is "valid" on line 474 ( https://github.com/lukas2511/dehydrated/blob/master/dehydrated#L474

Joerg

./dehydrated -x -c
# INFO: Using main config file /opt/dehydrated/config
Processing www.xxxxx.xx
 + Checking domain name(s) of existing cert... unchanged.
 + Checking expire date of existing cert...
 + Valid till Mar 19 12:48:00 2017 GMT (Longer than 30 days). Ignoring because renew was forced!
 + Signing domains...
 + Generating private key...
 + Generating signing request...
 + Requesting challenge for www.xxxxx.xx...
 + Already validated
./dehydrated: line 515: deploy_args: unbound variable
Originally created by @lingej on GitHub (Dec 20, 2016). Hi running dehydrated version 7f30826a6dad1c1f07641aaa48cccb74480998ab on Debian 8 deploy_args is empty on line 515 if challenge_status is "valid" on line 474 ( https://github.com/lukas2511/dehydrated/blob/master/dehydrated#L474 Joerg ``` ./dehydrated -x -c # INFO: Using main config file /opt/dehydrated/config Processing www.xxxxx.xx + Checking domain name(s) of existing cert... unchanged. + Checking expire date of existing cert... + Valid till Mar 19 12:48:00 2017 GMT (Longer than 30 days). Ignoring because renew was forced! + Signing domains... + Generating private key... + Generating signing request... + Requesting challenge for www.xxxxx.xx... + Already validated ./dehydrated: line 515: deploy_args: unbound variable ```
adam closed this issue 2025-12-29 00:26:27 +01:00
Author
Owner

@speters commented on GitHub (Dec 20, 2016):

Same problem some lines below with check_altnames.

I solved this by surrounding with if [[ ${deploy_args[@]:+${deploy_args[@]}} ]]; then [...] fi, if [[ ${check_altnames[@]:+${ceck_altnames[@]}} ]]; then [...] fi.
But maybe there is a way for proper initialisation with Bash.

@speters commented on GitHub (Dec 20, 2016): Same problem some lines below with check_altnames. I solved this by surrounding with ` if [[ ${deploy_args[@]:+${deploy_args[@]}} ]]; then [...] fi`, ` if [[ ${check_altnames[@]:+${ceck_altnames[@]}} ]]; then [...] fi`. But maybe there is a way for proper initialisation with Bash.
Author
Owner

@Mareak commented on GitHub (Dec 20, 2016):

Hi,

You have to comment the line 476 :

473 challenge_status="$(printf '%s' "${response}" | rm_json_arrays | get_json_string_value status)"
474 if [ "${challenge_status}" = "valid" ]; then
475 echo " + Already validated"
476 #continue
477 fi

@Mareak commented on GitHub (Dec 20, 2016): Hi, You have to comment the line 476 : 473 challenge_status="$(printf '%s' "${response}" | rm_json_arrays | get_json_string_value status)" 474 if [ "${challenge_status}" = "valid" ]; then 475 echo " + Already validated" 476 #continue 477 fi
Author
Owner

@whereisaaron commented on GitHub (Dec 21, 2016):

Commenting out the 'continue' works but break the feature it was supposed to add. I added a test for an empty array around the challenge loop that resolved it for me, and the feature to skip the challenge for already validated names works.

  if [ ${#challenge_altnames[@]} -ne 0 ]; then
    for altname in "${challenge_altnames[@]:0}"; do

...

    done
  fi

I created a pull request #321 to make this change.

@whereisaaron commented on GitHub (Dec 21, 2016): Commenting out the 'continue' works but break the feature it was supposed to add. I added a test for an empty array around the challenge loop that resolved it for me, and the feature to skip the challenge for already validated names works. ``` if [ ${#challenge_altnames[@]} -ne 0 ]; then for altname in "${challenge_altnames[@]:0}"; do ``` ... ``` done fi ```` I created a pull request #321 to make this change.
Author
Owner

@lukas2511 commented on GitHub (Dec 22, 2016):

I've merged #321, this should be fixed now. Thanks.

@lukas2511 commented on GitHub (Dec 22, 2016): I've merged #321, this should be fixed now. Thanks.
Author
Owner

@evlrbot commented on GitHub (Dec 22, 2016):

Just installed and ran the patched code, but am still getting the same error that @lingej posted.

I'm using GNU bash, version 4.3.30(1)-release (arm-unknown-linux-gnueabihf) on Raspbian Jessie.

@evlrbot commented on GitHub (Dec 22, 2016): Just installed and ran the patched code, but am still getting the same error that @lingej posted. I'm using GNU bash, version 4.3.30(1)-release (arm-unknown-linux-gnueabihf) on Raspbian Jessie.
Author
Owner

@lukas2511 commented on GitHub (Dec 22, 2016):

I tested a few ways of checking if the array is empty / the variables are undefined, and I think I found the most compatible way over multiple versions of bash, can you please try again?

@lukas2511 commented on GitHub (Dec 22, 2016): I tested a few ways of checking if the array is empty / the variables are undefined, and I think I found the most compatible way over multiple versions of bash, can you please try again?
Author
Owner

@evlrbot commented on GitHub (Dec 23, 2016):

Just tested your latest changes, and no more error. Thanks!

@evlrbot commented on GitHub (Dec 23, 2016): Just tested your latest changes, and no more error. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#174