Jump to content
Ketarin forum

Any idea why this crashes Ketarin 50% of the time?


Recommended Posts

About every other time I run 'Update all' in Ketarin (1.8.11) anymore it crashes after about a minute. It wasn't until recently that I realized that it appears to happen while processing the below app. The error message is attached below, too.

Any help anyone can provide is welcome. :)

The error message references powershell, and this may have started around the time I updated my post-script collection routine, which makes sense. This script publishes all the update information to my website so I can automate updates on client devices. Here's the new version of that:

#### Support
function PKV {
	Param( $svName )
	
	#### identify variable type and collect stored content
	$svType = $app.variables.$svName.VariableType;
	if( $svType -eq "Textual" ){
		#### stored text content
		$svContent = $app.variables.$svName.TextualContent;
		#### process all child variables
		if( $svContent -like '*{*' ){
			$svContent2 = $app.variables.ReplaceAllInString("{$svName}", $sfiletime, $sfilename, $true);
			if ( $svContent2 -ne '' ){ $svContent = $svContent2; }
		}
	}else{
		#### other types of variables must be parsed
		$svContent = $app.variables.ReplaceAllInString("{$svName}", $sfiletime, $sfilename, $true);
	}
	
	#### parse version for psversion if it exists
	if( $svName -eq "version" ){
		if( $app.variables."psversion".TextualContent -ne "" ){
			$svContent = $app.variables.ReplaceAllInString("{$svName}", $sfiletime, $sfilename, $true);
		}
	}
	
	if( $svContent -eq "{$svName}" ){ $svContent = ''; }
	Write-Information $svName':'$svContent;
	$svContent
}
####


#### Parse cached variable values
$sname      = $($App.Name);
$sfilename  = $($App.CurrentLocation);
write-host 'Filename:'$sfilename;
$sappguid   = $($App.Guid);
write-host 'Guid:'$sappguid;
$scategory = $($App.Category);
	if($scategory -eq "{category}"){$scategory = '';}
	write-host 'scategory:'$scategory;
$sfiletime = [datetime]$( (Get-Item $sfilename).LastWriteTime );
	write-host 'Filetime:'$sfiletime;
$sversion = PKV ( 'version' );
$svendor = PKV ( 'svendor' );
$sslug = PKV ( 'spc' );
$stag = PKV ( 'stag' );
$smethod = PKV ( 'smethod' );
$spath = PKV ( 'spath' );
$sparams = PKV ( 'sparams' );
$sformat = PKV ( 'sformat' );
$swebsite = PKV ( 'swebsite' );
$schangelog = PKV ( 'schangelog' );
$sdownload = PKV ( 'sdownload' );
$splatform = PKV ( 'splatform' );
$sbits = PKV ( 'sbits' );
$snotes = PKV ( 'snotes' );
####


#### Append current log details
Try{
    ( "`n$($scategory)`t$($sslug)`t$($sname)`t$($sversion)`t$($snotes)`t$($schangelog)`t$($swebsite)" | Out-File Updates.txt -Append -Encoding "UTF8" )
}
Catch {
    echo 'Can not write to Updates.txt';
    echo "`n$($scategory)`t$($sslug)`t$($sname)`t$($sversion)`t$($snotes)`t$($schangelog)`t$($swebsite)";
}
####


#### Update ... is.xml Live
# POST data
echo 'Posting update information to ...';
$postParams = @{
	'key'='...';
	'vendor'=$($svendor);
	'name'=$($sname);
	'version'=$($sversion);
	'slug'=$($sslug);
	'tag'=$($stag);
	'method'=$($smethod);
	'path'=$($spath);
	'params'=$($sparams);
	'format'=$($sformat);
	'category'=$($scategory);
	'website'=$($swebsite);
	'changelog'=$($schangelog);
	'download'=$($sdownload);
	'platform'=$($splatform);
	'bits'=$($sbits);
	'notes'=$($snotes);
	'appguid'=$($sappguid);
}
echo 'Post body:';
$postParams.GetEnumerator()  | % { "$($_.Name)=$($_.Value)" };
$postResult = Invoke-WebRequest -Uri "https://example.com/post.php" -Method POST -Body $postParams
echo 'Post results';
echo $postResult.Content;
####


