You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by "Jeremy Mitchell (JIRA)" <ji...@apache.org> on 2017/05/15 19:40:04 UTC

[jira] [Created] (TC-308) hdr_rw_* gets inserted in profiles, but they don't get removed...

Jeremy Mitchell created TC-308:
----------------------------------

             Summary: hdr_rw_* gets inserted in profiles, but they don't get removed...
                 Key: TC-308
                 URL: https://issues.apache.org/jira/browse/TC-308
             Project: Traffic Control
          Issue Type: New Feature
          Components: Traffic Ops
            Reporter: Jeremy Mitchell
            Priority: Minor


Moved from https://github.com/Comcast/traffic_control/issues/714

Spend lots of time troubleshooting an config file generation issue which referred to a delivery service that was deleted or renamed.

If you look at the Profile Parameters, you'll notice there is entries you probably never created yourselves. During configuration file generation, looks like it looks for "^hdr_rw_mid" to see if needs to generate a file.

If the parameter still exists and the delivery service doesn't, it throws an error on either line 1210 or 1216 (looks like edge_header_rewrite is causing a problem too).

Removing the parameter does fix the problem. Do we really need to insert those "locations" in the database?

sub header_rewrite_dot_config {
    my $self = shift;
    my $id   = shift;
    my $file = shift;

    my $server    = $self->server_data($id);
    my $text      = $self->header_comment( $server->host_name );
    my $ds_xml_id = undef;
    if ( $file =~ /^hdr_rw_mid_(.*)\.config$/ ) {
        $ds_xml_id = $1;
        my $ds = $self->db->resultset('Deliveryservice')->search( { xml_id => $ds_xml_id }, { prefetch => [ 'type', 'profile' ] } )->single();
        my $actions = $ds->mid_header_rewrite;
        $text .= $actions . "\n";
    }



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)