NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.88k stars 13.94k forks source link

Maltego not launching #330846

Open CDaut opened 2 months ago

CDaut commented 2 months ago

Describe the bug

when executing maltego the program does not launch. The following output & error message is produced instead:

java is /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9/bin/java
found java executable in PATH
pwd: file:/nix/store/zhhb20183hm0vlwvlnqcdncxbipw3brc-maltego-4.7.0/share/maltego/maltego-ui/modules/ext/Java_Config_App.jar
install conf: /nix/store/zhhb20183hm0vlwvlnqcdncxbipw3brc-maltego-4.7.0/share/maltego/etc/maltego.conf
install version: v4.7.0
user conf: /home/<uname>/.maltego/v4.7.0/etc/maltego.conf
JAVA_HOME: /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9
current java: /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9/lib/openjdk
Exception in thread "main" java.lang.NullPointerException: Cannot read the array length because "<local8>" is null
    at com.paterva.maltego.java.config.jre.unix.UnixDetectJava.getExistingSearchPaths(UnixDetectJava.java:81)
    at com.paterva.maltego.java.config.jre.unix.UnixDetectJava.getPathsToTry(UnixDetectJava.java:69)
    at com.paterva.maltego.java.config.jre.DetectJavas.detectJavas(DetectJavas.java:32)
    at com.paterva.maltego.java.config.jre.JavaUtils.detectJavas(JavaUtils.java:29)
    at com.paterva.maltego.java.config.app.SilentDetector.go(SilentDetector.java:23)
    at com.paterva.maltego.java.config.app.JavaOptionsApp.main(JavaOptionsApp.java:47)

Steps To Reproduce

Steps to reproduce the behavior:

  1. export NIXPKGS_ALLOW_UNFREE=1
  2. nix-shell -p maltego
  3. maltego

Expected behavior

Maltego launches

Notify maintainers

@emilytrau @D3vil0p3r

Metadata

 clara@nixpad ~ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.41, NixOS, 24.11 (Vicuna), 24.11.20240721.68c9ed8`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/store/afawjm6nv8m5aagkcqxlxgrr5qpyh6cm-source`

Add a :+1: reaction to issues you find important.

D3vil0p3r commented 2 months ago

I don't get the issue. When I run it I get:

WARNING: package com.apple.eawt not in java.desktop
Config File path = /home/athena/.maltego/v4.7.0/etc/maltego.conf
canonical: /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9
javaHome: /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9
resource:com/paterva/maltego/java/config/jre/TestJDK.class -> /tmp/temp114566562479169726013191761812698/TestJDK.class
executing: /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9/bin/java -classpath /tmp/temp114566562479169726013191761812698 TestJDK, in: .
 result: 0
 command execution finished
 out: 21.0.3, 21.0.3+9-nixos, N/A, Linux, amd64
jdkhome: /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9
canonical: /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9
javaHome: /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9
executing: /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9/bin/java -classpath /tmp/temp114566562479169726013191761812698 TestJDK, in: .
 result: 0
 command execution finished
 out: 21.0.3, 21.0.3+9-nixos, N/A, Linux, amd64
jdkhome: /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9
canonical: /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9
javaHome: /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9
executing: /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9/bin/java -classpath /tmp/temp114566562479169726013191761812698 TestJDK, in: .
 result: 0
 command execution finished
 out: 21.0.3, 21.0.3+9-nixos, N/A, Linux, amd64
jdkhome: /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9
canonical: /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9
javaHome: /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9
executing: /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9/bin/java -classpath /tmp/temp114566562479169726013191761812698 TestJDK, in: .
 result: 0
 command execution finished
 out: 21.0.3, 21.0.3+9-nixos, N/A, Linux, amd64
jdkhome: /nix/store/k9snfnb9i9yc1ww9r0bb0vah9mgwjw7c-openjdk-21.0.3+9
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by org.netbeans.TopSecurityManager (file:/nix/store/zhhb20183hm0vlwvlnqcdncxbipw3brc-maltego-4.7.0/share/maltego/platform/lib/boot.jar)
WARNING: Please consider reporting this to the maintainers of org.netbeans.TopSecurityManager
WARNING: System::setSecurityManager will be removed in a future release

