Skip to content

Commit

Permalink
ONGDB-244 - Windows package failing to startup with invalid start com…
Browse files Browse the repository at this point in the history
…mand
  • Loading branch information
bradnussbaum committed Mar 16, 2021
1 parent e1a4721 commit 2a1c8c1
Show file tree
Hide file tree
Showing 96 changed files with 3,141 additions and 1,169 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private static void includeCsvArguments( Arguments arguments )
" INTEGER: arbitrary integer values for identifying nodes,\n" +
" ACTUAL: (advanced) actual node ids.\n" +
"For more information on id handling, please see the ONgDB Manual: " +
"https://graphfoundation.org/docs/operations-manual/current/tools/import/" ) )
"https://graphfoundation.org/ongdb/docs/operations-manual/current/tools/import/" ) )
.withArgument( new OptionalNamedArg( "input-encoding", "character-set", "UTF-8",
"Character set that input data is encoded in." ) )
.withArgument( new OptionalBooleanArg( "ignore-extra-columns", false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ public void shouldPrintNiceHelp() throws Throwable
" INTEGER: arbitrary integer values for identifying nodes,%n" +
" ACTUAL: (advanced) actual node ids.%n" +
" For more information on id handling, please see the ONgDB Manual:%n" +
" https://graphfoundation.org/docs/operations-manual/current/tools/import/%n" +
" https://graphfoundation.org/ongdb/docs/operations-manual/current/tools/import/%n" +
" [default:STRING]%n" +
" --input-encoding=<character-set>%n" +
" Character set that input data is encoded in. [default:UTF-8]%n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public interface ExecutionPlanDescription
* Signifies that the query was profiled, and that statistics from the profiling can
* {@link #getProfilerStatistics() be retrieved}.
*
* The <a href="https://graphfoundation.org/docs/developer-manual/current/geequel/execution-plans/">{@code PROFILE}</a> directive in Geequel
* The <a href="https://graphfoundation.org/ongdb/docs/developer-manual/current/geequel/execution-plans/">{@code PROFILE}</a> directive in Geequel
* ensures the presence of profiler statistics in the plan description.
*
* @return true, if {@link ProfilerStatistics} are available for this execution step
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public QueryExecutionException( String message, Throwable cause, String statusCo
}

/**
* The ONgDB error <a href="https://graphfoundation.org/docs/developer-manual/current/reference/status-codes/">status code</a>.
* The ONgDB error <a href="https://graphfoundation.org/ongdb/docs/developer-manual/current/reference/status-codes/">status code</a>.
*
* @return the ONgDB error status code.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
* In Geequel there are three different modes of execution:
* <ul>
* <li>Normal execution,</li>
* <li>execution with the <a href="https://graphfoundation.org/docs/developer-manual/current/geequel/execution-plans/">{@code PROFILE}</a> directive,
* <li>execution with the <a href="https://graphfoundation.org/ongdb/docs/developer-manual/current/geequel/execution-plans/">{@code PROFILE}</a> directive,
* and</li>
* <li>execution with the <a href="https://graphfoundation.org/docs/developer-manual/current/geequel/execution-plans/">{@code EXPLAIN}</a>
* <li>execution with the <a href="https://graphfoundation.org/ongdb/docs/developer-manual/current/geequel/execution-plans/">{@code EXPLAIN}</a>
* directive.</li>
* </ul>
* Instances of this class contain the required information to be able to tell these different execution modes apart.
Expand Down Expand Up @@ -144,7 +144,7 @@ public QueryType queryType()
* {@linkplain ExecutionPlanDescription#getProfilerStatistics() contains profiling information}.
*
* This is {@code true} for queries executed with the
* <a href="https://graphfoundation.org/docs/developer-manual/current/geequel/execution-plans/">{@code PROFILE}</a> directive.
* <a href="https://graphfoundation.org/ongdb/docs/developer-manual/current/geequel/execution-plans/">{@code PROFILE}</a> directive.
*
* @return {@code true} if the results from this execution would contain profiling information.
*/
Expand All @@ -158,7 +158,7 @@ public boolean isProfiled()
* {@linkplain ExecutionPlanDescription description of the execution plan}.
*
* This is {@code true} for queries executed with either the
* <a href="https://graphfoundation.org/docs/developer-manual/current/geequel/execution-plans/">{@code EXPLAIN} or {@code PROFILE} directives</a>.
* <a href="https://graphfoundation.org/ongdb/docs/developer-manual/current/geequel/execution-plans/">{@code EXPLAIN} or {@code PROFILE} directives</a>.
*
* @return {@code true} if a description of the plan should be presented to the user.
*/
Expand All @@ -169,7 +169,7 @@ public boolean requestedExecutionPlanDescription()

/**
* Signifies that the query was executed with the
* <a href="https://graphfoundation.org/docs/developer-manual/current/geequel/execution-plans/">{@code EXPLAIN} directive</a>.
* <a href="https://graphfoundation.org/ongdb/docs/developer-manual/current/geequel/execution-plans/">{@code EXPLAIN} directive</a>.
*
* @return {@code true} if the query was executed using the {@code EXPLAIN} directive.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ private static String manualReference( ManualPage page, Anchor anchor )
versionParts[0] = versionParts[0].substring(0, 3);
String docsVersion = String.join("-", versionParts);

return " https://graphfoundation.org/docs/operations-manual/" + docsVersion + "/" +
return " https://graphfoundation.org/ongdb/docs/operations-manual/" + docsVersion + "/" +
page.getReference( anchor );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1267,25 +1267,25 @@ public void shouldPrintReferenceLinkOnDataImportErrors()
shouldPrintReferenceLinkAsPartOfErrorMessage( nodeIds(),
Iterators.iterator( new RelationshipDataLine( "1", "", "type", "name" ) ),
"Relationship missing mandatory field 'END_ID', read more about relationship " +
"format in the manual: https://graphfoundation.org/docs/operations-manual/" +
"format in the manual: https://graphfoundation.org/ongdb/docs/operations-manual/" +
docsVersion +
"/tools/import/file-header-format/#import-tool-header-format-rels" );
shouldPrintReferenceLinkAsPartOfErrorMessage( nodeIds(),
Iterators.iterator( new RelationshipDataLine( "", "1", "type", "name" ) ),
"Relationship missing mandatory field 'START_ID', read more about relationship " +
"format in the manual: https://graphfoundation.org/docs/operations-manual/" +
"format in the manual: https://graphfoundation.org/ongdb/docs/operations-manual/" +
docsVersion +
"/tools/import/file-header-format/#import-tool-header-format-rels" );
shouldPrintReferenceLinkAsPartOfErrorMessage( nodeIds(),
Iterators.iterator( new RelationshipDataLine( "1", "2", "", "name" ) ),
"Relationship missing mandatory field 'TYPE', read more about relationship " +
"format in the manual: https://graphfoundation.org/docs/operations-manual/" +
"format in the manual: https://graphfoundation.org/ongdb/docs/operations-manual/" +
docsVersion +
"/tools/import/file-header-format/#import-tool-header-format-rels" );
shouldPrintReferenceLinkAsPartOfErrorMessage( Arrays.asList( "1", "1" ),
Iterators.iterator( new RelationshipDataLine( "1", "2", "type", "name" ) ),
"Duplicate input ids that would otherwise clash can be put into separate id space, read more " +
"about how to use id spaces in the manual: https://graphfoundation.org/docs/operations-manual/" +
"about how to use id spaces in the manual: https://graphfoundation.org/ongdb/docs/operations-manual/" +
docsVersion +
"/tools/import/file-header-format/#import-tool-id-spaces" );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public DeadlockDetectedException( String message, Throwable cause )
"between these transactions. This exception was thrown instead of ending up in that deadlock.\n" +
"\n" +
"See the deadlock section in the ONgDB Java developer reference for how to avoid this: " +
"https://graphfoundation.org/docs/java-reference/current/#transactions-deadlocks\n" +
"https://graphfoundation.org/ongdb/docs/java-reference/current/#transactions-deadlocks\n" +
"\n" +
"Details: '" + message + "'.", cause );
}
Expand Down
2 changes: 1 addition & 1 deletion community/udc/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ The Usage Data Collector (UDC) is a kernel extension which collects
statistics about a Neo4j Server.

For details, please see:
https://graphfoundation.org/docs/operations-manual/current/configuration/usage-data-collector/
https://graphfoundation.org/ongdb/docs/operations-manual/current/configuration/usage-data-collector/
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public String description()
" for very large databases. Increasing the heap size can also be a good idea." +
" See 'ongdb-admin help' for details.%n" +
"%n" +
"For more information see: https://graphfoundation.org/docs/operations-manual/current/backup/" );
"For more information see: https://graphfoundation.org/ongdb/docs/operations-manual/current/backup/" );
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private static List<String> backupOutput()
lines.add( "also be a good idea. See 'ongdb-admin help' for details." );
lines.add( "" );
lines.add( "For more information see:" );
lines.add( "https://graphfoundation.org/docs/operations-manual/current/backup/" );
lines.add( "https://graphfoundation.org/ongdb/docs/operations-manual/current/backup/" );
lines.add( "" );
lines.add( "options:" );
lines.add( " --backup-dir=<backup-path> Directory to place backup in." );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void shouldPrintNiceHelp() throws Throwable
"also be a good idea. See 'ongdb-admin help' for details.%n" +
"%n" +
"For more information see:%n" +
"https://graphfoundation.org/docs/operations-manual/current/backup/%n" +
"https://graphfoundation.org/ongdb/docs/operations-manual/current/backup/%n" +
"%n" +
"options:%n" +
" --backup-dir=<backup-path> Directory to place backup in.%n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# Copyright (c) 2002-2018 "Neo Technology,"
# Network Engine for Objects in Lund AB [http://neotechnology.com]
# Copyright (c) 2002-2018 "Neo4j,"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
Expand All @@ -33,39 +33,40 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

# Module manifest for module 'ONgDB-Management'
#


@{
ModuleVersion = '3.0.0'
ModuleVersion = '1.0.0'

GUID = '2a3e34b4-5564-488e-aaf6-f2cba3f7f05d'
GUID = '2a3e34b4-5564-488e-aaf6-f2cba3f7f05d'

Author = 'Network Engine for Objects'
Author = 'Graph Foundation'

CompanyName = 'Network Engine for Objects'
CompanyName = 'Graph Foundation, Inc.'

Copyright = 'https://graphfoundation.org/licensing/'
Copyright = 'https://graphfoundation.org/ongdb/'

Description = 'Powershell module to manage a ONgDB instance on Windows'
Description = 'Powershell module to manage a ONgDB instance on Windows'

PowerShellVersion = '2.0'
PowerShellVersion = '2.0'

NestedModules = @('ONgDB-Management\ONgDB-Management.psm1')
NestedModules = @('ONgDB-Management\ONgDB-Management.psm1')

FunctionsToExport = @(
'Invoke-ONgDB',
'Invoke-ONgDBAdmin',
'Invoke-ONgDBShell',
'Invoke-ONgDBBackup',
'Invoke-ONgDBImport'
)
FunctionsToExport = @(
'Invoke-ONgDB',
'Invoke-ONgDBAdmin',
'Invoke-ONgDBShell',
'Invoke-ONgDBBackup',
'Invoke-ONgDBImport',
'Get-Args'
)

CmdletsToExport = ''
CmdletsToExport = ''

VariablesToExport = ''
VariablesToExport = ''

AliasesToExport = ''
AliasesToExport = ''
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# Copyright (c) 2002-2018 "Neo Technology,"
# Network Engine for Objects in Lund AB [http://neotechnology.com]
# Copyright (c) 2002-2018 "Neo4j,"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
Expand All @@ -37,10 +37,10 @@

<#
.SYNOPSIS
Confirms whether the specificed java executable is suitable for ONgDB
Confirms whether the specificed java executable is suitable for ONgDB and checks if Java is Java 8
.DESCRIPTION
Confirms whether the specificed java executable is suitable for ONgDB
Confirms whether the specificed java executable is suitable for ONgDB and checks if Java is Java 8
.PARAMETER Path
Full path to the Java executable, java.exe
Expand All @@ -51,83 +51,80 @@ Get-JavaVersion -Path 'C:\Program Files\Java\jre1.8.0_71\bin\java.exe'
Retrieves the Java version for 'C:\Program Files\Java\jre1.8.0_71\bin\java.exe'.
.OUTPUTS
System.Boolean
System.Collections.Hashtable
isValid
isJava8
.NOTES
This function is private to the powershell module
#>
Function Confirm-JavaVersion
function Get-JavaVersion
{
[cmdletBinding(SupportsShouldProcess=$false,ConfirmImpact='Low')]
param (
[Parameter(Mandatory=$true,ValueFromPipeline=$false)]
[String]$Path
[CmdletBinding(SupportsShouldProcess = $false,ConfirmImpact = 'Low')]
param(
[Parameter(Mandatory = $true,ValueFromPipeline = $false)]
[string]$Path
)

Begin {
begin {
}

Process {
$stdError = New-ONgDBTempFile -Prefix 'stderr'

# Run Java with redirection
$args = @('-version')
Write-Verbose "Executing $Path $args"
$result = Start-Process -FilePath $Path -ArgumentList $args -NoNewWindow -Wait -RedirectStandardError $stdError -PassThru

process {
$result = Invoke-ExternalCommand -Command $Path -CommandArgs @('-version')

# Check the output
if ($result.ExitCode -ne 0) {
Write-Verbose "Java returned exit code $($result.ExitCode)"
if ($result.exitCode -ne 0) {
Write-Warning "Unable to determine Java Version"
return $true
}
if (-not (Test-Path -Path $stdError)) {
Write-Host $result.capturedOutput
return @{ 'isValid' = $true; 'isJava8' = $true }
}

if ($result.capturedOutput.Count -eq 0) {
Write-Verbose "Java did not output version information"
Write-Warning "Unable to determine Java Version"
return $true
return @{ 'isValid' = $true; 'isJava8' = $true }
}

$javaHelpText = "* Please use Oracle(R) Java(TM) 8, OpenJDK(TM) or IBM J9 to run ONgDB Server.`n" +
"* Please see https://graphfoundation.org/docs/ for ONgDB installation instructions."
"* Please see https://graphfoundation.org/ongdb/docs/ for ONgDB installation instructions."

# Read the contents of the redirected output
$content = (Get-Content -Path $stdError) -join "`n`r"
$content = $result.capturedOutput -join "`n`r"

# Remove the temp file
Remove-Item -Path $stdError -Force | Out-Null

# Use a simple regular expression to extract the java version
Write-Verbose "Java version response: $content"
if ($matches -ne $null) { $matches.Clear() }
if ($matches -ne $null) { $matches.Clear() }
if ($content -match 'version \"(.+)\"') {
$javaVersion = $matches[1]
Write-Verbose "Java Version detected as $javaVersion"
} else {
Write-Verbose "Could not determing the Java Version"
Write-Verbose "Could not determine the Java Version"
Write-Warning "Unable to determine Java Version"
return $true
return @{ 'isValid' = $true; 'isJava8' = $true }
}

# Check for Java Version Compatibility
# Anything less than Java 1.8 will block execution
# Note - This text comparsion will fail for '1.10.xxx' due to how string based comparisons of numbers works.
# Note - This text comparison will fail for '1.10.xxx' due to how string based comparisons of numbers works.
if ($javaVersion -lt '1.8') {
Write-Warning "ERROR! ONgDB cannot be started using java version $($javaVersion)"
Write-Warning $javaHelpText
return $false
return @{ 'isValid' = $false; 'isJava8' = $false }
}

# Anything less then 1.9 is some Java 1.8 version
$isJava8 = $javaVersion -lt '1.9'

# Check for Java Edition
$regex = '(Java HotSpot\(TM\)|OpenJDK|IBM) (64-Bit Server|Server|Client|J9) VM'
if (-not ($content -match $regex)) {
Write-Warning "WARNING! You are using an unsupported Java runtime"
Write-Warning "WARNING! You are using an unsupported Java runtime"
Write-Warning $javaHelpText
}

return $true
Write-Output @{ 'isValid' = $true; 'isJava8' = $isJava8 }
}
End {

end {
}
}
Loading

0 comments on commit 2a1c8c1

Please sign in to comment.