[ 
https://issues.apache.org/jira/browse/VCL-871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14581951#comment-14581951
 ] 

Andy Kurth commented on VCL-871:
--------------------------------

Need to check the length of the file contents.  If the file being created is 
too large, a file should be created locally on the management node and copied 
to the computer.

The error below is still occurring.  There are a few things going on.  The 
example is attempting to modify /etc/sysconfig/iptables on a NAT host with a 
very large number of existing rules.

This also identifies a problem in run_ssh_command.  A Perl warning is being 
generated within the eval block but the code isn't catching it.  As a result, 
$ssh_output is undefined yet run_ssh_command attempts to regex it.

_Note: line numbers are not the same as in trunk or the 2.4.2 release_
{noformat}
Can't exec "/bin/sh": Argument list too long at
        /usr/local/vcl/bin/../lib/VCL/utils.pm line 4278 (#1)
    (W exec) A system(), exec(), or piped open call could not execute the
    named program for the indicated reason.  Typical reasons include: the
    permissions were wrong on the file, the file wasn't found in
    $ENV{PATH}, the executable in question was compiled for another
    architecture, or the #! line in a script points to an interpreter that
    can't be run for similar reasons.  (Or maybe your system doesn't support
    #! at all.)


|21615|4968|4991|deleted|vcld242:warning_handler|633| ---- WARNING ----
|21615|4968|4991|deleted|vcld242:warning_handler|633| 2015-06-11 
09:53:05|21615|4968|4991|deleted|vcld242:warning_handler|633|Can't exec 
"/bin/sh": Argument list too long at /usr/local/vcl/bin/../lib/VCL/utils.pm 
line 4278.
|21615|4968|4991|deleted|vcld242:warning_handler|633| ( 0) vcld242, 
warning_handler (line: 633)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-1) utils.pm, (eval) 
(line: 4278)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-2) utils.pm, 
run_ssh_command (line: 4267)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-3) OS.pm, execute 
(line: 2499)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-4) OS.pm, 
create_text_file (line: 2204)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-5) iptables.pm, 
save_configuration (line: 1385)

Use of uninitialized value $ssh_output in substitution (s///) at
        /usr/local/vcl/bin/../lib/VCL/utils.pm line 4323 (#1)
    (W uninitialized) An undefined value was used as if it were already
    defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
    To suppress this warning assign a defined value to your variables.

    To help you figure out what was undefined, perl will try to tell you the
    name of the variable (if any) that was undefined. In some cases it cannot
    do this, so it also tells you what operation you used the undefined value
    in.  Note, however, that perl optimizes your program and the operation
    displayed in the warning may not necessarily appear literally in your
    program.  For example, "that $foo" is usually optimized into "that "
    . $foo, and the warning will refer to the concatenation (.) operator,
    even though there is no . in your program.


|21615|4968|4991|deleted|vcld242:warning_handler|633| ---- WARNING ----
|21615|4968|4991|deleted|vcld242:warning_handler|633| 2015-06-11 
09:53:05|21615|4968|4991|deleted|vcld242:warning_handler|633|Use of 
uninitialized value $ssh_output in substitution (s///) at 
/usr/local/vcl/bin/../lib/VCL/utils.pm line 4323.
|21615|4968|4991|deleted|vcld242:warning_handler|633| ( 0) vcld242, 
warning_handler (line: 633)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-1) utils.pm, 
run_ssh_command (line: 4323)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-2) OS.pm, execute 
(line: 2499)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-3) OS.pm, 
create_text_file (line: 2204)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-4) iptables.pm, 
save_configuration (line: 1385)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-5) iptables.pm, 
sanitize_reservation (line: 489)


|21615|4968|4991|deleted|vcld242:warning_handler|633| ---- WARNING ----
|21615|4968|4991|deleted|vcld242:warning_handler|633| 2015-06-11 
09:53:05|21615|4968|4991|deleted|vcld242:warning_handler|633|Use of 
uninitialized value $ssh_output in substitution (s///) at 
/usr/local/vcl/bin/../lib/VCL/utils.pm line 4332.
|21615|4968|4991|deleted|vcld242:warning_handler|633| ( 0) vcld242, 
warning_handler (line: 633)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-1) utils.pm, 
run_ssh_command (line: 4332)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-2) OS.pm, execute 
(line: 2499)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-3) OS.pm, 
create_text_file (line: 2204)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-4) iptables.pm, 
save_configuration (line: 1385)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-5) iptables.pm, 
sanitize_reservation (line: 489)


|21615|4968|4991|deleted|vcld242:warning_handler|633| ---- WARNING ----
|21615|4968|4991|deleted|vcld242:warning_handler|633| 2015-06-11 
09:53:05|21615|4968|4991|deleted|vcld242:warning_handler|633|Use of 
uninitialized value $ssh_output in substitution (s///) at 
/usr/local/vcl/bin/../lib/VCL/utils.pm line 4333.
|21615|4968|4991|deleted|vcld242:warning_handler|633| ( 0) vcld242, 
warning_handler (line: 633)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-1) utils.pm, 
run_ssh_command (line: 4333)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-2) OS.pm, execute 
(line: 2499)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-3) OS.pm, 
create_text_file (line: 2204)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-4) iptables.pm, 
save_configuration (line: 1385)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-5) iptables.pm, 
sanitize_reservation (line: 489)