My system:

 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.41, Athena OS, 24.11 (Vicuna), 24.11pre658304.b73c2221a46c`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Try to run sudo nix-channel --update and retry.

e1mo commented 2 months ago

I also can't start maltego, not even from nixos-unstable-small:

$ NIXPKGS_ALLOW_UNFREE=1 nix run github:nixos/nixpkgs/nixos-unstable-small#maltego --impure  
java is /nix/store/00qkmlz3vcydw9si4k3lzsrslpqbcprr-openjdk-21.0.3+9/bin/java
found java executable in PATH
pwd: file:/nix/store/z91fsxw6v3r1fq58g80inpghzvspm8h5-maltego-4.7.0/share/maltego/maltego-ui/modules/ext/Java_Config_App.jar
install conf: /nix/store/z91fsxw6v3r1fq58g80inpghzvspm8h5-maltego-4.7.0/share/maltego/etc/maltego.conf
install version: v4.7.0
user conf: /home/e1mo/.maltego/v4.7.0/etc/maltego.conf
JAVA_HOME: /nix/store/00qkmlz3vcydw9si4k3lzsrslpqbcprr-openjdk-21.0.3+9
current java: /nix/store/00qkmlz3vcydw9si4k3lzsrslpqbcprr-openjdk-21.0.3+9/lib/openjdk
Exception in thread "main" java.lang.NullPointerException: Cannot read the array length because "<local8>" is null
    at com.paterva.maltego.java.config.jre.unix.UnixDetectJava.getExistingSearchPaths(UnixDetectJava.java:81)
    at com.paterva.maltego.java.config.jre.unix.UnixDetectJava.getPathsToTry(UnixDetectJava.java:69)
    at com.paterva.maltego.java.config.jre.DetectJavas.detectJavas(DetectJavas.java:32)
    at com.paterva.maltego.java.config.jre.JavaUtils.detectJavas(JavaUtils.java:29)
    at com.paterva.maltego.java.config.app.SilentDetector.go(SilentDetector.java:23)
    at com.paterva.maltego.java.config.app.JavaOptionsApp.main(JavaOptionsApp.java:47)

System info & flake metadata:

$ nix run nixpkgs#nix-info -- -m                                       
 - system: `"x86_64-linux"`
 - host os: `Linux 6.9.7, NixOS, 24.11 (Vicuna), 24.11pre-git`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.4`
 - nixpkgs: `/nix/store/200d07cvmkk76k0p1x4wp4b5w8xifjc6-source`
$ nix flake metadata github:nixos/nixpkgs/nixos-unstable-small                             
Resolved URL:  github:nixos/nixpkgs/nixos-unstable-small
Locked URL:    github:nixos/nixpkgs/3fcada1050e3820241590679838954bacf7d38f8
Description:   A collection of packages for the Nix package manager
Path:          /nix/store/7s8i2s2sxblmlavgk3jwna1600kpw84g-source
Revision:      3fcada1050e3820241590679838954bacf7d38f8
Last modified: 2024-07-30 05:14:16
CDaut commented 2 months ago

This is my nix flake metadata

Resolved URL:  git+file:///home/clara/nix
Locked URL:    git+file:///home/clara/nix?ref=refs/heads/main&rev=85ccb4dda23c7bc00f32d9722d9f9d12c9f1910c
Description:   Flake to manage local systems
Path:          /nix/store/gifbgazkvvfawzcqw5v68jjgaxiwwswx-source
Revision:      85ccb4dda23c7bc00f32d9722d9f9d12c9f1910c
Revisions:     69
Last modified: 2024-07-30 08:27:08
Inputs:
├───home-manager: github:nix-community/home-manager/d34aaf7b3b4c98f2aefe0429b8946f2bcd36a59a
│   └───nixpkgs follows input 'nixpkgs'
└───nixpkgs: github:nixos/nixpkgs/b73c2221a46c13557b1b3be9c2070cc42cf01eb3

I seem to be on the same commit as you. Up to date from this morning, 8am CEST.

D3vil0p3r commented 2 months ago

Sorry, I cannot reproduce your issues. I tested it by using unstable NixOS images GNOME and by using:

export NIXPKGS_ALLOW_UNFREE=1
nix-shell -p maltego

or

export NIXPKGS_ALLOW_UNFREE=1
nix --extra-experimental-features "nix-command flakes" run github:nixos/nixpkgs/nixos-unstable-small#maltego --impure

seems to work well... Probably is there something weird on your configuration?

@SuperSandro2000 what do you think?

CDaut commented 2 months ago

Do you happen to have KDE or another DE installed? For a friend of mine with KDE installed it worked.

SuperSandro2000 commented 2 months ago

at com.paterva.maltego.java.config.jre.unix.UnixDetectJava.getExistingSearchPaths(UnixDetectJava.java:81)

Something in that line is crashing because something is missing and we can't know what or why because it is unfree software 🤷🏼

CDaut commented 2 months ago

It works in a nixos/nix:latest docker container

  1. docker run --rm --entrypoint "/bin/sh" -it --name nix nixos/nix:latest
  2. export NIXPKGS_ALLOW_UNFREE=1
  3. nix-shell -p maltego
  4. maltego
lordkiwiz commented 1 week ago

@CDaut I had the same issue. In my case it was because the config file in my home directory was missing. Creating the config file is easy though. mkdir -p ~/.maltego/v4.7.0/etc touch ~/.maltego/v4.7.0/etc/maltego.conf

After running the commands maltego starts.