Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to start ZAP due to errors in the pipeline #8850

Open
nagababu0579 opened this issue Feb 11, 2025 · 12 comments
Open

Failing to start ZAP due to errors in the pipeline #8850

nagababu0579 opened this issue Feb 11, 2025 · 12 comments

Comments

@nagababu0579
Copy link

nagababu0579 commented Feb 11, 2025

We have been using ZAProxy from long back and everything was working fine until 2.0.15 version. We started seeing below issue from latest 2.0.16 version.

Can you please help if we ae missing anything? Tried including java 17 version as well, but the result is same.

We use the following bash script to run this:

sudo zaproxy -daemon -host localhost -port 8080 -silent -config api.disablekey=true -newsession  $env:SYSTEM_ARTIFACTSDIRECTORY\Zap -config globalexcludeurl.url_list.url.regex='^((?!http:\/\/localhost:811).*)$' &

/usr/bin/bash /home/vsts/work/_temp/32c93caa-5beb-4310-bc37-0ccc00ad8073.sh
starting zap
openjdk 11.0.26 2025-01-21
OpenJDK Runtime Environment Temurin-11.0.26+4 (build 11.0.26+4)
OpenJDK 64-Bit Server VM Temurin-11.0.26+4 (build 11.0.26+4, mixed mode)
Waiting for proxy to start...
g_module_open() failed for /snap/zaproxy/40/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-ani.so: /snap/zaproxy/40/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-ani.so: undefined symbol: g_once_init_enter_pointer
g_module_open() failed for /snap/zaproxy/40/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-gif.so: /snap/zaproxy/40/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-gif.so: undefined symbol: g_once_init_enter_pointer
g_module_open() failed for /snap/zaproxy/40/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-tiff.so: libtiff.so.6: cannot open shared object file: No such file or directory
/snap/zaproxy/40/zap.sh: line 50: [: -ge: unary operator expected
Exiting: ZAP requires a minimum of Java 11 to run, found
@psiinon
Copy link
Member

psiinon commented Feb 11, 2025

Exiting: ZAP requires a minimum of Java 11 to run, found looks pretty clear to me.
Whats the error when you use Java 17?
This does not look like a ZAP bug at this stage.

@nagababu0579
Copy link
Author

From logs, it clearly has "openjdk 11.0.26 2025-01-21", but not sure why it again reports "ZAP requires a minimum of Java 11 to run, found".

@psiinon
Copy link
Member

psiinon commented Feb 11, 2025

How have you installed ZAP? Using exactly which release and where did you get it from?

@nagababu0579
Copy link
Author

Everything was working fine until 2.15.0 version. This issue started only from latest 2.16.0 version.

The agent is installing Ubuntu 22.04.5 [Not sure if this is installing Java 11].

We have following steps in our pipeline yaml :

  • sudo snap install zaproxy --classic
  • sudo apt install python3-testresources
  • pip install wheel
  • pip install --upgrade zapcli
  • Docker compose Pull and Up commands
  • bash script:
    ** java --version
    sudo zaproxy -daemon -host localhost -port 8080 -silent -config api.disablekey=true -newsession $env:SYSTEM_ARTIFACTSDIRECTORY\Zap -config globalexcludeurl.url_list.url.regex='^((?!http://localhost:811).*)$' &**

@kingthorin
Copy link
Member

If it's complaining about Java 11 you're still on 2.15 because 2.16 requires Java 17.

@nagababu0579
Copy link
Author

From logs, I see the following as part of the step 'sudo snap install zaproxy --classic':

/usr/bin/pwsh -NoLogo -NoProfile -NonInteractive -Command . '/home/vsts/work/_temp/4be285ad-3f04-4b64-a10f-eb3743724a59.ps1'
zaproxy 2.16.0 from Simon Bennetts (psiinon) installed

@nagababu0579
Copy link
Author

I think, I understood the reason. Ubuntu 22.04.5 LTS includes OpenJDK 11 as the default Java Development Kit (JDK). I will add script to install 17 version of OpenJDK and see if it makes any difference in the result.

@thc202
Copy link
Member

thc202 commented Feb 11, 2025

The error is currently misleading, the newer ZAP version does require Java 17.

@nagababu0579
Copy link
Author

Anyone has an idea on how to install specific version of ZAProxy using snap install command?

Tried this, but does not work as expected -> sudo snap install zaproxy --channel=2.15/stable --classic

@thc202
Copy link
Member

thc202 commented Feb 11, 2025

Older versions are not available right now, we need to manually tweak that.

@sl2mmin
Copy link

sl2mmin commented Feb 18, 2025

I am facing the same issue but the problem is not the Java version but the zaproxy binary itself. For some reason, it is unable to get the Java version.

student@desktop:~$ /snap/bin/zaproxy
/snap/zaproxy/40/zap.sh: line 50: [: -ge: unary operator expected
Exiting: ZAP requires a minimum of Java 11 to run, found 
student@desktop:~$ java --version
openjdk 17.0.14 2025-01-21
OpenJDK Runtime Environment (build 17.0.14+7-Ubuntu-122.04.1)
OpenJDK 64-Bit Server VM (build 17.0.14+7-Ubuntu-122.04.1, mixed mode, sharing)

If I run /snap/zaproxy/40/zap.sh directly it launches just fine.

student@desktop:~$ /snap/zaproxy/40/zap.sh
Found Java version 17.0.14
Available memory: 7966 MB
Using JVM args: -Xmx1991m
...

My ZAP version is 2.16.0 and my OS is Ubuntu 22.04.5 LTS.

@thc202
Copy link
Member

thc202 commented Feb 18, 2025

I just tried again and the snap package is launching/running fine. I don't even have Java installed on the system, it's using the one from the snap package.

zaproxy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants