@tommi wrote:
Hi,
we use Report API for getting result visit's pages. We create Http request with powershell script which he is executed with batch file. We have problem that Http request returns us after 30m exception:Exception calling "ReadToEnd" with "0" argument(s): "Unable to read data from the transport connection: The connection was closed." At D:\temp\downloader.ps1:31 char:14 + $sr.ReadToEnd <<<< () | Out-File $filename + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : DotNetMethodException
downloader.ps
[CmdletBinding()]
Param(#URL to download from [Parameter(Mandatory=$True,Position=1)] [string]$url, #Filename (or path) where should be downloaded content saved [Parameter(Mandatory=$True,Position=2)] [string]$filename, #Download timeout in milliseconds, the default value is one minute [Parameter(Mandatory=$False,Position=3)] [int]$timeout=60000 ) $myHttpWebRequest = [system.net.HttpWebRequest]::Create($url) $myHttpWebRequest.Timeout = $timeout $myHttpWebRequest.KeepAlive = $FALSE $myHttpWebRequest.ReadWriteTimeout = $timeout $myHttpWebRequest.ProtocolVersion = [system.net.HttpVersion]::Version10 $myHttpWebResponse = $myHttpWebRequest.GetResponse() $sr = new-object System.IO.StreamReader $myHttpWebResponse.GetResponseStream() $sr.ReadToEnd() | Out-File $filename
Batch file for execute downloader.ps
powershell -ExecutionPolicy RemoteSigned -File "downloader.ps1" "https://HOSTNAME/analytics/index.php?module=API&method=Actions.getPageUrls&idSite=4&period=year&date=last10&token_auth=MY_TOKEN_KEY&format=xml&expanded=1&showColumns=nb_visits" "prod.xml" 3600000
We use Piwik version 1.12.
I see that Apache server logged error message: “child pid 11174 exit signal Segmentation fault (11)“ i look at your page where u have this fail reported. We can't update version of piwik so i want ask what is best workround for my problem? I tried set bigger timeout on request, Apache server and php but it wasn't helpfull.
Posts: 1
Participants: 1