Failed to start the main proxy

27 views
Skip to first unread message

Nathan

unread,
Aug 8, 2023, 4:43:35 AM8/8/23
to ZAP Developer Group
Hi, I am having an issue running ZAP multiple times to generate a report. I can run ZAP in command line in Kali Linux using the following command.
owasp-zap -daemon -quickurl https://example.com /home/kali/owasp/$(date +\%d.%m.%y-)Report.html

This command works fine so, what i have done is put this command in a script file to run via cron job say twice a week for E.G.

My cron job will run once then when it comes to running again ZAP has an issue where it fails to start main proxy and i get the following errors.

org.zaproxy.addon.network.ExtensionNetwork - Failed to start the main proxy: java.net.BindException Address already in use
17434 [ZAP-daemon] ERROR org.parosproxy.paros.CommandLine - Terminating ZAP, unable to start the main proxy.
27743 [ZAP-daemon] ERROR DataNucleus.Datastore.Schema - Failed initialising database.
org.datanucleus.exceptions.NucleusDataStoreException: Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@7ebdd70d[file =/home/kali/.ZAP/db/permanent.lck, exists=true, locked=false, valid=false, ] method: checkHear

When I load the Owasp Zap app I get this. If I click yes to use port 8091 my cron job will then run again but only once then the same issue happens again.Owasp error.PNG
I have tried going into the app and manually setting the proxy to port 8080 but it still happens, I have also tried different versions of ZAP but get the same issue. 

Dose anyone know how to fix this?

thc...@gmail.com

unread,
Aug 8, 2023, 4:53:59 AM8/8/23
to zaproxy...@googlegroups.com
Hi.

I think you want to use -cmd not -daemon, the latter keeps ZAP running
in the background, the former exits ZAP once all command line tasks are
done.

https://www.zaproxy.org/docs/desktop/cmdline/#options

Best regards.

Nathan

unread,
Aug 8, 2023, 5:46:09 AM8/8/23
to ZAP Developer Group
Ahhh perfect!! thank you!! that seems to have sorted my issue thanks a lot.
Reply all
Reply to author
Forward
0 new messages