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

IOError: [Errno 13] Permission denied: u'/usr/local/zaproxy/zap.log' #50

Closed
PeterWilsonIFS opened this issue May 3, 2018 · 7 comments
Closed
Labels

Comments

@PeterWilsonIFS
Copy link

[INFO] Starting ZAP daemon
Traceback (most recent call last):
File "/home/ifs/.local/bin/zap-cli", line 11, in
sys.exit(cli())
File "/home/ifs/.local/lib/python2.7/site-packages/click/core.py", line 664, in call
return self.main(*args, **kwargs)
File "/home/ifs/.local/lib/python2.7/site-packages/click/core.py", line 644, in main
rv = self.invoke(ctx)
File "/home/ifs/.local/lib/python2.7/site-packages/click/core.py", line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/ifs/.local/lib/python2.7/site-packages/click/core.py", line 837, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/ifs/.local/lib/python2.7/site-packages/click/core.py", line 464, in invoke
return callback(*args, **kwargs)
File "/home/ifs/.local/lib/python2.7/site-packages/click/decorators.py", line 26, in new_func
return ctx.invoke(f, ctx.obj, *args[1:], **kwargs)
File "/home/ifs/.local/lib/python2.7/site-packages/click/core.py", line 464, in invoke
return callback(*args, **kwargs)
File "/home/ifs/.local/lib/python2.7/site-packages/zapcli/cli.py", line 55, in start_zap_daemon
zap_helper.start(options=start_options)
File "/home/ifs/.local/lib/python2.7/site-packages/zapcli/zap_helper.py", line 84, in start
with open(log_path, 'w+') as log_file:
IOError: [Errno 13] Permission denied: u'/usr/local/zaproxy/zap.log'
ifs@nthubuntu:~$ IOError: [Errno 13] Permission denied: u'/usr/local/zaproxy/zap.log'
IOError:: command not found

Just wondering what I am doing wrong.
Many thanks

@Grunny
Copy link
Owner

Grunny commented May 3, 2018

Hi @PeterWilsonIFS! It looks like the user you're running zap-cli as doesn't have write permissions in the directory /usr/local/zaproxy. zap-cli puts the log output for ZAP into a file called zap.log in that directory, so you need to be able to write to that directory. A simple fix might be to just take ownership of that directory, assuming you're running zap-cli as the user ifs:

sudo chown -R ifs.ifs /usr/local/zaproxy

Then it should hopefully work. :)

@Grunny Grunny added the question label May 3, 2018
@PeterWilsonIFS
Copy link
Author

Yep solved that problem.
Next problem is the start is timing out have attached the log file
zap.log

many thanks

@Grunny
Copy link
Owner

Grunny commented May 3, 2018

At the bottom of the log is Cannot listen on port localhost:8090, so looks like you might have something else already listening on port 8090. I'd try changing the port to something else.

@PeterWilsonIFS
Copy link
Author

I have run this command
sudo lsof -i -P -n |grep LISTEN
output
cupsd 792 root 10u IPv6 16753 0t0 TCP [::1]:631 (LISTEN)
cupsd 792 root 11u IPv4 16754 0t0 TCP 127.0.0.1:631 (LISTEN)
sshd 900 root 3u IPv4 18415 0t0 TCP *:22 (LISTEN)
sshd 900 root 4u IPv6 18417 0t0 TCP *:22 (LISTEN)
dnsmasq 946 nobody 5u IPv4 18721 0t0 TCP 127.0.1.1:53 (LISTEN)
xrdp 1213 xrdp 6u IPv4 20270 0t0 TCP *:3389 (LISTEN)
xrdp-sesm 1226 root 6u IPv4 20516 0t0 TCP 127.0.0.1:3350 (LISTEN)
java 2627 ifs 179u IPv6 30219 0t0 TCP *:41925 (LISTEN)
java 2627 ifs 180u IPv6 31195 0t0 TCP 127.0.0.1:8090 (LISTEN)

But still the start times out

Many thanks

@PeterWilsonIFS
Copy link
Author

It also does nto seem to be able to talk to zap as when I as for status tells me it is not running yet I can see the GUI in front of me. Not sure if this helps.

Many thanks

@Grunny
Copy link
Owner

Grunny commented May 14, 2018

If you're running the GUI, what port is that running on? It looks like you have zap-cli trying to talk to it on port 8090, so while running the GUI you should be able to confirm if this is the port being used by opening http://127.0.0.1:8090 in your browser and see if the ZAP API page is shown. This is the page zap-cli will request to see if ZAP is running.

@PeterWilsonIFS
Copy link
Author

PeterWilsonIFS commented May 17, 2018

the important bit I discovered what that you have to have a proxy running onhttp://127.0.0.1:port zap-cli is useing then it all works a lot better :)

Many thaks

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

No branches or pull requests

2 participants