|21615|4968|4991|deleted|vcld242:warning_handler|633| ---- WARNING ----
|21615|4968|4991|deleted|vcld242:warning_handler|633| 2015-06-11 
09:53:05|21615|4968|4991|deleted|vcld242:warning_handler|633|Use of 
uninitialized value $ssh_output in substitution (s///) at 
/usr/local/vcl/bin/../lib/VCL/utils.pm line 4334.
|21615|4968|4991|deleted|vcld242:warning_handler|633| ( 0) vcld242, 
warning_handler (line: 633)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-1) utils.pm, 
run_ssh_command (line: 4334)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-2) OS.pm, execute 
(line: 2499)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-3) OS.pm, 
create_text_file (line: 2204)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-4) iptables.pm, 
save_configuration (line: 1385)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-5) iptables.pm, 
sanitize_reservation (line: 489)


|21615|4968|4991|deleted|vcld242:warning_handler|633| ---- WARNING ----
|21615|4968|4991|deleted|vcld242:warning_handler|633| 2015-06-11 
09:53:05|21615|4968|4991|deleted|vcld242:warning_handler|633|Use of 
uninitialized value $ssh_output in substitution (s///) at 
/usr/local/vcl/bin/../lib/VCL/utils.pm line 4335.
|21615|4968|4991|deleted|vcld242:warning_handler|633| ( 0) vcld242, 
warning_handler (line: 633)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-1) utils.pm, 
run_ssh_command (line: 4335)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-2) OS.pm, execute 
(line: 2499)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-3) OS.pm, 
create_text_file (line: 2204)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-4) iptables.pm, 
save_configuration (line: 1385)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-5) iptables.pm, 
sanitize_reservation (line: 489)


|21615|4968|4991|deleted|vcld242:warning_handler|633| ---- WARNING ----
|21615|4968|4991|deleted|vcld242:warning_handler|633| 2015-06-11 
09:53:05|21615|4968|4991|deleted|vcld242:warning_handler|633|Use of 
uninitialized value $ssh_output in substitution (s///) at 
/usr/local/vcl/bin/../lib/VCL/utils.pm line 4336.
|21615|4968|4991|deleted|vcld242:warning_handler|633| ( 0) vcld242, 
warning_handler (line: 633)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-1) utils.pm, 
run_ssh_command (line: 4336)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-2) OS.pm, execute 
(line: 2499)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-3) OS.pm, 
create_text_file (line: 2204)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-4) iptables.pm, 
save_configuration (line: 1385)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-5) iptables.pm, 
sanitize_reservation (line: 489)


|21615|4968|4991|deleted|vcld242:warning_handler|633| ---- WARNING ----
|21615|4968|4991|deleted|vcld242:warning_handler|633| 2015-06-11 
09:53:05|21615|4968|4991|deleted|vcld242:warning_handler|633|Use of 
uninitialized value $ssh_output in substitution (s///) at 
/usr/local/vcl/bin/../lib/VCL/utils.pm line 4337.
|21615|4968|4991|deleted|vcld242:warning_handler|633| ( 0) vcld242, 
warning_handler (line: 633)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-1) utils.pm, 
run_ssh_command (line: 4337)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-2) OS.pm, execute 
(line: 2499)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-3) OS.pm, 
create_text_file (line: 2204)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-4) iptables.pm, 
save_configuration (line: 1385)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-5) iptables.pm, 
sanitize_reservation (line: 489)


|21615|4968|4991|deleted|vcld242:warning_handler|633| ---- WARNING ----
|21615|4968|4991|deleted|vcld242:warning_handler|633| 2015-06-11 
09:53:05|21615|4968|4991|deleted|vcld242:warning_handler|633|Use of 
uninitialized value $ssh_output in substitution (s///) at 
/usr/local/vcl/bin/../lib/VCL/utils.pm line 4340.
|21615|4968|4991|deleted|vcld242:warning_handler|633| ( 0) vcld242, 
warning_handler (line: 633)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-1) utils.pm, 
run_ssh_command (line: 4340)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-2) OS.pm, execute 
(line: 2499)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-3) OS.pm, 
create_text_file (line: 2204)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-4) iptables.pm, 
save_configuration (line: 1385)
|21615|4968|4991|deleted|vcld242:warning_handler|633| (-5) iptables.pm, 
sanitize_reservation (line: 489)
{noformat}

> OS.pm::create_text_file fails if content is too long
> ----------------------------------------------------
>
>                 Key: VCL-871
>                 URL: https://issues.apache.org/jira/browse/VCL-871
>             Project: VCL
>          Issue Type: Improvement
>          Components: vcld (backend)
>    Affects Versions: 2.4.2
>            Reporter: Andy Kurth
>            Assignee: Andy Kurth
>            Priority: Minor
>             Fix For: 2.4.3
>
>
> {{OS.pm::create_text_file}} converts each character of the text content 
> argument to its hex value and creates a string passed to _echo -e_.  This 
> normally works correctly and allows single quote charcters to be added to the 
> file.  However, the command fails if the string becomes too long.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to