[jira] [Commented] (TC-83) traffic_ops reports "Response was Error creating key and csr" when generating key for an HTTPS DS

2017-01-05 Thread Zhilin Huang (JIRA)

[ 
https://issues.apache.org/jira/browse/TC-83?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15803238#comment-15803238
 ] 

Zhilin Huang commented on TC-83:


Hi David,

I do not this error related to riak responding. Below is the code in 
"traffic_ops/app/lib/MojoPlugins/SslKeys.pm":
 48 #generate key and csr
 49 my $result = UI::Utils->exec_command(
 50 "openssl req -nodes -newkey rsa:2048 -keyout 
$TMP_LOCATION/$hostname.key -out $TMP_LOCATION/$hostname.csr -subj 
/C=\"$country\"/ST=\"$state\"/L=\"$city\"/O=\"$org\"/OU=\"
$unit\"/CN=$hostname"
 51 );
 52 if ( $result != 0 ) {
 53 $response = { _rc => 400, _content => "Error creating key 
and csr. Result is $result" };
 54 return $response;
 55 }

>From above code, this error "Error creating key and csr. Result is $result" 
>only happens when executing openssl command in Traffic Ops.

And in our testbed only restart traffic_ops will recover. The reason is forked 
child process reaped by system, and "wait()" in the parent failed.

Another evidence is when this issue happens, we could find the key and car file 
actually generated under "/var/tmp" location. So the command should have been 
executed successfully.

> traffic_ops reports "Response was Error creating key and csr" when generating 
> key for an HTTPS DS
> -
>
> Key: TC-83
> URL: https://issues.apache.org/jira/browse/TC-83
> Project: Traffic Control
>  Issue Type: Bug
>  Components: Traffic Ops
>Affects Versions: 1.7.0
>Reporter: Zhilin Huang
>
> traffic_ops reports "Response was Error creating key and csr. Result is -1" 
> when generating key for an HTTPS DS. This happens when traffic_ops has not 
> been restarted for a day or so. Restarting traffic_ops will recover.



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


[jira] [Commented] (TC-83) traffic_ops reports "Response was Error creating key and csr" when generating key for an HTTPS DS

2017-01-05 Thread David Neuman (JIRA)

[ 
https://issues.apache.org/jira/browse/TC-83?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15802694#comment-15802694
 ] 

David Neuman commented on TC-83:


so, I have seen "Response was Error creating key and csr. Result is -1" before, 
but usually it does not require a restart of traffic_ops.  Usually there is 
something else going on like riak not responding...

> traffic_ops reports "Response was Error creating key and csr" when generating 
> key for an HTTPS DS
> -
>
> Key: TC-83
> URL: https://issues.apache.org/jira/browse/TC-83
> Project: Traffic Control
>  Issue Type: Bug
>  Components: Traffic Ops
>Affects Versions: 1.7.0
>Reporter: Zhilin Huang
>
> traffic_ops reports "Response was Error creating key and csr. Result is -1" 
> when generating key for an HTTPS DS. This happens when traffic_ops has not 
> been restarted for a day or so. Restarting traffic_ops will recover.



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


[jira] [Commented] (TC-83) traffic_ops reports "Response was Error creating key and csr" when generating key for an HTTPS DS

2017-01-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TC-83?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15797081#comment-15797081
 ] 

ASF GitHub Bot commented on TC-83:
--

GitHub user zhilhuan opened a pull request:

https://github.com/apache/incubator-trafficcontrol/pull/155

[TC-83] make sure parent process will wait child exit before fork

In every 5 minutes, "GET /internal/api/1.2/cdns/dnsseckeys/refresh.json" 
will be triggered, and code in "sub dnssec_keys_refresh" will call 
"$self->daemonize();".

Code in "daemonize()" will make "$SIG{CHLD} = 'IGNORE';", which causes 
child process automatically reaped. And "wait" in parent process will fail with 
return code -1.

And traffic_ops have a group of child processes to process UI/API http 
requests. So after several hours almost all those child processes will set CHLD 
handler to "IGNORE". Issue TC-83 will be triggered then.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/zhilhuan/incubator-trafficcontrol TC-83

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-trafficcontrol/pull/155.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #155


commit 5f7c2015de52754ad88851bead757aae48ef49f1
Author: Zhilin Huang 
Date:   2017-01-04T03:53:45Z

make sure parent process will wait child exit before fork




> traffic_ops reports "Response was Error creating key and csr" when generating 
> key for an HTTPS DS
> -
>
> Key: TC-83
> URL: https://issues.apache.org/jira/browse/TC-83
> Project: Traffic Control
>  Issue Type: Bug
>  Components: Traffic Ops
>Affects Versions: 1.7.0
>Reporter: Zhilin Huang
>
> traffic_ops reports "Response was Error creating key and csr. Result is -1" 
> when generating key for an HTTPS DS. This happens when traffic_ops has not 
> been restarted for a day or so. Restarting traffic_ops will recover.



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