#### ADD DATE VARIABLE IF NOT EXISTING
# Parameters
$varnm = "LastUpdate"
$vartp = "Textual"   #StartEnd or #Textual or #RegularExpression
#
# Derived access property, ie. app.variables.$varnm.$varcnt
$varcnt = if($vartp -eq "Textual"){"TextualContent"}Else{"CachedContent"}

# If it doesn't exist, then create a new one
if(-Not $app.variables.$varnm){
    #
    ECHO "========== $varnm NOT FOUND, ADDING IT =========="
    #
    # Add var to job/app
    $newvar = New-Object -TypeName Ketarin.UrlVariable -ArgumentList $varnm,$app.variables
    $newvar.VariableType = $vartp
    $app.variables.Add($varnm, $newvar)
    $app.Save()
}

#Set it to the current date, short format(should be sortable)
$app.variables.$varnm.$varcnt = Get-Date -UFormat %Y%m%dT%H%M

#
####

 

<?xml version='1.0' encoding='utf-8'?>
<Jobs>
  <ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Guid="5e10ff93-d903-42b4-9364-5660e1ab35e5">
    <Category>Development</Category>
    <WebsiteUrl />
    <UserAgent />
    <UserNotes />
    <LastFileSize>9542280</LastFileSize>
    <LastFileDate>2020-08-02T11:53:48.0018496</LastFileDate>
    <IgnoreFileInformation>false</IgnoreFileInformation>
    <DownloadBeta>Default</DownloadBeta>
    <DownloadDate xsi:nil="true" />
    <CheckForUpdatesOnly>false</CheckForUpdatesOnly>
    <VariableChangeIndicator>version</VariableChangeIndicator>
    <HashVariable />
    <HashType>None</HashType>
    <CanBeShared>true</CanBeShared>
    <ShareApplication>false</ShareApplication>
    <ExclusiveDownload>false</ExclusiveDownload>
    <HttpReferer />
    <SetupInstructions />
    <Variables>
      <item>
        <key>
          <string>schangelog</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>https://developer.android.com/studio/releases/platform-tools</TextualContent>
            <Name>schangelog</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>swebsite</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>https://developer.android.com/studio/releases/platform-tools</TextualContent>
            <Name>swebsite</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>snotes</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent />
            <Name>snotes</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>spc</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>adblinux</TextualContent>
            <Name>spc</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>splatform</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>linux</TextualContent>
            <Name>splatform</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>sbits</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <Name>sbits</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>svendor</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>Google</TextualContent>
            <Name>svendor</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>version</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>([\d\.]+)\s\(</Regex>
            <Url>https://developer.android.com/studio/releases/platform-tools</Url>
            <TextualContent />
            <Name>version</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>sdownload</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>https://dl.google.com/android/repository/platform-tools-latest-linux.zip</TextualContent>
            <Name>sdownload</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>LastUpdate</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>20200802T1153</TextualContent>
            <Name>LastUpdate</Name>
          </UrlVariable>
        </value>
      </item>
    </Variables>
    <ExecuteCommand />
    <ExecutePreCommand />
    <ExecuteCommandType>Batch</ExecuteCommandType>
    <ExecutePreCommandType>Batch</ExecutePreCommandType>
    <SourceType>FixedUrl</SourceType>
    <PreviousLocation>K:\_Ketarin\Ketarin\..\Development\ADB_(Linux)-30.0.4.zip</PreviousLocation>
    <DeletePreviousFile>true</DeletePreviousFile>
    <Enabled>false</Enabled>
    <FileHippoId />
    <LastUpdated>2020-08-02T11:53:48.0018496</LastUpdated>
    <TargetPath>..\{category}\{appname:regexreplace:([\s\t\r\n\-\&amp;]+):_}-{version}.{url:ext}</TargetPath>
    <FixedDownloadUrl>{sdownload}</FixedDownloadUrl>
    <Name>ADB (Linux)</Name>
  </ApplicationJob>
</Jobs>

 

adb-linux-crash.png

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.