Erreur lors de l'ajout d'un repos
Steps to reproduce
- ajouter un repos par l'API, ceci lance automatiquement les calculs
- l'erreur apparait au niveau du
precompute
<pre class="cake-error"><a href="javascript:void(0);" onclick="document.getElementById('cakeErr593aa605cc2dd-trace').style.display = (document.getElementById('cakeErr593aa605cc2dd-trace').style.display == 'none' ? '' : 'none');"><b>Warning</b> (2)</a>: Division by zero [<b>APP/Model/Logic/Divisor/Divisor.php</b>, line <b>93</b>]<div id="cakeErr593aa605cc2dd-trace" class="cake-stack-trace" style="display: none;"><a href="javascript:void(0);" onclick="document.getElementById('cakeErr593aa605cc2dd-code').style.display = (document.getElementById('cakeErr593aa605cc2dd-code').style.display == 'none' ? '' : 'none')">Code</a> <a href="javascript:void(0);" onclick="document.getElementById('cakeErr593aa605cc2dd-context').style.display = (document.getElementById('cakeErr593aa605cc2dd-context').style.display == 'none' ? '' : 'none')">Context</a><pre id="cakeErr593aa605cc2dd-code" class="cake-code-dump" style="display: none;"><code><span style="color: #000000"><span style="color: #0000BB"> </span><span style="color: #007700">private function </span><span style="color: #0000BB">doAverage</span><span style="color: #007700">(</span><span style="color: #0000BB">$numerator</span><span style="color: #007700">, </span><span style="color: #0000BB">$denominator</span><span style="color: #007700">)</span></span></code>
<span class="code-highlight"><code><span style="color: #000000"><span style="color: #0000BB"> </span><span style="color: #007700">{</span></span></code></span>
<code><span style="color: #000000"><span style="color: #0000BB"> </span><span style="color: #007700">return </span><span style="color: #0000BB">$numerator </span><span style="color: #007700">/ </span><span style="color: #0000BB">$denominator</span><span style="color: #007700">;</span></span></code></pre><pre id="cakeErr593aa605cc2dd-context" class="cake-context" style="display: none;">$numerator = (int) 0
$denominator = (int) 0</pre><pre class="stack-trace">App\Model\Logic\Divisor\Divisor::doAverage() - APP/Model/Logic/Divisor/Divisor.php, line 93
App\Model\Logic\Divisor\Divisor::computeAverage() - APP/Model/Logic/Divisor/Divisor.php, line 78
App\Model\Logic\Divisor\Divisor::launchDivisor() - APP/Model/Logic/Divisor/Divisor.php, line 41
App\Controller\Api\V1\APIController::saveAndCompute() - APP/Controller/Api/V1/APIController.php, line 200
App\Controller\Api\V1\APIController::addRepositories() - APP/Controller/Api/V1/APIController.php, line 73
Cake\Controller\Controller::invokeAction() - CORE/src/Controller/Controller.php, line 440
Cake\Http\ActionDispatcher::_invoke() - CORE/src/Http/ActionDispatcher.php, line 119
Cake\Http\ActionDispatcher::dispatch() - CORE/src/Http/ActionDispatcher.php, line 93
Cake\Http\BaseApplication::__invoke() - CORE/src/Http/BaseApplication.php, line 78
Cake\Http\Runner::__invoke() - CORE/src/Http/Runner.php, line 65
Cake\Routing\Middleware\RoutingMiddleware::__invoke() - CORE/src/Routing/Middleware/RoutingMiddleware.php, line 59
Cake\Http\Runner::__invoke() - CORE/src/Http/Runner.php, line 65
Cake\Routing\Middleware\AssetMiddleware::__invoke() - CORE/src/Routing/Middleware/AssetMiddleware.php, line 93
Cake\Http\Runner::__invoke() - CORE/src/Http/Runner.php, line 65
Cake\Error\Middleware\ErrorHandlerMiddleware::__invoke() - CORE/src/Error/Middleware/ErrorHandlerMiddleware.php, line 92
Cake\Http\Runner::__invoke() - CORE/src/Http/Runner.php, line 65
DebugKit\Middleware\DebugKitMiddleware::__invoke() - ROOT/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php, line 52</pre></div></pre><pre class="cake-error"><a href="javascript:void(0);" onclick="document.getElementById('cakeErr593aa605ccb1c-trace').style.display = (document.getElementById('cakeErr593aa605ccb1c-trace').style.display == 'none' ? '' : 'none');"><b>Warning</b> (2)</a>: Division by zero [<b>APP/Model/Logic/Divisor/Divisor.php</b>, line <b>93</b>]<div id="cakeErr593aa605ccb1c-trace" class="cake-stack-trace" style="display: none;"><a href="javascript:void(0);" onclick="document.getElementById('cakeErr593aa605ccb1c-code').style.display = (document.getElementById('cakeErr593aa605ccb1c-code').style.display == 'none' ? '' : 'none')">Code</a> <a href="javascript:void(0);" onclick="document.getElementById('cakeErr593aa605ccb1c-context').style.display = (document.getElementById('cakeErr593aa605ccb1c-context').style.display == 'none' ? '' : 'none')">Context</a><pre id="cakeErr593aa605ccb1c-code" class="cake-code-dump" style="display: none;"><code><span style="color: #000000"><span style="color: #0000BB"> </span><span style="color: #007700">private function </span><span style="color: #0000BB">doAverage</span><span style="color: #007700">(</span><span style="color: #0000BB">$numerator</span><span style="color: #007700">, </span><span style="color: #0000BB">$denominator</span><span style="color: #007700">)</span></span></code>
<span class="code-highlight"><code><span style="color: #000000"><span style="color: #0000BB"> </span><span style="color: #007700">{</span></span></code></span>
<code><span style="color: #000000"><span style="color: #0000BB"> </span><span style="color: #007700">return </span><span style="color: #0000BB">$numerator </span><span style="color: #007700">/ </span><span style="color: #0000BB">$denominator</span><span style="color: #007700">;</span></span></code></pre><pre id="cakeErr593aa605ccb1c-context" class="cake-context" style="display: none;">$numerator = (int) 0
$denominator = (int) 0</pre><pre class="stack-trace">App\Model\Logic\Divisor\Divisor::doAverage() - APP/Model/Logic/Divisor/Divisor.php, line 93
App\Model\Logic\Divisor\Divisor::computeAverage() - APP/Model/Logic/Divisor/Divisor.php, line 79
App\Model\Logic\Divisor\Divisor::launchDivisor() - APP/Model/Logic/Divisor/Divisor.php, line 41
App\Controller\Api\V1\APIController::saveAndCompute() - APP/Controller/Api/V1/APIController.php, line 200
App\Controller\Api\V1\APIController::addRepositories() - APP/Controller/Api/V1/APIController.php, line 73
Cake\Controller\Controller::invokeAction() - CORE/src/Controller/Controller.php, line 440
Cake\Http\ActionDispatcher::_invoke() - CORE/src/Http/ActionDispatcher.php, line 119
Cake\Http\ActionDispatcher::dispatch() - CORE/src/Http/ActionDispatcher.php, line 93
Cake\Http\BaseApplication::__invoke() - CORE/src/Http/BaseApplication.php, line 78
Cake\Http\Runner::__invoke() - CORE/src/Http/Runner.php, line 65
Cake\Routing\Middleware\RoutingMiddleware::__invoke() - CORE/src/Routing/Middleware/RoutingMiddleware.php, line 59
Cake\Http\Runner::__invoke() - CORE/src/Http/Runner.php, line 65
Cake\Routing\Middleware\AssetMiddleware::__invoke() - CORE/src/Routing/Middleware/AssetMiddleware.php, line 93
Cake\Http\Runner::__invoke() - CORE/src/Http/Runner.php, line 65
Cake\Error\Middleware\ErrorHandlerMiddleware::__invoke() - CORE/src/Error/Middleware/ErrorHandlerMiddleware.php, line 92
Cake\Http\Runner::__invoke() - CORE/src/Http/Runner.php, line 65
DebugKit\Middleware\DebugKitMiddleware::__invoke() - ROOT/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php, line 52</pre></div></pre><pre class="cake-error"><a href="javascript:void(0);" onclick="document.getElementById('cakeErr593aa605df0aa-trace').style.display = (document.getElementById('cakeErr593aa605df0aa-trace').style.display == 'none' ? '' : 'none');"><b>Warning</b> (512)</a>: Unable to emit headers. Headers sent in file=/home/mfaure/Documents/Adullact/Dossier-0permanent/0SOURCES/quantified-oss/vendor/cakephp/cakephp/src/Error/Debugger.php line=822 [<b>CORE/src/Http/ResponseEmitter.php</b>, line <b>48</b>]<div id="cakeErr593aa605df0aa-trace" class="cake-stack-trace" style="display: none;"><a href="javascript:void(0);" onclick="document.getElementById('cakeErr593aa605df0aa-code').style.display = (document.getElementById('cakeErr593aa605df0aa-code').style.display == 'none' ? '' : 'none')">Code</a> <a href="javascript:void(0);" onclick="document.getElementById('cakeErr593aa605df0aa-context').style.display = (document.getElementById('cakeErr593aa605df0aa-context').style.display == 'none' ? '' : 'none')">Context</a><pre id="cakeErr593aa605df0aa-code" class="cake-code-dump" style="display: none;"><code><span style="color: #000000"><span style="color: #0000BB"> $message </span><span style="color: #007700">= </span><span style="color: #DD0000">"Unable to emit headers. Headers sent in file=</span><span style="color: #0000BB">$file</span><span style="color: #DD0000"> line=</span><span style="color: #0000BB">$line</span><span style="color: #DD0000">"</span><span style="color: #007700">;</span></span></code>
<span class="code-highlight"><code><span style="color: #000000"><span style="color: #0000BB"> </span><span style="color: #007700">if (</span><span style="color: #0000BB">Configure</span><span style="color: #007700">::</span><span style="color: #0000BB">read</span><span style="color: #007700">(</span><span style="color: #DD0000">'debug'</span><span style="color: #007700">)) {</span></span></code></span>
<code><span style="color: #000000"><span style="color: #0000BB"> trigger_error</span><span style="color: #007700">(</span><span style="color: #0000BB">$message</span><span style="color: #007700">, </span><span style="color: #0000BB">E_USER_WARNING</span><span style="color: #007700">);</span></span></code></pre><pre id="cakeErr593aa605df0aa-context" class="cake-context" style="display: none;">$response = object(Cake\Http\Response) {
'status' => (int) 200,
'contentType' => 'application/json',
'headers' => [
'Content-Type' => [
[maximum depth reached]
]
],
'file' => null,
'fileRange' => [],
'cookies' => [],
'cacheDirectives' => [],
'body' => ''
}
$maxBufferLength = (int) 8192
$file = '/home/mfaure/Documents/Adullact/Dossier-0permanent/0SOURCES/quantified-oss/vendor/cakephp/cakephp/src/Error/Debugger.php'
$line = (int) 822
$message = 'Unable to emit headers. Headers sent in file=/home/mfaure/Documents/Adullact/Dossier-0permanent/0SOURCES/quantified-oss/vendor/cakephp/cakephp/src/Error/Debugger.php line=822'</pre><pre class="stack-trace">Cake\Http\ResponseEmitter::emit() - CORE/src/Http/ResponseEmitter.php, line 48
Cake\Http\Server::emit() - CORE/src/Http/Server.php, line 105
[main] - ROOT/webroot/index.php, line 37</pre></div></pre><pre class="cake-error"><a href="javascript:void(0);" onclick="document.getElementById('cakeErr593aa605df93c-trace').style.display = (document.getElementById('cakeErr593aa605df93c-trace').style.display == 'none' ? '' : 'none');"><b>Warning</b> (2)</a>: Cannot modify header information - headers already sent by (output started at /home/mfaure/Documents/Adullact/Dossier-0permanent/0SOURCES/quantified-oss/vendor/cakephp/cakephp/src/Error/Debugger.php:822) [<b>CORE/src/Http/ResponseEmitter.php</b>, line <b>148</b>]<div id="cakeErr593aa605df93c-trace" class="cake-stack-trace" style="display: none;"><a href="javascript:void(0);" onclick="document.getElementById('cakeErr593aa605df93c-code').style.display = (document.getElementById('cakeErr593aa605df93c-code').style.display == 'none' ? '' : 'none')">Code</a> <a href="javascript:void(0);" onclick="document.getElementById('cakeErr593aa605df93c-context').style.display = (document.getElementById('cakeErr593aa605df93c-context').style.display == 'none' ? '' : 'none')">Context</a><pre id="cakeErr593aa605df93c-code" class="cake-code-dump" style="display: none;"><code><span style="color: #000000"><span style="color: #0000BB"> $response</span><span style="color: #007700">-></span><span style="color: #0000BB">getProtocolVersion</span><span style="color: #007700">(),</span></span></code>
<span class="code-highlight"><code><span style="color: #000000"><span style="color: #0000BB"> $response</span><span style="color: #007700">-></span><span style="color: #0000BB">getStatusCode</span><span style="color: #007700">(),</span></span></code></span>
<code><span style="color: #000000"><span style="color: #0000BB"> </span><span style="color: #007700">(</span><span style="color: #0000BB">$reasonPhrase </span><span style="color: #007700">? </span><span style="color: #DD0000">' ' </span><span style="color: #007700">. </span><span style="color: #0000BB">$reasonPhrase </span><span style="color: #007700">: </span><span style="color: #DD0000">''</span><span style="color: #007700">)</span></span></code></pre><pre id="cakeErr593aa605df93c-context" class="cake-context" style="display: none;">$response = object(Cake\Http\Response) {
'status' => (int) 200,
'contentType' => 'application/json',
'headers' => [
'Content-Type' => [
[maximum depth reached]
]
],
'file' => null,
'fileRange' => [],
'cookies' => [],
'cacheDirectives' => [],
'body' => ''
}
$reasonPhrase = 'OK'</pre><pre class="stack-trace">header - [internal], line ??
Cake\Http\ResponseEmitter::emitStatusLine() - CORE/src/Http/ResponseEmitter.php, line 148
Cake\Http\ResponseEmitter::emit() - CORE/src/Http/ResponseEmitter.php, line 54
Cake\Http\Server::emit() - CORE/src/Http/Server.php, line 105
[main] - ROOT/webroot/index.php, line 37</pre></div></pre><pre class="cake-error"><a href="javascript:void(0);" onclick="document.getElementById('cakeErr593aa605e009b-trace').style.display = (document.getElementById('cakeErr593aa605e009b-trace').style.display == 'none' ? '' : 'none');"><b>Warning</b> (2)</a>: Cannot modify header information - headers already sent by (output started at /home/mfaure/Documents/Adullact/Dossier-0permanent/0SOURCES/quantified-oss/vendor/cakephp/cakephp/src/Error/Debugger.php:822) [<b>CORE/src/Http/ResponseEmitter.php</b>, line <b>178</b>]<div id="cakeErr593aa605e009b-trace" class="cake-stack-trace" style="display: none;"><a href="javascript:void(0);" onclick="document.getElementById('cakeErr593aa605e009b-code').style.display = (document.getElementById('cakeErr593aa605e009b-code').style.display == 'none' ? '' : 'none')">Code</a> <a href="javascript:void(0);" onclick="document.getElementById('cakeErr593aa605e009b-context').style.display = (document.getElementById('cakeErr593aa605e009b-context').style.display == 'none' ? '' : 'none')">Context</a><pre id="cakeErr593aa605e009b-code" class="cake-code-dump" style="display: none;"><code><span style="color: #000000"><span style="color: #0000BB"> </span><span style="color: #007700">foreach (</span><span style="color: #0000BB">$values </span><span style="color: #007700">as </span><span style="color: #0000BB">$value</span><span style="color: #007700">) {</span></span></code>
<span class="code-highlight"><code><span style="color: #000000"><span style="color: #0000BB"> header</span><span style="color: #007700">(</span><span style="color: #0000BB">sprintf</span><span style="color: #007700">(</span></span></code></span>
<code><span style="color: #000000"><span style="color: #0000BB"> </span><span style="color: #DD0000">'%s: %s'</span><span style="color: #007700">,</span></span></code></pre><pre id="cakeErr593aa605e009b-context" class="cake-context" style="display: none;">$response = object(Cake\Http\Response) {
'status' => (int) 200,
'contentType' => 'application/json',
'headers' => [
'Content-Type' => [
[maximum depth reached]
]
],
'file' => null,
'fileRange' => [],
'cookies' => [],
'cacheDirectives' => [],
'body' => ''
}
$cookies = []
$values = [
(int) 0 => 'application/json; charset=UTF-8'
]
$name = 'Content-Type'
$first = true
$value = 'application/json; charset=UTF-8'</pre><pre class="stack-trace">header - [internal], line ??
Cake\Http\ResponseEmitter::emitHeaders() - CORE/src/Http/ResponseEmitter.php, line 178
Cake\Http\ResponseEmitter::emit() - CORE/src/Http/ResponseEmitter.php, line 55
Cake\Http\Server::emit() - CORE/src/Http/Server.php, line 105
[main] - ROOT/webroot/index.php, line 37</pre></div></pre>{
"result": [
{
"Repository_data": {
"success": true,
"message": "Save Repositories success",
"object": {
"name": "Quantified-OSS",
"url": "https:\/\/mfaure@gitlab.adullact.net\/Quantifed-OSS\/Quantified-OSS.git",
"type_vcs": "git",
"is_stored": true,
"created": "2017-06-09T13:43:33+00:00",
"id": 2
}
},
"PreCompute": {
"success": false,
"message": "Clone Quantified-OSS failed with exception.",
"object": [
"Quantified-OSS",
{}
]
},
"Divisor": {
"success": true,
"message": "Save Averages success",
"object": {
"average_commit_1m": 0,
"average_commit_12m": 0,
"created": "2017-06-09T13:43:33+00:00",
"id": 2
}
},
"Compute": {
"success": false,
"message": "Failed to initiate RIV to calculate RFV. Computing failed.",
"object": 2
}
}
]
}
Edited by Matthieu FAURE